[ros-diffs] [tkreuzer] 47124: [WIN32K] Fix broken parameter passing from EngMaskBitBlt to (Alpha)BltMask. It was passing the wrong surface and the wrong point. Rename some parameters to reflect what their usage is. Add ASSERTs to make sure noone passes useless parameters. Fixes crippled text in startmenu. The whole code is broken by design, anyway it will go away, once the new text rendering code is done. See issue #4379 for more details.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat May 8 17:31:00 CEST 2010


Author: tkreuzer
Date: Sat May  8 17:30:59 2010
New Revision: 47124

URL: http://svn.reactos.org/svn/reactos?rev=47124&view=rev
Log:
[WIN32K]
Fix broken parameter passing from EngMaskBitBlt to (Alpha)BltMask. It was passing the wrong surface and the wrong point. Rename some parameters to reflect what their usage is. Add ASSERTs to make sure noone passes useless parameters. Fixes crippled text in startmenu.
The whole code is broken by design, anyway it will go away, once the new text rendering code is done.
See issue #4379 for more details.

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

Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/bitblt.c?rev=47124&r1=47123&r2=47124&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] Sat May  8 17:30:59 2010
@@ -50,6 +50,9 @@
     PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
     ULONG Pattern = 0;
     HBITMAP hbmPattern;
+
+    ASSERT(psoSource == NULL);
+    ASSERT(pptlSource == NULL);
 
     if (psoMask == NULL)
     {
@@ -662,8 +665,8 @@
 AlphaBltMask(SURFOBJ* psoDest,
              SURFOBJ* psoSource, // unused
              SURFOBJ* psoMask,
-             XLATEOBJ* ColorTranslation,
-             XLATEOBJ* SrcColorTranslation,
+             XLATEOBJ* pxloRGB2Dest,
+             XLATEOBJ* pxloBrush,
              RECTL* prclDest,
              POINTL* pptlSource, // unused
              POINTL* pptlMask,
@@ -675,12 +678,15 @@
     ULONG Background, BrushColor, NewColor;
     BYTE *tMask, *lMask;
 
+    ASSERT(psoSource == NULL);
+    ASSERT(pptlSource == NULL);
+
     dx = prclDest->right  - prclDest->left;
     dy = prclDest->bottom - prclDest->top;
 
     if (psoMask != NULL)
     {
-        BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, pbo ? pbo->iSolidColor : 0);
+        BrushColor = XLATEOBJ_iXlate(pxloBrush, pbo ? pbo->iSolidColor : 0);
         r = (int)GetRValue(BrushColor);
         g = (int)GetGValue(BrushColor);
         b = (int)GetBValue(BrushColor);
@@ -701,14 +707,14 @@
                     else
                     {
                         Background = DIB_GetSource(psoDest, prclDest->left + i, prclDest->top + j,
-                                                   SrcColorTranslation);
+                                                   pxloBrush);
 
                         NewColor =
                             RGB((*lMask * (r - GetRValue(Background)) >> 8) + GetRValue(Background),
                                 (*lMask * (g - GetGValue(Background)) >> 8) + GetGValue(Background),
                                 (*lMask * (b - GetBValue(Background)) >> 8) + GetBValue(Background));
 
-                        Background = XLATEOBJ_iXlate(ColorTranslation, NewColor);
+                        Background = XLATEOBJ_iXlate(pxloRGB2Dest, NewColor);
                         DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel(
                             psoDest, prclDest->left + i, prclDest->top + j, Background);
                     }
@@ -846,10 +852,10 @@
         case DC_TRIVIAL:
             if (psoMask->iBitmapFormat == BMF_8BPP)
                 Ret = AlphaBltMask(psoOutput, NULL , psoInput, DestColorTranslation, SourceColorTranslation,
-                                   &OutputRect, &InputPoint, pptlMask, pbo, &AdjustedBrushOrigin);
+                                   &OutputRect, NULL, &InputPoint, pbo, &AdjustedBrushOrigin);
             else
                 Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation,
-                              &OutputRect, &InputPoint, pptlMask, pbo, &AdjustedBrushOrigin,
+                              &OutputRect, NULL, &InputPoint, pbo, &AdjustedBrushOrigin,
                               R4_MASK);
             break;
         case DC_RECT:
@@ -864,13 +870,13 @@
                 Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
                 if (psoMask->iBitmapFormat == BMF_8BPP)
                 {
-                    Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation,
-                                       &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin);
+                    Ret = AlphaBltMask(psoOutput, NULL, psoInput, DestColorTranslation, SourceColorTranslation,
+                                       &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin);
                 }
                 else
                 {
-                    Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation,
-                                  &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin, R4_MASK);
+                    Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation,
+                                  &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin, R4_MASK);
                 }
             }
             break;
@@ -908,17 +914,17 @@
                         Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
                         if (psoMask->iBitmapFormat == BMF_8BPP)
                         {
-                            Ret = AlphaBltMask(psoOutput, psoInput, psoMask,
+                            Ret = AlphaBltMask(psoOutput, NULL, psoInput,
                                                DestColorTranslation,
                                                SourceColorTranslation,
-                                               &CombinedRect, &Pt, pptlMask, pbo,
+                                               &CombinedRect, NULL, &Pt, pbo,
                                                &AdjustedBrushOrigin) && Ret;
                         }
                         else
                         {
-                            Ret = BltMask(psoOutput, psoInput, psoMask,
-                                          DestColorTranslation, &CombinedRect, &Pt,
-                                          pptlMask, pbo, &AdjustedBrushOrigin,
+                            Ret = BltMask(psoOutput, NULL, psoInput,
+                                          DestColorTranslation, &CombinedRect, NULL,
+                                          &Pt, pbo, &AdjustedBrushOrigin,
                                           R4_MASK) && Ret;
                         }
                     }




More information about the Ros-diffs mailing list