Changeset 308 for trunk/src/gui/painting/qwindowsurface_raster.cpp
- Timestamp:
- Nov 10, 2009, 1:49:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/painting/qwindowsurface_raster.cpp
r143 r308 66 66 #endif 67 67 68 #if defined(Q_WS_PM) && defined(QT_LOG_BLITSPEED) 69 #include <InnotekLIBC/FastInfoBlocks.h> 70 #endif 71 68 72 QT_BEGIN_NAMESPACE 69 73 70 74 #ifdef Q_WS_WIN 71 75 PtrUpdateLayeredWindowIndirect ptrUpdateLayeredWindowIndirect; 76 #endif 77 78 #if defined(Q_WS_PM) && defined(QT_LOG_BLITSPEED) 79 unsigned long long qt_total_blit_ms = 0; 80 unsigned long long qt_total_blit_pixels = 0; 72 81 #endif 73 82 … … 203 212 #ifdef Q_WS_PM 204 213 QRect br = rgn.boundingRect(); 214 215 HPS wps = widget->getPS(); 216 205 217 #if 0 206 qDebug("QRasterWindowSurface::flush: [%s] br=%d,%d/%d,%d", 218 qDebug("QRasterWindowSurface::flush: [%s] wps %x br %d,%d/%d,%d", 219 qWidgetName(widget).toUtf8().constData(), (unsigned int)wps, 220 br.x(), br.y(), br.width(), br.height()); 221 #endif 222 223 #ifdef QT_LOG_BLITSPEED 224 unsigned long ticks = fibGetMsCount(); 225 #endif 226 227 #if 1 228 // flip the image vertically for PM 229 QImage img = d->image->image.mirrored(); 230 231 QPoint wOffset = qt_qwidget_data(widget)->wrect.topLeft(); 232 QRect wbr = br.translated(-wOffset); 233 234 br.translate(offset); 235 236 BITMAPINFOHEADER2 bmh; 237 memset(&bmh, 0, sizeof(BITMAPINFOHEADER2)); 238 bmh.cbFix = sizeof(BITMAPINFOHEADER2); 239 bmh.cPlanes = 1; 240 bmh.cBitCount = 32; // @todo support 8-bit indexed colors? 241 bmh.cx = img.width(); 242 bmh.cy = img.height(); 243 244 int wh = widget->height(); 245 int ih = img.height(); 246 247 // Note: target is inclusive-inclusive, source is inclusive-exclusive 248 POINTL ptls[] = { { wbr.left(), wh - wbr.bottom() - 1 }, 249 { wbr.right(), wh - wbr.top() - 1 }, 250 { br.left(), ih - br.bottom() - 1 }, 251 { br.right() + 1, ih - br.top() } }; 252 #if 0 253 qDebug("QRasterWindowSurface::flush: [%s] ptls %ld,%ld-%ld,%ld %ld,%ld-%ld,%ld", 207 254 qWidgetName(widget).toUtf8().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 255 ptls[0].x, ptls[0].y, ptls[1].x, ptls[1].y, 256 ptls[2].x, ptls[2].y, ptls[3].x, ptls[3].y); 257 #endif 258 GpiDrawBits(wps, (PVOID) img.bits(), (PBITMAPINFO2) &bmh, 4, ptls, 259 ROP_SRCCOPY, BBO_IGNORE); 260 #else 261 // use the reflection + transformation matrix to flip the y axis. 262 // This should be slower than flipping the image ourselves (unless this 263 // particular matrix is recognized by the driver which then enters some 264 // special mode that doesn't require any flipping at all but uses the 265 // image as is) hence disabled for now. 214 266 // @todo check if it's really slower than flipping the image bits instead 215 267 // @todo I guess we can use DIVE here; check it too … … 246 298 ROP_SRCCOPY, BBO_IGNORE); 247 299 300 #ifndef QT_NO_DEBUG 301 // for debug flushing 302 const QImage img = d->image->image; 303 #endif 304 #endif 305 248 306 widget->releasePS(wps); 249 #endif 307 308 #ifdef QT_LOG_BLITSPEED 309 ticks = fibGetMsCount() - ticks; 310 qt_total_blit_ms += ticks; 311 qt_total_blit_pixels += br.width() * br.height(); 312 #endif 313 314 #ifndef QT_NO_DEBUG 315 static bool flush = !qgetenv("QT_FLUSH_WINDOWSURFACE").isEmpty(); 316 if (flush) { 317 HPS dps = qt_display_ps(); 318 RECTL rcl = { 10, 50, 10 + img.width() + 2, 50 + img.height() + 2 }; 319 WinDrawBorder(dps, &rcl, 1, 1, CLR_BLACK, CLR_BLACK, 0); 320 POINTL ptls[] = { { 11, 51, }, 321 { 11 + img.width() - 1, 51 + img.height() - 1 }, 322 { 0, 0 }, 323 { img.width(), img.height() } }; 324 GpiDrawBits(dps, (PVOID) img.bits(), (PBITMAPINFO2) &bmh, 4, ptls, 325 ROP_SRCCOPY, BBO_IGNORE); 326 } 327 #endif 328 329 #endif // Q_WS_PM 250 330 251 331 #ifdef Q_WS_X11
Note:
See TracChangeset
for help on using the changeset viewer.