- Timestamp:
- Aug 17, 2009, 7:06:32 AM (16 years ago)
- Location:
- trunk/src/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/image/qnativeimage.cpp
r2 r115 141 141 } 142 142 143 #elif defined(Q_WS_PM) 144 145 QNativeImage::QNativeImage(int width, int height, QImage::Format format, 146 bool isTextBuffer, QWidget *widget) 147 { 148 image = QImage(width, height, format); 149 } 150 151 QNativeImage::~QNativeImage() 152 { 153 } 154 155 QImage::Format QNativeImage::systemFormat() 156 { 157 // @todo support 8-bit indexed colors? 158 // if (QColormap::instance().depth() == 16) 159 // return QImage::Format_RGB16; 160 return QImage::Format_RGB32; 161 } 143 162 144 163 #elif defined(Q_WS_X11) && !defined(QT_NO_MITSHM) -
trunk/src/gui/image/qnativeimage_p.h
r2 r115 56 56 #include "qimage.h" 57 57 58 #if def Q_WS_WIN58 #if defined(Q_WS_WIN) 59 59 #include "qt_windows.h" 60 60 … … 84 84 static QImage::Format systemFormat(); 85 85 86 #if def Q_WS_WIN86 #if defined(Q_WS_WIN) 87 87 HDC hdc; 88 88 HBITMAP bitmap; -
trunk/src/gui/kernel/qwidget.cpp
r112 r115 10359 10359 qErrnoWarning("QWidget::releaseDC(): failed to release HDC"); 10360 10360 } 10361 #elif defined (Q_WS_PM) 10362 /*! 10363 Returns the window system handle of the widget, for low-level 10364 access. Using this function is not portable. 10365 10366 An HPS acquired with getPS() has to be released with releasePS(). 10367 10368 \warning Using this function is not portable. 10369 */ 10370 HPS QWidget::getPS() const 10371 { 10372 Q_D(const QWidget); 10373 if (d->hd != NULLHANDLE) 10374 return (HPS) d->hd; 10375 return WinGetPS(winId()); 10376 } 10377 10378 /*! 10379 Releases the HPS \a hdc acquired by a previous call to getPS(). 10380 10381 \warning Using this function is not portable. 10382 */ 10383 void QWidget::releasePS(HPS hps) const 10384 { 10385 Q_D(const QWidget); 10386 // If there is a widget's own ps, the release operation is ignored because 10387 // it will be released elsewhere. Otherwise, we assume that the given hps 10388 // was acquired by WinGetPS in the getPS() call and release it. 10389 if (d->hd == NULLHANDLE) 10390 WinReleasePS(hps); 10391 } 10361 10392 #else 10362 10393 /*! -
trunk/src/gui/kernel/qwidget.h
r92 r115 583 583 HDC getDC() const; 584 584 void releaseDC(HDC) const; 585 #elif defined(Q_WS_PM) 586 HPS getPS() const; 587 void releasePS(HPS) const; 585 588 #else 586 589 Qt::HANDLE handle() const; -
trunk/src/gui/painting/qwindowsurface_raster.cpp
r2 r115 199 199 #endif 200 200 201 #endif 202 203 #ifdef Q_WS_PM 204 QRect br = rgn.boundingRect(); 205 #if 1 206 qDebug("QRasterWindowSurface::flush: [%s] br=%d,%d/%d,%d", 207 QWidgetPrivate::name(widget).constData(), 208 br.x(), br.y(), br.width(), br.height()); 209 #endif 210 211 HPS wps = widget->getPS(); 212 213 // use the reflection + transformation matrix to flip the y axis 214 // @todo check if it's really slower than flipping the image bits instead 215 // @todo I guess we can use DIVE here; check it too 216 MATRIXLF m; 217 m.fxM11 = MAKEFIXED(1, 0); 218 m.fxM12 = 0; 219 m.lM13 = 0; 220 m.fxM21 = 0; 221 m.fxM22 = MAKEFIXED(-1, 0); 222 m.lM23 = 0; 223 m.lM31 = 0; 224 m.lM32 = widget->height() - 1; 225 GpiSetDefaultViewMatrix(wps, 8, &m, TRANSFORM_REPLACE); 226 227 QPoint wOffset = qt_qwidget_data(widget)->wrect.topLeft(); 228 QRect wbr = br.translated(-wOffset); 229 230 br.translate(offset); 231 232 BITMAPINFOHEADER2 bmh; 233 memset(&bmh, 0, sizeof(BITMAPINFOHEADER2)); 234 bmh.cbFix = sizeof(BITMAPINFOHEADER2); 235 bmh.cPlanes = 1; 236 bmh.cBitCount = 32; // @todo support 8-bit indexed colors? 237 bmh.cx = d->image->width(); 238 bmh.cy = d->image->height(); 239 240 // Note: target is inclusive-inclusive, source is inclusive-exclusive 241 POINTL ptls[] = { { wbr.left(), wbr.top() }, 242 { wbr.right(), wbr.bottom() }, 243 { br.left(), br.top() }, 244 { br.right() + 1, br.bottom() + 1 } }; 245 GpiDrawBits(wps, (PVOID) d->image->image.bits(), (PBITMAPINFO2) &bmh, 4, ptls, 246 ROP_SRCCOPY, BBO_IGNORE); 247 248 widget->releasePS(wps); 201 249 #endif 202 250
Note:
See TracChangeset
for help on using the changeset viewer.