- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/pdf/ReaderWriterPDF.cpp
r12292 r13041 1 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1999-2008 Robert Osfield 2 2 * 3 * This software is open source and may be redistributed and/or modified under 3 * This software is open source and may be redistributed and/or modified under 4 4 * the terms of the GNU General Public License (GPL) version 2.0. 5 5 * The full license is in LICENSE.txt file included with this distribution,. 6 * 6 * 7 7 * This software is distributed in the hope that it will be useful, 8 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 10 * include LICENSE.txt for more details. 11 11 */ … … 34 34 void create(int width, int height) 35 35 { 36 if (_image->data() && width==_image->s() && height==_image->t()) 36 if (_image->data() && width==_image->s() && height==_image->t()) 37 37 { 38 38 return; … … 44 44 _image->allocateImage(width, height, 1, GL_RGBA, GL_UNSIGNED_BYTE); 45 45 _image->setPixelFormat(GL_BGRA); 46 _image->setDataVariance(osg::Object::DYNAMIC); 46 _image->setDataVariance(osg::Object::DYNAMIC); 47 47 _image->setOrigin(osg::Image::TOP_LEFT); 48 48 … … 51 51 _surface = cairo_image_surface_create_for_data( 52 52 _image->data(), 53 CAIRO_FORMAT_ARGB32, 54 width, height, 53 CAIRO_FORMAT_ARGB32, 54 width, height, 55 55 _image->getRowSizeInBytes()); 56 56 57 57 // create a context for the surface 58 _context = cairo_create(_surface); 58 _context = cairo_create(_surface); 59 59 } 60 60 … … 72 72 73 73 protected: 74 74 75 75 virtual ~CairoImage() 76 76 { … … 138 138 139 139 PopplerDocument* doc = poppler_document_new_from_file(uri.c_str(), NULL, NULL); 140 if (!doc) 140 if (!doc) 141 141 { 142 142 OSG_NOTICE<<" could not open("<<filename<<"), uri="<<uri<<std::endl;
