Changeset 2581 for trunk/src


Ignore:
Timestamp:
Jan 31, 2000, 11:30:08 PM (26 years ago)
Author:
sandervl
Message:

init dibsection bmp data to 0 during creation

Location:
trunk/src/gdi32
Files:
3 edited

Legend:

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

    r2267 r2581  
    1 /* $Id: dibsect.cpp,v 1.12 1999-12-30 11:21:29 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.13 2000-01-31 22:30:07 sandervl Exp $ */
    22
    33/*
     
    1919#define  OS2_ONLY
    2020#include "dibsect.h"
     21#include <vmutex.h>
    2122
    2223HWND WIN32API WindowFromDC(HDC hdc);
     
    3637}
    3738
     39static VMutex dibMutex;
    3840
    3941//NOTE:
     
    4850  bmpsize = pbmi->biWidth;
    4951  /* @@@PH 98/06/07 -- high-color bitmaps don't have palette */
    50 
    5152
    5253  this->fFlip = fFlip;
     
    8182
    8283   bmpBits    = (char *)malloc(bmpsize*pbmi->biHeight);
     84   memset(bmpBits, 0, bmpsize*pbmi->biHeight);
    8385
    8486   pOS2bmp    = (BITMAPINFO2 *)malloc(os2bmpsize);
    8587
    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);
    8991
    9092   pOS2bmp->cbFix         = sizeof(BITMAPINFO2) - sizeof(RGB2);
     
    9597   pOS2bmp->ulCompression = pbmi->biCompression;
    9698   pOS2bmp->cbImage       = pbmi->biSizeImage;
     99   dprintf(("handle                 %x", handle));
    97100   dprintf(("pOS2bmp->cx            %d\n", pOS2bmp->cx));
    98101   dprintf(("pOS2bmp->cy            %d\n", pOS2bmp->cy));
     
    105108   this->handle = handle;
    106109
     110   dibMutex.enter();
    107111   if(section == NULL)
    108112   {
     
    124128     dsect->next = this;
    125129   }
    126 
    127    dprintf2(("Class created"));
     130   dibMutex.leave();
    128131}
    129132//******************************************************************************
     
    131134DIBSection::~DIBSection()
    132135{
     136   dprintf(("Delete DIBSection %x", handle));
    133137   if(bmpBits)
    134138        free(bmpBits);
     
    136140        free(pOS2bmp);
    137141
     142   dibMutex.enter();
    138143   if(section == this)
    139144   {
     
    150155     dsect->next = this->next;
    151156   }
     157   dibMutex.leave();
    152158}
    153159//******************************************************************************
     
    253259  if(hwndDest != 0)
    254260  {
    255     hps = WinGetPS(hwndDest);
     261        hps = WinGetPS(hwndDest);
    256262  }
    257263  if(hps == 0)
    258264  {
    259     eprintf(("DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest));
     265    dprintf(("ERROR: DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest));
    260266    return(FALSE);
    261267  }
    262268
    263   dprintf(("DIBSection::BitBlt %X %x to(%d,%d)(%d,%d) from (%d,%d)(%d,%d) rop %x\n",
    264           hdcDest, 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));
    266272
    267273  point[0].x = nXdest;
     
    327333 DIBSection *dsect = section;
    328334
     335  dibMutex.enter();
    329336  while(dsect)
    330337  {
    331338    if(dsect->handle == handle)
    332339    {
    333       return(dsect);
     340        dibMutex.leave();
     341        return(dsect);
    334342    }
    335343    dsect = dsect->next;
    336344  }
     345  dibMutex.leave();
    337346  return(NULL);
    338347}
     
    423432char  DIBSection::GetBitCount()
    424433{
    425    if(NULL==pOS2bmp)
     434   if(pOS2bmp == NULL)
    426435     return 0;
    427436   else
  • trunk/src/gdi32/gdi32.cpp

    r2573 r2581  
    1 /* $Id: gdi32.cpp,v 1.35 2000-01-30 15:04:40 sandervl Exp $ */
     1/* $Id: gdi32.cpp,v 1.36 2000-01-31 22:30:08 sandervl Exp $ */
    22
    33/*
     
    319319
    320320    OSLibGpiSetCp(newHdc, oldcp);
     321    dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc));
    321322    return newHdc;
    322323}
     
    329330{
    330331#if 1
    331     dprintf(("GDI32: StretchDIBits"));
     332    dprintf(("GDI32: StretchDIBits %x to (%d,%d) (%d,%d) from (%d,%d) (%d,%d), %x %x %x %x", hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop));
    332333
    333334    if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
     
    12461247//******************************************************************************
    12471248//******************************************************************************
    1248 HANDLE WIN32API GetCurrentObject( HDC arg1, UINT arg2)
    1249 {
    1250     dprintf(("GDI32: GetCurrentObject"));
    1251     return (HANDLE)O32_GetCurrentObject(arg1, arg2);
     1249HANDLE WIN32API GetCurrentObject( HDC hdc, UINT arg2)
     1250{
     1251    dprintf(("GDI32: GetCurrentObject %x %x", hdc, arg2));
     1252    return (HANDLE)O32_GetCurrentObject(hdc, arg2);
    12521253}
    12531254//******************************************************************************
     
    15151516//******************************************************************************
    15161517//******************************************************************************
    1517 BOOL WIN32API GetTextExtentPoint32A( HDC arg1, LPCSTR arg2, int arg3, PSIZE  lpSize)
    1518 {
    1519     dprintf(("GDI32: GetTextExtentPoint32A"));
     1518BOOL WIN32API GetTextExtentPoint32A( HDC hdc, LPCSTR lpsz, int cbString, PSIZE  lpSize)
     1519{
     1520 BOOL rc;
     1521
    15201522    lpSize->cx = lpSize->cy = 0;
    1521     return O32_GetTextExtentPoint32(arg1, arg2, arg3, lpSize);
     1523    rc = O32_GetTextExtentPoint32(hdc, lpsz, cbString, lpSize);
     1524    dprintf(("GDI32: GetTextExtentPoint32A %x %s %d returned %d (%d,%d)", hdc, lpsz, cbString, rc, lpSize->cx, lpSize->cy));
     1525    return rc;
    15221526}
    15231527//******************************************************************************
     
    18961900//******************************************************************************
    18971901//******************************************************************************
    1898 int WIN32API SelectClipRgn( HDC arg1, HRGN  arg2)
    1899 {
    1900     dprintf(("GDI32: SelectClipRgn"));
    1901     return O32_SelectClipRgn(arg1, arg2);
     1902int WIN32API SelectClipRgn( HDC hdc, HRGN hRgn)
     1903{
     1904    dprintf(("GDI32: SelectClipRgn %x %x", hdc, hRgn));
     1905    return O32_SelectClipRgn(hdc, hRgn);
    19021906}
    19031907//******************************************************************************
     
    20062010//    if(xDest == 0 && yDest == 0 && xSrc == 0 && ySrc == 0 && cx == width && cy == height) {
    20072011//      result = OSLibSetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (WINBITMAPINFOHEADER*)info, coloruse);
     2012//      result = lines;
    20082013//    }
    20092014//    else {
     
    22412246  if(pbmi->bmiHeader.biWidth < 0)
    22422247  {
    2243     pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth;
    2244     fFlip = FLIP_HOR;
     2248        dprintf(("CreateDIBSection: width %d", pbmi->bmiHeader.biWidth));
     2249        pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth;
     2250        fFlip = FLIP_HOR;
    22452251  }
    22462252  iHeight = pbmi->bmiHeader.biHeight;
    22472253  if(pbmi->bmiHeader.biHeight < 0)
    22482254  {
    2249     pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight;
    2250     fFlip |= FLIP_VERT;
     2255        dprintf(("CreateDIBSection: height %d", pbmi->bmiHeader.biHeight));
     2256        pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight;
     2257        fFlip |= FLIP_VERT;
    22512258  }
    22522259
     
    22882295      pbmi->bmiHeader.biHeight = iHeight;
    22892296
    2290       dprintf(("GDI32: return %08X\n",res));
    22912297      return(res);
    22922298    }
  • trunk/src/gdi32/line.cpp

    r2221 r2581  
    1 /* $Id: line.cpp,v 1.3 1999-12-27 22:52:39 cbratschi Exp $ */
     1/* $Id: line.cpp,v 1.4 2000-01-31 22:30:08 sandervl Exp $ */
    22/*
    33 * Line API's
     
    7171  PVOID pHps = OSLibGpiQueryDCData(hdc);
    7272
    73   dprintf(("GDI32: MoveToEx\n"));
     73  dprintf(("GDI32: MoveToEx %x (%d,%d)", hdc, X, Y));
    7474
    7575  if (pHps)
     
    105105  BOOL rc = TRUE;
    106106
    107   dprintf(("GDI32: LineTo"));
     107  dprintf(("GDI32: LineTo %x (%d,%d)", hdc, nXEnd, nYEnd));
    108108
    109109  if (pHps)
Note: See TracChangeset for help on using the changeset viewer.