Changeset 758
- Timestamp:
- Jun 22, 2010, 9:20:42 PM (15 years ago)
- Location:
- trunk/src/gui/painting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/painting/qwindowsurface_pm.cpp
r753 r758 607 607 bmh.cy = d->image->height(); 608 608 609 // Note: target is inclusive-inclusive, source is inclusive-exclusive 610 POINTL ptls[] = { { wbr.left(), wbr.top() }, 611 { wbr.right(), wbr.bottom() }, 612 { br.left(), br.top() }, 613 { br.right() + 1, br.bottom() + 1 } }; 614 GpiDrawBits(wps, (PVOID) const_cast<const QImage *>(d->image)->bits(), 615 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 609 int wh = widget->height(); 610 611 // produce a clip region that excludes all descending obstacles 612 // (like child widgets with real HWNDs which are not excluded by Qt) 613 HWND wwnd = widget->winId(); 614 RECTL wrcl = { wbr.left(), wh - wbr.bottom() - 1, 615 wbr.right() + 1, wh - wbr.top() }; 616 HRGN wrgn = GpiCreateRegion(wps, 1L, &wrcl); 617 ULONG rc = qt_WinProcessWindowObstacles(wwnd, NULL, wrgn, CRGN_DIFF, 618 PWO_Children); 619 if (rc == RGN_RECT || rc == RGN_COMPLEX) { 620 // set the clip region 621 HRGN oldRgn; 622 GpiSetClipRegion(wps, wrgn, &oldRgn); 623 wrgn = oldRgn; 624 625 // Note: target is inclusive-inclusive, source is inclusive-exclusive 626 POINTL ptls[] = { { wbr.left(), wbr.top() }, 627 { wbr.right(), wbr.bottom() }, 628 { br.left(), br.top() }, 629 { br.right() + 1, br.bottom() + 1 } }; 630 GpiDrawBits(wps, (PVOID) const_cast<const QImage *>(d->image)->bits(), 631 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 632 } 633 634 if (wrgn != NULLHANDLE) 635 GpiDestroyRegion(wps, wrgn); 616 636 617 637 widget->releasePS(wps); -
trunk/src/gui/painting/qwindowsurface_raster.cpp
r745 r758 248 248 int ih = img.height(); 249 249 250 // Note: target is inclusive-inclusive, source is inclusive-exclusive 251 POINTL ptls[] = { { wbr.left(), wh - wbr.bottom() - 1 }, 252 { wbr.right(), wh - wbr.top() - 1 }, 253 { br.left(), ih - br.bottom() - 1 }, 254 { br.right() + 1, ih - br.top() } }; 250 // produce a clip region that excludes all descending obstacles 251 // (like child widgets with real HWNDs which are not excluded by Qt) 252 HWND wwnd = widget->winId(); 253 RECTL wrcl = { wbr.left(), wh - wbr.bottom() - 1, 254 wbr.right() + 1, wh - wbr.top() }; 255 HRGN wrgn = GpiCreateRegion(wps, 1L, &wrcl); 256 ULONG rc = qt_WinProcessWindowObstacles(wwnd, NULL, wrgn, CRGN_DIFF, 257 PWO_Children); 258 if (rc == RGN_RECT || rc == RGN_COMPLEX) { 259 // set the clip region 260 HRGN oldRgn; 261 GpiSetClipRegion(wps, wrgn, &oldRgn); 262 wrgn = oldRgn; 263 264 // Note: target is inclusive-inclusive, source is inclusive-exclusive 265 POINTL ptls[] = { { wbr.left(), wh - wbr.bottom() - 1 }, 266 { wbr.right(), wh - wbr.top() - 1 }, 267 { br.left(), ih - br.bottom() - 1 }, 268 { br.right() + 1, ih - br.top() } }; 255 269 #if 0 256 qDebug() << "QRasterWindowSurface::flush:" << widget << "ptls" 257 << ptls[0].x << ptls[0].y << ptls[1].x << ptls[1].y 258 << ptls[2].x << ptls[2].y << ptls[3].x << ptls[3].y 259 << "img.size" << img.size() << "img.bits" << img.bits(); 260 #endif 261 GpiDrawBits(wps, (PVOID) img.bits(), (PBITMAPINFO2) &bmh, 4, ptls, 262 ROP_SRCCOPY, BBO_IGNORE); 270 qDebug() << "QRasterWindowSurface::flush:" << widget << "ptls" 271 << ptls[0].x << ptls[0].y << ptls[1].x << ptls[1].y 272 << ptls[2].x << ptls[2].y << ptls[3].x << ptls[3].y 273 << "img.size" << img.size() << "img.bits" << img.bits(); 274 #endif 275 GpiDrawBits(wps, (PVOID) img.bits(), (PBITMAPINFO2) &bmh, 4, ptls, 276 ROP_SRCCOPY, BBO_IGNORE); 277 } 278 279 if (wrgn != NULLHANDLE) 280 GpiDestroyRegion(wps, wrgn); 263 281 264 282 #elif QT_BITMAP_MIRROR == 2 … … 288 306 bmh.cy = d->image->height(); 289 307 290 // Note: target is inclusive-inclusive, source is inclusive-exclusive 291 POINTL ptls[] = { { wbr.left(), wbr.top() }, 292 { wbr.right(), wbr.bottom() }, 293 { br.left(), br.top() }, 294 { br.right() + 1, br.bottom() + 1 } }; 308 int wh = widget->height(); 309 310 // produce a clip region that excludes all descending obstacles 311 // (like child widgets with real HWNDs which are not excluded by Qt) 312 HWND wwnd = widget->winId(); 313 RECTL wrcl = { wbr.left(), wh - wbr.bottom() - 1, 314 wbr.right() + 1, wh - wbr.top() }; 315 HRGN wrgn = GpiCreateRegion(wps, 1L, &wrcl); 316 ULONG rc = qt_WinProcessWindowObstacles(wwnd, NULL, wrgn, CRGN_DIFF, 317 PWO_Children); 318 if (rc == RGN_RECT || rc == RGN_COMPLEX) { 319 // set the clip region 320 HRGN oldRgn; 321 GpiSetClipRegion(wps, wrgn, &oldRgn); 322 wrgn = oldRgn; 323 324 // Note: target is inclusive-inclusive, source is inclusive-exclusive 325 POINTL ptls[] = { { wbr.left(), wbr.top() }, 326 { wbr.right(), wbr.bottom() }, 327 { br.left(), br.top() }, 328 { br.right() + 1, br.bottom() + 1 } }; 295 329 #if 0 296 qDebug() << "QRasterWindowSurface::flush:" << widget << "ptls" 297 << ptls[0].x << ptls[0].y << ptls[1].x << ptls[1].y 298 << ptls[2].x << ptls[2].y << ptls[3].x << ptls[3].y 299 << "img.size" << d->image->size() << "img.bits" << d->image->bits(); 300 #endif 301 302 // setup the Y coordinate inversion (this seems to use the same GPI matrix 303 // transformation internally as we do in method 3 below) 304 LONG oldInversion = GpiQueryYInversion(wps); 305 GpiEnableYInversion(wps, widget->height() - 1); 306 307 GpiDrawBits(wps, (PVOID) const_cast<const QImage &>(d->image->image).bits(), 308 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 309 310 GpiEnableYInversion(wps, oldInversion); 330 qDebug() << "QRasterWindowSurface::flush:" << widget << "ptls" 331 << ptls[0].x << ptls[0].y << ptls[1].x << ptls[1].y 332 << ptls[2].x << ptls[2].y << ptls[3].x << ptls[3].y 333 << "img.size" << d->image->size() << "img.bits" << d->image->bits(); 334 #endif 335 336 // setup the Y coordinate inversion (this seems to use the same GPI matrix 337 // transformation internally as we do in method 3 below) 338 LONG oldInversion = GpiQueryYInversion(wps); 339 GpiEnableYInversion(wps, widget->height() - 1); 340 341 GpiDrawBits(wps, (PVOID) const_cast<const QImage &>(d->image->image).bits(), 342 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 343 344 GpiEnableYInversion(wps, oldInversion); 345 } 346 347 if (wrgn != NULLHANDLE) 348 GpiDestroyRegion(wps, wrgn); 311 349 312 350 #ifndef QT_NO_DEBUG … … 353 391 bmh.cy = d->image->height(); 354 392 355 // Note: target is inclusive-inclusive, source is inclusive-exclusive 356 POINTL ptls[] = { { wbr.left(), wbr.top() }, 357 { wbr.right(), wbr.bottom() }, 358 { br.left(), br.top() }, 359 { br.right() + 1, br.bottom() + 1 } }; 360 GpiDrawBits(wps, (PVOID) const_cast<const QImage &>(d->image->image).bits(), 361 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 393 int wh = widget->height(); 394 395 // produce a clip region that excludes all descending obstacles 396 // (like child widgets with real HWNDs which are not excluded by Qt) 397 HWND wwnd = widget->winId(); 398 RECTL wrcl = { wbr.left(), wh - wbr.bottom() - 1, 399 wbr.right() + 1, wh - wbr.top() }; 400 HRGN wrgn = GpiCreateRegion(wps, 1L, &wrcl); 401 ULONG rc = qt_WinProcessWindowObstacles(wwnd, NULL, wrgn, CRGN_DIFF, 402 PWO_Children); 403 if (rc == RGN_RECT || rc == RGN_COMPLEX) { 404 // set the clip region 405 HRGN oldRgn; 406 GpiSetClipRegion(wps, wrgn, &oldRgn); 407 wrgn = oldRgn; 408 409 // Note: target is inclusive-inclusive, source is inclusive-exclusive 410 POINTL ptls[] = { { wbr.left(), wbr.top() }, 411 { wbr.right(), wbr.bottom() }, 412 { br.left(), br.top() }, 413 { br.right() + 1, br.bottom() + 1 } }; 414 GpiDrawBits(wps, (PVOID) const_cast<const QImage &>(d->image->image).bits(), 415 (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE); 416 } 417 418 if (wrgn != NULLHANDLE) 419 GpiDestroyRegion(wps, wrgn); 362 420 363 421 #ifndef QT_NO_DEBUG 364 // for debug flushing365 const QImage img = d->image->image;422 // for debug flushing 423 const QImage img = d->image->image; 366 424 #endif 367 425
Note:
See TracChangeset
for help on using the changeset viewer.