Changeset 9355 for trunk/src/gdi32/blit.cpp
- Timestamp:
- Oct 28, 2002, 1:21:51 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r8871 r9355 1 /* $Id: blit.cpp,v 1. 39 2002-07-15 10:02:28sandervl Exp $ */1 /* $Id: blit.cpp,v 1.40 2002-10-28 12:21:51 sandervl Exp $ */ 2 2 3 3 /* … … 186 186 RGB555to565MMX(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 187 187 } 188 else RGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 188 else 189 RGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 189 190 bits = newbits; 190 191 } … … 535 536 dprintf(("RGB 555->565 conversion required %x %x %x", bitfields[0], bitfields[1], bitfields[2])); 536 537 537 int imgsize = CalcBitmapSize(info->bmiHeader.biBitCount, 538 info->bmiHeader.biWidth, info->bmiHeader.biHeight); 539 540 newbits = (WORD *)malloc(imgsize); 538 ULONG imgsize = CalcBitmapSize(info->bmiHeader.biBitCount, 539 widthSrc, heightSrc); 540 ULONG offset = CalcBitmapSize(info->bmiHeader.biBitCount, 541 xSrc, ySrc)/sizeof(WORD); 542 newbits = (WORD *) HeapAlloc(GetProcessHeap(), 0, imgsize); 541 543 if(CPUFeatures & CPUID_MMX) { 542 RGB555to565MMX(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 543 } 544 else RGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD)); 544 RGB555to565MMX(newbits, (WORD *)bits+offset, imgsize/sizeof(WORD)); 545 } 546 else 547 RGB555to565(newbits, (WORD *)bits+offset, imgsize/sizeof(WORD)); 545 548 bits = newbits; 546 549 } … … 558 561 ((BITMAPINFO *)info)->bmiHeader.biCompression = BI_BITFIELDS; 559 562 } 560 if(newbits) free(newbits);563 if(newbits) HeapFree(GetProcessHeap(), 0, newbits); 561 564 562 565 //Open32 always returns height of bitmap (regardless of how many scanlines were copied)
Note:
See TracChangeset
for help on using the changeset viewer.