Changeset 718
- Timestamp:
- Apr 30, 2010, 5:45:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/painting/qwindowsurface_pm.cpp
r714 r718 333 333 bool vrnDirty; 334 334 bool vrnDisabled; 335 bool inDrag; 335 336 SETUP_BLITTER setup; 336 337 QVector<RECTL> rcls; … … 354 355 d->vrnDirty = true; 355 356 d->vrnDisabled = false; 357 d->inDrag = false; 356 358 357 359 memset(&d->setup, 0, sizeof(SETUP_BLITTER)); … … 399 401 QRect wbr = br.translated(-wOffset); 400 402 br.translate(offset); 403 404 if (d->inDrag) { 405 // In drag, DIVE seems to not synchronize well with the mouse buffer 406 // that preserves the contents under the mouse pointer and the drag 407 // image while dragging (even when we use DiveBlitImage()). As a result, 408 // we will get some areas unpainted under if painting is done during 409 // drag. Use the WinGetPS()/GpiDrawBits() way to fix it. The below code 410 // is merely a copy of QT_BITMAP_MIRROR == 3 from qwindowsurface_raster.cpp 411 412 HPS wps = window()->getPS(); 413 414 MATRIXLF m; 415 m.fxM11 = MAKEFIXED(1, 0); 416 m.fxM12 = 0; 417 m.lM13 = 0; 418 m.fxM21 = 0; 419 m.fxM22 = MAKEFIXED(-1, 0); 420 m.lM23 = 0; 421 m.lM31 = 0; 422 m.lM32 = window()->height() - 1; 423 GpiSetDefaultViewMatrix(wps, 8, &m, TRANSFORM_REPLACE); 424 425 // make sure br doesn't exceed the backing storage size (it may happen 426 // during resize & move due to the different event order) 427 br = br.intersected(QRect(0, 0, d->image->width(), d->image->height())); 428 429 BITMAPINFOHEADER2 bmh; 430 memset(&bmh, 0, sizeof(BITMAPINFOHEADER2)); 431 bmh.cbFix = sizeof(BITMAPINFOHEADER2); 432 bmh.cPlanes = 1; 433 bmh.cBitCount = d->image->depth(); 434 bmh.cx = d->image->width(); 435 bmh.cy = d->image->height(); 436 437 // Note: target is inclusive-inclusive, source is inclusive-exclusive 438 POINTL ptls[] = { { wbr.left(), wbr.top() }, 439 { wbr.right(), wbr.bottom() }, 440 { br.left(), br.top() }, 441 { br.right() + 1, br.bottom() + 1 } }; 442 GpiDrawBits(wps, (PVOID) const_cast<const QImage *>(d->image)->bits(), 443 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 444 445 window()->releasePS(wps); 446 447 return; 448 } 401 449 402 450 if (d->vrnDisabled) { … … 521 569 *result = 0; 522 570 return true; 571 } 572 case DM_DRAGOVER: { 573 d->inDrag = true; 574 break; 575 } 576 case DM_DRAGLEAVE: 577 case DM_DROP: { 578 d->inDrag = false; 579 break; 523 580 } 524 581 case WM_VRNENABLED: { … … 537 594 538 595 // process pending flush events 539 foreach(QPMDiveWindowSurfacePrivate::FlushArgs args, d->pending) {596 foreach(QPMDiveWindowSurfacePrivate::FlushArgs args, d->pending) 540 597 doFlush(args.from, args.to); 541 }542 598 d->pending.clear(); 543 599
Note:
See TracChangeset
for help on using the changeset viewer.