Author: tkreuzer
Date: Mon Feb 14 16:04:01 2011
New Revision: 50694

URL: http://svn.reactos.org/svn/reactos?rev=50694&view=rev
Log:
[WIN32K]
Fix initialization of XLATEOBJ, when source and dest format are equal. Patch by 
Thomas Faber (thfabba at gmx de)

See issue #5828 for more details.

Modified:
    trunk/reactos/subsystems/win32/win32k/eng/xlate.c

Modified: trunk/reactos/subsystems/win32/win32k/eng/xlate.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/xlate.c?rev=50694&r1=50693&r2=50694&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/xlate.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/xlate.c [iso-8859-1] Mon Feb 14 
16:04:01 2011
@@ -361,9 +361,7 @@
 
     EXLATEOBJ_vInitTrivial(pexlo);
 
-    if (ppalDst == ppalSrc || !ppalSrc || !ppalDst ||
-        ((ppalDst->flFlags == PAL_RGB || ppalDst->flFlags == PAL_BGR) &&
-         ppalDst->flFlags == ppalSrc->flFlags))
+    if (!ppalSrc || !ppalDst)
     {
         return;
     }
@@ -372,6 +370,13 @@
     pexlo->ppalDst = ppalDst;
     pexlo->xlo.iSrcType = ppalSrc->flFlags;
     pexlo->xlo.iDstType = ppalDst->flFlags;
+    
+    if (ppalDst == ppalSrc ||
+        ((ppalDst->flFlags == PAL_RGB || ppalDst->flFlags == PAL_BGR) &&
+         ppalDst->flFlags == ppalSrc->flFlags))
+    {
+        return;
+    }
 
     /* Chack if both of the pallettes are indexed */
     if (!(ppalSrc->flFlags & PAL_INDEXED) || !(ppalDst->flFlags & PAL_INDEXED))
@@ -607,13 +612,6 @@
     psurfDst = pdcDst->dclevel.pSurface;
     psurfSrc = pdcSrc->dclevel.pSurface;
 
-    /* Check for trivial color translation */
-    if (psurfDst == psurfSrc)
-    {
-        EXLATEOBJ_vInitTrivial(pexlo);
-        return;
-    }
-
     /* Normal initialisation. No surface means DEFAULT_BITMAP */
     EXLATEOBJ_vInitialize(pexlo,
                           psurfSrc ? psurfSrc->ppal : &gpalMono,


Reply via email to