Changeset 3371 for trunk/src


Ignore:
Timestamp:
Apr 13, 2000, 8:47:16 PM (25 years ago)
Author:
sandervl
Message:

dibsection change

File:
1 edited

Legend:

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

    r3356 r3371  
    1 /* $Id: dibsect.cpp,v 1.26 2000-04-09 11:10:34 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.27 2000-04-13 18:47:16 sandervl Exp $ */
    22
    33/*
     
    384384 PVOID  bitmapBits = NULL;
    385385 int    oldyinversion = 0;
    386 
    387 #if 0
     386 BOOL   fRestoryYInversion = FALSE;
     387
     388#if 1
    388389  HWND hwndDest = WindowFromDC(hdcDest);
    389390  hwndDest = Win32ToOS2Handle(hwndDest);
     
    399400#endif
    400401
     402  if(nDestWidth == 160 && nDestHeight == 120) {
     403        nSrcWidth = 160;
     404  }
     405
    401406  dprintf(("DIBSection::BitBlt %x %X (hps %x) %x to(%d,%d)(%d,%d) from (%d,%d)(%d,%d) rop %x flip %x",
    402 //          handle, hdcDest, hps, hwndDest, nXdest, nYdest, nDestWidth, nDestHeight,
    403           handle, hdcDest, hps, 0, nXdest, nYdest, nDestWidth, nDestHeight,
     407          handle, hdcDest, hps, hwndDest, nXdest, nYdest, nDestWidth, nDestHeight,
     408//          handle, hdcDest, hps, 0, nXdest, nYdest, nDestWidth, nDestHeight,
    404409          nXsrc, nYsrc, nSrcWidth, nSrcHeight, Rop, fFlip));
    405410
     
    428433  if(fFlip & FLIP_VERT)
    429434  {
    430         GpiEnableYInversion(hps, pOS2bmp->cy-1);
    431   }
    432   else  GpiEnableYInversion(hps, 0);
     435        if(oldyinversion != pOS2bmp->cy-1) {
     436                GpiEnableYInversion(hps, pOS2bmp->cy-1);
     437                fRestoryYInversion = TRUE;
     438        }
     439  }
     440  else 
     441  if(oldyinversion != 0) {
     442        GpiEnableYInversion(hps, 0);
     443        fRestoryYInversion = TRUE;
     444  }
    433445
    434446  if(fFlip & FLIP_HOR)
     
    442454  //SvL: Optimize this.. (don't convert entire bitmap if only a part will be blitted to the dc)
    443455  if(dibinfo.dsBitfields[1] == 0x3E0) {//RGB 555?
    444         dprintf(("DIBSection::BitBlt; convert rgb 555 to 565"));
     456        dprintf(("DIBSection::BitBlt; convert rgb 555 to 565 (old y inv. = %d", oldyinversion));
    445457
    446458        if(bmpBitsRGB565 == NULL)
     
    471483        }
    472484        //restore old y inversion height
    473         GpiEnableYInversion(hps, oldyinversion);
    474 //      if(hwndDest != 0)
    475 //      {
    476 //              WinReleasePS(hps);
    477 //      }
     485        if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
     486#if 1
     487        if(hwndDest != 0)
     488        {
     489                WinReleasePS(hps);
     490        }
     491#endif
    478492        return(TRUE);
    479493  }
    480   GpiEnableYInversion(hps, oldyinversion);
    481 //  if(hwndDest != 0)
    482 //  {
    483 //      WinReleasePS(hps);
    484 //  }
     494  if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
     495#if 1
     496  if(hwndDest != 0)
     497  {
     498        WinReleasePS(hps);
     499  }
     500#endif
    485501  dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc));
    486 //  dprintf(("WinGetLastError returned %X\n", WinGetLastError(WinQueryAnchorBlock(hwndDest)) & 0xFFFF));
     502#if 1
     503  dprintf(("WinGetLastError returned %X\n", WinGetLastError(WinQueryAnchorBlock(hwndDest)) & 0xFFFF));
     504#endif
    487505  return(FALSE);
    488506}
Note: See TracChangeset for help on using the changeset viewer.