Changeset 2581 for trunk/src/gdi32/dibsect.cpp
- Timestamp:
- Jan 31, 2000, 11:30:08 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibsect.cpp
r2267 r2581 1 /* $Id: dibsect.cpp,v 1.1 2 1999-12-30 11:21:29sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.13 2000-01-31 22:30:07 sandervl Exp $ */ 2 2 3 3 /* … … 19 19 #define OS2_ONLY 20 20 #include "dibsect.h" 21 #include <vmutex.h> 21 22 22 23 HWND WIN32API WindowFromDC(HDC hdc); … … 36 37 } 37 38 39 static VMutex dibMutex; 38 40 39 41 //NOTE: … … 48 50 bmpsize = pbmi->biWidth; 49 51 /* @@@PH 98/06/07 -- high-color bitmaps don't have palette */ 50 51 52 52 53 this->fFlip = fFlip; … … 81 82 82 83 bmpBits = (char *)malloc(bmpsize*pbmi->biHeight); 84 memset(bmpBits, 0, bmpsize*pbmi->biHeight); 83 85 84 86 pOS2bmp = (BITMAPINFO2 *)malloc(os2bmpsize); 85 87 86 memset(pOS2bmp, /* set header + palette entries to zero */87 0,88 os2bmpsize);88 memset(pOS2bmp, /* set header + palette entries to zero */ 89 0, 90 os2bmpsize); 89 91 90 92 pOS2bmp->cbFix = sizeof(BITMAPINFO2) - sizeof(RGB2); … … 95 97 pOS2bmp->ulCompression = pbmi->biCompression; 96 98 pOS2bmp->cbImage = pbmi->biSizeImage; 99 dprintf(("handle %x", handle)); 97 100 dprintf(("pOS2bmp->cx %d\n", pOS2bmp->cx)); 98 101 dprintf(("pOS2bmp->cy %d\n", pOS2bmp->cy)); … … 105 108 this->handle = handle; 106 109 110 dibMutex.enter(); 107 111 if(section == NULL) 108 112 { … … 124 128 dsect->next = this; 125 129 } 126 127 dprintf2(("Class created")); 130 dibMutex.leave(); 128 131 } 129 132 //****************************************************************************** … … 131 134 DIBSection::~DIBSection() 132 135 { 136 dprintf(("Delete DIBSection %x", handle)); 133 137 if(bmpBits) 134 138 free(bmpBits); … … 136 140 free(pOS2bmp); 137 141 142 dibMutex.enter(); 138 143 if(section == this) 139 144 { … … 150 155 dsect->next = this->next; 151 156 } 157 dibMutex.leave(); 152 158 } 153 159 //****************************************************************************** … … 253 259 if(hwndDest != 0) 254 260 { 255 hps = WinGetPS(hwndDest);261 hps = WinGetPS(hwndDest); 256 262 } 257 263 if(hps == 0) 258 264 { 259 eprintf(("DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest));265 dprintf(("ERROR: DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest)); 260 266 return(FALSE); 261 267 } 262 268 263 dprintf(("DIBSection::BitBlt % X %x to(%d,%d)(%d,%d) from (%d,%d)(%d,%d) rop %x\n",264 h dcDest, hwndDest, nXdest, nYdest, nDestWidth, nDestHeight,265 nXsrc, nYsrc, nSrcWidth, nSrcHeight, Rop ));269 dprintf(("DIBSection::BitBlt %x %X (hps %x) %x to(%d,%d)(%d,%d) from (%d,%d)(%d,%d) rop %x flip %x", 270 handle, hdcDest, hps, hwndDest, nXdest, nYdest, nDestWidth, nDestHeight, 271 nXsrc, nYsrc, nSrcWidth, nSrcHeight, Rop, fFlip)); 266 272 267 273 point[0].x = nXdest; … … 327 333 DIBSection *dsect = section; 328 334 335 dibMutex.enter(); 329 336 while(dsect) 330 337 { 331 338 if(dsect->handle == handle) 332 339 { 333 return(dsect); 340 dibMutex.leave(); 341 return(dsect); 334 342 } 335 343 dsect = dsect->next; 336 344 } 345 dibMutex.leave(); 337 346 return(NULL); 338 347 } … … 423 432 char DIBSection::GetBitCount() 424 433 { 425 if( NULL==pOS2bmp)434 if(pOS2bmp == NULL) 426 435 return 0; 427 436 else
Note:
See TracChangeset
for help on using the changeset viewer.