Changeset 5799 for trunk/src


Ignore:
Timestamp:
May 25, 2001, 12:05:29 PM (24 years ago)
Author:
sandervl
Message:

dib section sync, setdibits & setpalette bugfixes

Location:
trunk/src/gdi32
Files:
4 edited

Legend:

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

    r5390 r5799  
    1 /* $Id: dibitmap.cpp,v 1.15 2001-03-27 20:47:52 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.16 2001-05-25 10:05:28 sandervl Exp $ */
    22
    33/*
     
    301301                       const BITMAPINFO *pBitmapInfo, UINT usage)
    302302{
     303    int ret;
     304
    303305    dprintf(("GDI32: SetDIBits %x %x %x %x %x %x %x", hdc, hBitmap, startscan, numlines, pBits, pBitmapInfo, usage));
    304306
    305     if(DIBSection::getSection() != NULL)
    306     {
    307         DIBSection *dsect;
    308 
    309         dsect = DIBSection::findObj(hBitmap);
    310         if(dsect) {
    311            return dsect->SetDIBits(hdc, hBitmap, startscan, numlines, pBits, (BITMAPINFOHEADER_W *)&pBitmapInfo->bmiHeader, usage);
    312         }
    313     }
    314307    //SvL: Open32's SetDIBits really messes things up for 1 bpp bitmaps, must use SetBitmapBits
    315308    if(pBitmapInfo->bmiHeader.biBitCount == 1 && startscan == 0 && numlines == pBitmapInfo->bmiHeader.biHeight)
     
    344337    }
    345338#endif
    346     return O32_SetDIBits(hdc, hBitmap, startscan, numlines, pBits, pBitmapInfo, usage);
    347 }
    348 //******************************************************************************
    349 //******************************************************************************
     339    ret = O32_SetDIBits(hdc, hBitmap, startscan, numlines, pBits, pBitmapInfo, usage);
     340    if(DIBSection::getSection() != NULL)
     341    {
     342        DIBSection *dsect;
     343
     344        dsect = DIBSection::findObj(hBitmap);
     345        if(dsect) {
     346             HBITMAP hBmpOld = SelectObject(hdc, hBitmap);
     347             dsect->sync(hdc, 0, dsect->GetHeight());
     348             SelectObject(hdc, hBmpOld);
     349        }
     350    }
     351
     352    return ret;
     353}
     354//******************************************************************************
     355//******************************************************************************
  • trunk/src/gdi32/dibsect.cpp

    r5677 r5799  
    1 /* $Id: dibsect.cpp,v 1.50 2001-05-10 17:03:18 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.51 2001-05-25 10:05:29 sandervl Exp $ */
    22
    33/*
     
    389389 int i;
    390390
     391  dprintf(("SetDIBColorTable %d %d %x", startIdx, cEntries, rgb));
    391392  if(startIdx + cEntries > (1 << pOS2bmp->cBitCount))
    392393  {
     
    713714#endif
    714715  }
     716  memcpy(pOS2bmp, tmphdr, os2bmphdrsize);
    715717
    716718#if 0
  • trunk/src/gdi32/palette.cpp

    r4127 r5799  
    1 /* $Id: palette.cpp,v 1.7 2000-08-30 18:05:25 sandervl Exp $ */
     1/* $Id: palette.cpp,v 1.8 2001-05-25 10:05:29 sandervl Exp $ */
    22
    33/*
     
    8181HPALETTE WIN32API SelectPalette(HDC hdc, HPALETTE hPalette, BOOL bForceBackground)
    8282{
     83  HPALETTE hPal;
     84
    8385  dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)", hdc, hPalette, bForceBackground));
     86  hPal = O32_SelectPalette(hdc, hPalette, bForceBackground);
    8487  if(DIBSection::getSection() != NULL)
    8588  {
     
    8790    if(dsect)
    8891    {
    89       int nrcolors;
    90       PALETTEENTRY Pal[256];
    91       char PalSize = dsect->GetBitCount();
    92       dprintf(("       - Set Palette Values in DIBSection\n"));
    93       if(PalSize<=8)
    94       {
    95         nrcolors = GetPaletteEntries( hPalette, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);
    96         dsect->SetDIBColorTable(0, nrcolors, (RGBQUAD*)&Pal);
    97       }
    98 
     92        dsect->sync(hdc, 0, dsect->GetHeight());
    9993    }
    10094  }
    101   return O32_SelectPalette(hdc, hPalette, bForceBackground);
     95  return hPal;
    10296}
    10397//******************************************************************************
  • trunk/src/gdi32/text.cpp

    r5795 r5799  
    1 /* $Id: text.cpp,v 1.21 2001-05-24 19:26:31 sandervl Exp $ */
     1/* $Id: text.cpp,v 1.22 2001-05-25 10:05:29 sandervl Exp $ */
    22
    33/*
     
    874874   //     in the Settings dialog box of VirtualPC. Strings are clipped.
    875875   //     (e.g.: Hard Disk 1 -> Hard Disk)
    876    return O32_GetTextExtentPoint(hdc, lpsz, cbString, lpsSize);
     876   dprintf(("GDI32: GetTextExtentPointA %s\n", lpsz));
     877   BOOL rc = O32_GetTextExtentPoint(hdc, lpsz, cbString, lpsSize);
     878   if(rc) {
     879      dprintf(("GDI32: GetTextExtentPointA %x %s %d returned %d (%d,%d)", hdc, lpsz, cbString, rc, lpsSize->cx, lpsSize->cy));
     880      SetLastError(ERROR_SUCCESS);
     881      return TRUE;
     882   }
     883   return FALSE;
    877884#else
    878885   BOOL       rc;
Note: See TracChangeset for help on using the changeset viewer.