[ros-diffs] [tkreuzer] 33859: IntEngGradientFill: don't assert, if no CLIPOBJ is given, instead handle this case in EngGradientFill, creating a CLIPOBJ from bounds rect.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Thu Jun 5 02:23:28 CEST 2008


Author: tkreuzer
Date: Wed Jun  4 19:23:27 2008
New Revision: 33859

URL: http://svn.reactos.org/svn/reactos?rev=33859&view=rev
Log:
IntEngGradientFill: don't assert, if no CLIPOBJ is given, instead handle this case in EngGradientFill, creating a CLIPOBJ from bounds rect.

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

Modified: trunk/reactos/subsystems/win32/win32k/eng/gradient.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/gradient.c?rev=33859&r1=33858&r2=33859&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/gradient.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/gradient.c [iso-8859-1] Wed Jun  4 19:23:27 2008
@@ -481,6 +481,17 @@
     IN ULONG  ulMode)
 {
   ULONG i;
+  CLIPOBJ *pcoPriv = NULL;
+  BOOL ret = FALSE;
+
+  if (!pco)
+  {
+    pco = pcoPriv = IntEngCreateClipRegion(0, 0, prclExtents);
+    if (!pco)
+    {
+      return FALSE;
+    }
+  }
 
   switch(ulMode)
   {
@@ -493,10 +504,11 @@
         if(!IntEngGradientFillRect(psoDest, pco, pxlo, pVertex, nVertex, gr, prclExtents,
                                    pptlDitherOrg, (ulMode == GRADIENT_FILL_RECT_H)))
         {
-          return FALSE;
+          break;
         }
       }
-      return TRUE;
+      ret = TRUE;
+      break;
     }
     case GRADIENT_FILL_TRIANGLE:
     {
@@ -511,13 +523,20 @@
         if(!IntEngGradientFillTriangle(psoDest, pco, pxlo, pVertex, nVertex, gt, prclExtents,
                                        pptlDitherOrg))
         {
-          return FALSE;
+          break;
         }
       }
-      return TRUE;
+      ret = TRUE;
+      break;
     }
   }
-  return FALSE;
+
+  if (pcoPriv)
+  {
+    IntEngDeleteClipRegion(pcoPriv);
+  }
+
+  return ret;
 }
 
 BOOL STDCALL
@@ -536,7 +555,6 @@
   BOOL Ret;
   BITMAPOBJ *pboDest;
   ASSERT(psoDest);
-  ASSERT(pco);
 
   pboDest = CONTAINING_RECORD(psoDest, BITMAPOBJ, SurfObj);
   ASSERT(pboDest);



More information about the Ros-diffs mailing list