Changeset 561 for trunk/src/gui/image/qnativeimage.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/image/qnativeimage.cpp
r115 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 51 51 #include <sys/shm.h> 52 52 #include <qwidget.h> 53 54 55 56 53 57 #endif 54 58 … … 66 70 QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool isTextBuffer, QWidget *) 67 71 { 68 #ifndef Q_ OS_WINCE72 #ifndef Q_S_WINCE 69 73 Q_UNUSED(isTextBuffer); 70 74 #endif … … 79 83 if (format == QImage::Format_RGB16) { 80 84 bmi.bmiHeader.biBitCount = 16; 81 #ifdef Q_ OS_WINCE85 #ifdef Q_S_WINCE 82 86 if (isTextBuffer) { 83 87 bmi.bmiHeader.biCompression = BI_RGB; … … 117 121 static_cast<QRasterPaintEngine *>(image.paintEngine())->setDC(hdc); 118 122 119 #ifndef Q_ OS_WINCE123 #ifndef Q_S_WINCE 120 124 GdiFlush(); 121 125 #endif … … 164 168 165 169 QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* isTextBuffer */, QWidget *widget) 170 166 171 { 167 172 if (!X11->use_mitshm) { 168 xshmimg = 0;169 xshmpm = 0;170 173 image = QImage(width, height, format); 174 175 176 177 178 171 179 return; 172 180 } … … 190 198 xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0); 191 199 xshminfo.shmaddr = xshmimg->data; 200 201 192 202 ok = (xshminfo.shmaddr != (char*)-1); 193 203 if (ok) … … 211 221 return; 212 222 } 213 xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data, 214 &xshminfo, width, height, dd); 215 if (!xshmpm) { 216 qWarning() << "QNativeImage: Unable to create shared Pixmap."; 223 if (X11->use_mitshm_pixmaps) { 224 xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data, 225 &xshminfo, width, height, dd); 226 if (!xshmpm) { 227 qWarning() << "QNativeImage: Unable to create shared Pixmap."; 228 } 217 229 } 218 230 } … … 245 257 #elif defined(Q_WS_MAC) 246 258 247 QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* isTextBuffer */, QWidget * )259 QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* isTextBuffer */, QWidget *) 248 260 : image(width, height, format) 249 261 { 250 cgColorSpace = CGColorSpaceCreateDeviceRGB(); 262 263 251 264 uint cgflags = kCGImageAlphaNoneSkipFirst; 252 265 253 266 #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version 254 if(QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4)255 cgflags |= kCGBitmapByteOrder32Host; 256 #endif 257 258 cg = CGBitmapContextCreate(image.bits(), width, height, 8, image.bytesPerLine(), cgColorSpace, cgflags);267 268 #endif 269 270 cg = CGBitmapContextCreate(image.bits(), width, height, 8, image.bytesPerLine(), 271 , cgflags); 259 272 CGContextTranslateCTM(cg, 0, height); 260 273 CGContextScaleCTM(cg, 1, -1); … … 268 281 { 269 282 CGContextRelease(cg); 270 CGColorSpaceRelease(cgColorSpace);271 283 } 272 284
Note:
See TracChangeset
for help on using the changeset viewer.