[ros-diffs] [tkreuzer] 56565: [WIN32K] - Fix RGB vs BGR mistake in SURFACE_iCompression - Return the number of copied scanlines in GreGetDIBits - Fix calculation of destination address in GreGetDIBits

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat May 12 17:40:59 UTC 2012


Author: tkreuzer
Date: Sat May 12 17:40:58 2012
New Revision: 56565

URL: http://svn.reactos.org/svn/reactos?rev=56565&view=rev
Log:
[WIN32K]
- Fix RGB vs BGR mistake in SURFACE_iCompression
- Return the number of copied scanlines in GreGetDIBits
- Fix calculation of destination address in GreGetDIBits

Modified:
    branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c

Modified: branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c
URL: http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c?rev=56565&r1=56564&r2=56565&view=diff
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c [iso-8859-1] Sat May 12 17:40:58 2012
@@ -676,11 +676,10 @@
     if (psurf->SurfObj.iBitmapFormat == BMF_PNG) return BI_PNG;
 
     /* Check the type of the palette */
-    if (psurf->ppal->flFlags & (PAL_INDEXED|PAL_RGB|PAL_RGB16_555))
-        return PAL_RGB;
+    if (psurf->ppal->flFlags & (PAL_INDEXED|PAL_BGR|PAL_RGB16_555))
+        return BI_RGB;
 
     /* Everything else must be bitfields */
-    ASSERT(psurf->ppal->flFlags & PAL_BITFIELDS);
     return BI_BITFIELDS;
 }
 
@@ -770,6 +769,7 @@
     ULONG iCompression, cBitsPixel, cjLine;
     LONG lDeltaDst;
     PBYTE pjSrc;
+    INT iResult = 0;
 
     /* Lock the DC */
     pdc = DC_LockDc(hdc);
@@ -812,14 +812,17 @@
             /* Check for top-down bitmaps */
             if (pbmi->bmiHeader.biHeight > 0)
             {
-                /* Adjust lDelta and start position */
+                /* Adjust start position and lDelta */
+                pjBits += (cScans - 1) * lDeltaDst;
                 lDeltaDst = -lDeltaDst;
-                pjBits += (cScans - 1) * lDeltaDst;
             }
 
             /* Calculate the start address from where to copy */
             pjSrc = psurf->SurfObj.pvScan0;
             pjSrc += iStartScan * psurf->SurfObj.lDelta;
+
+            /* Save number of scan lines being copied */
+            iResult = cScans;
 
             /* Loop all scan lines */
             while (cScans--)
@@ -844,7 +847,7 @@
     else
     {
         /* There is nothing to copy */
-        cScans = 0;
+        iResult = 0;
     }
 
     /* Unlock the bitmap surface */
@@ -852,7 +855,7 @@
 
     DC_UnlockDc(pdc);
 
-    return cScans;
+    return iResult;
 }
 
 INT
@@ -871,9 +874,6 @@
     PBITMAPINFO pbmi;
     HANDLE hSecure;
     INT iResult;
-    //ULONG cjHeader;
-
-    __debugbreak();
 
     /* Check if the size of the bitmap info is large enough */
     if (cjMaxInfo < sizeof(BITMAPINFOHEADER))




More information about the Ros-diffs mailing list