Ignore:
Timestamp:
Nov 26, 2002, 11:53:12 AM (23 years ago)
Author:
sandervl
Message:

Added debug wrappers for all exports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/blit.cpp

    r9355 r9429  
    1 /* $Id: blit.cpp,v 1.40 2002-10-28 12:21:51 sandervl Exp $ */
     1/* $Id: blit.cpp,v 1.41 2002-11-26 10:53:06 sandervl Exp $ */
    22
    33/*
     
    4747            rc  = dsect->BitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
    4848                                nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);
    49             dprintf(("GDI32: StretchBlt returned %d", rc));
    5049            return rc;
    5150        }
     
    330329    }
    331330    return rc;
    332 
    333 //SvL: Breaks startup bitmap of Acrobat Reader 4.05
    334 #if 0
    335     else
    336     if(info->bmiHeader.biBitCount == 8 && info->bmiHeader.biCompression == 0 && !(GetDeviceCaps( hdc, RASTERCAPS ) & RC_PALETTE)) {
    337         INT rc = 0;
    338         // convert 8bit to 24bit
    339 
    340         BITMAPINFO newInfo;
    341         newInfo.bmiHeader = info->bmiHeader;
    342         newInfo.bmiHeader.biBitCount = 24;
    343         long lLineByte24 = ((newInfo.bmiHeader.biWidth * 24 + 31) / 32) * 4;
    344         long lLineByte8  = ((newInfo.bmiHeader.biWidth *  8 + 31) / 32) * 4;
    345         long lHeight   = newInfo.bmiHeader.biHeight;
    346         if(lHeight < 0) lHeight = -lHeight;
    347 
    348         char *newBits = (char *)malloc( lLineByte24 * lHeight );
    349         if(newBits) {
    350             //
    351             // Get Palette Entries
    352             //
    353             PALETTEENTRY aEntries[256];
    354             LOGPALETTE *pLog = (LOGPALETTE *)malloc( sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * 256 );
    355             pLog->palVersion = 0x300;
    356             pLog->palNumEntries = 256;
    357 
    358             HPALETTE hPaletteDummy = CreatePalette( pLog );
    359             free( pLog );
    360             HPALETTE hPalette = SelectPalette( hdc, hPaletteDummy, FALSE );
    361             GetPaletteEntries( hPalette, 0, 255, aEntries  );
    362             SelectPalette( hdc, hPalette, FALSE );
    363             DeleteObject( hPaletteDummy );
    364 
    365             //
    366             // convert 8bit to 24bit
    367             //
    368             if(newInfo.bmiHeader.biHeight > 0) {
    369                 unsigned char *pbSrc = (unsigned char *)bits;
    370                 unsigned char *pbDst = (unsigned char *)newBits;
    371                 for(int y = 0; y < lHeight; y++) {
    372                     for(int x = 0; x < newInfo.bmiHeader.biWidth; x++) {
    373                         PALETTEENTRY src = aEntries[pbSrc[x]];
    374                         pbDst[x * 3 + 0] = src.peBlue;
    375                         pbDst[x * 3 + 1] = src.peGreen;
    376                         pbDst[x * 3 + 2] = src.peRed;
    377                     }
    378                     pbDst += lLineByte24;
    379                     pbSrc += lLineByte8;
    380                 }
    381             } else {
    382                 // upside down
    383                 newInfo.bmiHeader.biHeight = -info->bmiHeader.biHeight;
    384                 unsigned char *pbSrc = (unsigned char *)bits + lLineByte8 * (lHeight - 1);
    385                 unsigned char *pbDst = (unsigned char *)newBits;
    386                 for(int y = 0; y < lHeight; y++) {
    387                     for(int x = 0; x < newInfo.bmiHeader.biWidth; x++) {
    388                         PALETTEENTRY src = aEntries[pbSrc[x]];
    389                         pbDst[x * 3 + 0] = src.peBlue;
    390                         pbDst[x * 3 + 1] = src.peGreen;
    391                         pbDst[x * 3 + 2] = src.peRed;
    392                     }
    393                     pbDst += lLineByte24;
    394                     pbSrc -= lLineByte8;
    395                 }
    396             }
    397             rc = SetDIBitsToDevice_( hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (void *)newBits, &newInfo, DIB_RGB_COLORS );
    398             free( newBits );
    399         }
    400         return rc;
    401     }
    402 #endif
    403331}
    404332//******************************************************************************
     
    427355            }
    428356    }
    429 
    430     dprintf(("GDI32: PatBlt hdc %x (%d,%d) (%d,%d) returned %d\n",hdc, nXLeft,nYLeft,nWidth,nHeight,rc));
    431357    return(rc);
    432358}
     
    435361BOOL 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)
    436362{
    437     dprintf(("GDI32: MaskBlt"));
    438363    return O32_MaskBlt(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
    439364}
     
    541466                                     xSrc, ySrc)/sizeof(WORD);
    542467        newbits = (WORD *) HeapAlloc(GetProcessHeap(), 0, imgsize);
     468//bugbug (too much)
     469//bugbug
    543470        if(CPUFeatures & CPUID_MMX) {
    544471             RGB555to565MMX(newbits, (WORD *)bits+offset, imgsize/sizeof(WORD));
     
    548475        bits = newbits;
    549476    }
    550     //SvL: Ignore BI_BITFIELDS type (SetDIBitsToDevice fails otherwise)
     477    //SvL: Ignore BI_BITFIELDS type (StretchDIBits fails otherwise)
    551478    if(info->bmiHeader.biCompression == BI_BITFIELDS) {
    552479        ((BITMAPINFO *)info)->bmiHeader.biCompression = 0;
     
    629556int WIN32API SetStretchBltMode( HDC arg1, int  arg2)
    630557{
    631   dprintf(("GDI32: SetStretchBltMode 0x%08X, 0x%08X\n",arg1, arg2));
    632 
    633558    if(DIBSection::getSection() != NULL)
    634559    {
     
    645570int WIN32API GetStretchBltMode( HDC arg1)
    646571{
    647     dprintf(("GDI32: GetStretchBltMode"));
    648572    return O32_GetStretchBltMode(arg1);
    649573}
Note: See TracChangeset for help on using the changeset viewer.