Changeset 10373 for trunk/src/gdi32/blit.cpp
- Timestamp:
- Jan 11, 2004, 12:42:14 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r10167 r10373 1 /* $Id: blit.cpp,v 1.4 5 2003-07-16 10:46:16sandervl Exp $ */1 /* $Id: blit.cpp,v 1.46 2004-01-11 11:42:08 sandervl Exp $ */ 2 2 3 3 /* … … 17 17 #include <winuser32.h> 18 18 #include <dbglog.h> 19 #include "oslibgpi.h" 20 #include <dcdata.h> 19 21 #include "dibsect.h" 20 22 #include "rgbcvt.h" … … 48 50 rc = dsect->BitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, 49 51 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop); 50 return rc;52 goto blitdone; 51 53 } 52 54 } 53 55 rc = O32_StretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop); 54 if(DIBSection::getSection() != NULL) { 55 DIBSection *destdib = DIBSection::findHDC(hdcDest); 56 if(destdib) { 57 destdib->sync(hdcDest, nYOriginDest, nHeightDest); 58 } 59 } 56 57 blitdone: 58 DIBSECTION_MARK_INVALID(hdcDest); 59 60 60 if(rc == FALSE) { 61 61 dprintf(("!WARNING!: GDI32: StretchBlt returned FALSE; last error %x", rc, GetLastError())); … … 78 78 79 79 #ifdef DEBUG 80 80 POINT point1, point2; 81 81 GetViewportOrgEx(hdcDest, &point1); 82 82 GetViewportOrgEx(hdcSrc, &point2); … … 90 90 if(dsect) 91 91 { 92 return dsect->BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc, nWidth, nHeight, dwRop); 92 rc = dsect->BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc, nWidth, nHeight, dwRop); 93 goto blitdone; 93 94 } 94 95 } … … 98 99 rc = O32_BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); 99 100 100 if(DIBSection::getSection() != NULL) { 101 DIBSection *destdib = DIBSection::findHDC(hdcDest); 102 if(destdib) { 103 destdib->sync(hdcDest, nYDest, nHeight); 104 } 105 } 101 blitdone: 102 DIBSECTION_MARK_INVALID(hdcDest); 106 103 return rc; 107 104 } … … 193 190 } 194 191 if(startscan != 0 || lines != info->bmiHeader.biHeight) { 195 192 dprintf(("WARNING: SetDIBitsToDevice startscan != 0 || lines != info->bmiHeader.biHeight")); 196 193 dprintf(("info bmp (%d,%d)", info->bmiHeader.biWidth, info->bmiHeader.biHeight)); 197 194 } … … 209 206 result = info->bmiHeader.biHeight; 210 207 211 DIBSection *destdib = DIBSection::findHDC(hdc); 212 if(destdib) { 213 if(cx == info->bmiHeader.biWidth && cy == info->bmiHeader.biHeight && 214 destdib->GetBitCount() == info->bmiHeader.biBitCount && 215 destdib->GetBitCount() == 8) 216 { 217 destdib->sync(xDest, yDest, cx, cy, (PVOID)bits); 218 } 219 else destdib->sync(hdc, yDest, cy); 220 } 208 DIBSECTION_MARK_INVALID(hdc); 221 209 } 222 210 dprintf(("GDI32: SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d \nGDI32: bits 0x%X, info 0x%X, coloruse %d returned %d", 223 211 hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse, result)); 224 212 dprintf(("GDI32: SetDIBitsToDevice %d %d %d %d %x %d", info->bmiHeader.biWidth, info->bmiHeader.biHeight, info->bmiHeader.biPlanes, info->bmiHeader.biBitCount, info->bmiHeader.biCompression, info->bmiHeader.biSizeImage)); 225 213 … … 358 346 rc = O32_PatBlt(hdc,nXLeft,nYLeft,nWidth,nHeight,dwRop); 359 347 if(rc) { 360 DIBSection *destdib = DIBSection::findHDC(hdc); 361 if(destdib) { 362 destdib->sync(hdc, nYLeft, nHeight); 363 } 348 DIBSECTION_MARK_INVALID(hdc); 364 349 } 365 350 return(rc); … … 367 352 //****************************************************************************** 368 353 //****************************************************************************** 369 BOOL WIN32API MaskBlt( HDC arg1, int arg2, int arg3, int arg4, int arg5, HDC arg6, int arg7, int arg8, HBITMAP arg9, int arg10, int arg11, DWORD arg12) 370 { 371 return O32_MaskBlt(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); 354 BOOL WIN32API MaskBlt( HDC hdcDest, int arg2, int arg3, int arg4, int arg5, HDC hdcSrc, int arg7, int arg8, HBITMAP arg9, int arg10, int arg11, DWORD arg12) 355 { 356 BOOL ret; 357 358 DIBSECTION_CHECK_IF_DIRTY(hdcSrc); 359 360 ret = O32_MaskBlt(hdcDest, arg2, arg3, arg4, arg5, hdcSrc, arg7, arg8, arg9, arg10, arg11, arg12); 361 if(ret) { 362 DIBSECTION_MARK_INVALID(hdcDest); 363 } 364 return ret; 372 365 } 373 366 //****************************************************************************** … … 426 419 //Open32 always returns height of bitmap (regardless of how many scanlines were copied) 427 420 if(rc != heightSrc && rc != infoLoc->bmiHeader.biHeight) { 428 421 dprintf(("StretchDIBits failed with rc %x", rc)); 429 422 } 430 else { 431 rc = heightSrc; 432 433 DIBSection *destdib = DIBSection::findHDC(hdc); 434 if(destdib) { 435 if(widthDst == widthSrc && heightDst == heightSrc && 436 destdib->GetBitCount() == infoLoc->bmiHeader.biBitCount && 437 destdib->GetBitCount() == 8) 438 { 439 destdib->sync(xDst, yDst, widthDst, heightDst, (PVOID)bits); 440 } 441 else destdib->sync(hdc, yDst, heightDst); 442 } 443 } 423 else { 424 rc = heightSrc; 425 426 DIBSECTION_MARK_INVALID(hdc); 427 } 444 428 445 429 return rc; … … 489 473 490 474 rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, 491 492 475 widthSrc, heightSrc, (void *)bits, 476 (PBITMAPINFO)info, wUsage, dwRop); 493 477 494 478 if(compression == BI_BITFIELDS) { … … 505 489 rc = heightSrc; 506 490 507 DIBSection *destdib = DIBSection::findHDC(hdc); 508 if(destdib) { 509 if(widthDst == widthSrc && heightDst == heightSrc && 510 destdib->GetBitCount() == info->bmiHeader.biBitCount && 511 destdib->GetBitCount() == 8) 512 { 513 destdib->sync(xDst, yDst, widthDst, heightDst, (PVOID)bits); 514 } 515 else destdib->sync(hdc, yDst, heightDst); 516 } 491 DIBSECTION_MARK_INVALID(hdc); 517 492 } 518 493 … … 526 501 const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) 527 502 { 528 529 503 if(info->bmiHeader.biHeight < 0) { 530 504 // upside down … … 563 537 int WIN32API SetStretchBltMode( HDC arg1, int arg2) 564 538 { 539 #ifdef DEBUG 565 540 if(DIBSection::getSection() != NULL) 566 541 { … … 571 546 } 572 547 } 548 #endif 573 549 return O32_SetStretchBltMode(arg1, arg2); 574 550 }
Note:
See TracChangeset
for help on using the changeset viewer.