[WIN32K]
authorKamil Hornicek <kamil.hornicek@reactos.org>
Thu, 22 May 2014 09:33:29 +0000 (09:33 +0000)
committerKamil Hornicek <kamil.hornicek@reactos.org>
Thu, 22 May 2014 09:33:29 +0000 (09:33 +0000)
- make DIB_XXBPP_StretchBlt work with top down bitmaps
- fixes missing icons in the taskbar in explorer new (32bpp)

svn path=/trunk/; revision=63404

reactos/win32ss/gdi/dib/stretchblt.c

index f8272aa..55f8057 100644 (file)
@@ -29,6 +29,8 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma
   LONG DstWidth;
   LONG SrcHeight;
   LONG SrcWidth;
   LONG DstWidth;
   LONG SrcHeight;
   LONG SrcWidth;
+  LONG MaskCy;
+  LONG SourceCy;
 
   ULONG Color;
   ULONG Dest, Source = 0, Pattern = 0;
 
   ULONG Color;
   ULONG Dest, Source = 0, Pattern = 0;
@@ -56,6 +58,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma
 
   if (UsesSource)
   {
 
   if (UsesSource)
   {
+    SourceCy = abs(SourceSurf->sizlBitmap.cy);
     fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel;
     DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n",
       BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom);
     fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel;
     DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n",
       BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom);
@@ -64,6 +67,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma
   if (MaskSurf)
   {
     fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel;
   if (MaskSurf)
   {
     fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel;
+    MaskCy = abs(MaskSurf->sizlBitmap.cy);
   }
 
   DstHeight = DestRect->bottom - DestRect->top;
   }
 
   DstHeight = DestRect->bottom - DestRect->top;
@@ -124,7 +128,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma
       {
         sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
         if (sx < 0 || sy < 0 ||
       {
         sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
         if (sx < 0 || sy < 0 ||
-          MaskSurf->sizlBitmap.cx < sx || MaskSurf->sizlBitmap.cy < sy ||
+          MaskSurf->sizlBitmap.cx < sx || MaskCy < sy ||
           fnMask_GetPixel(MaskSurf, sx, sy) != 0)
         {
           CanDraw = FALSE;
           fnMask_GetPixel(MaskSurf, sx, sy) != 0)
         {
           CanDraw = FALSE;
@@ -135,7 +139,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma
       {
         sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
         if (sx >= 0 && sy >= 0 &&
       {
         sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth;
         if (sx >= 0 && sy >= 0 &&
-          SourceSurf->sizlBitmap.cx > sx && SourceSurf->sizlBitmap.cy > sy)
+          SourceSurf->sizlBitmap.cx > sx && SourceCy > sy)
         {
           Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy));
         }
         {
           Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy));
         }