Minor fixes
authorJason Filby <jason.filby@gmail.com>
Sat, 21 Sep 2002 10:39:54 +0000 (10:39 +0000)
committerJason Filby <jason.filby@gmail.com>
Sat, 21 Sep 2002 10:39:54 +0000 (10:39 +0000)
svn path=/trunk/; revision=3527

reactos/subsys/win32k/eng/bitblt.c
reactos/subsys/win32k/objects/fillshap.c

index 91ba883..c582ebf 100644 (file)
@@ -128,6 +128,14 @@ EngBitBlt(SURFOBJ *Dest,
     }
   }
 
+  /* The code currently assumes there will be a source bitmap. This is not true when, for example, using this function to
+   * paint a brush pattern on the destination. */
+  if(!Source)
+  {
+    DbgPrint("EngBitBlt: A source is currently required, even though not all operations require one (FIXME)\n");
+    return FALSE;
+  }
+
   // * The source bitmap is not managed by the GDI and we didn't already obtain it using EngCopyBits from the device
   if(Source->iType != STYPE_BITMAP && SourceGDI->CopyBits == NULL)
   {
index a7f1051..0e06ee2 100644 (file)
@@ -134,26 +134,30 @@ W32kRectangle(HDC  hDC,
                     RectBounds, // Bounding rectangle
                     dc->w.ROPmode); // MIX */
 
+    // FIXME: BrushObj is obtained above; decide which one is correct
     BrushObj = (BRUSHOBJ*) GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
-    assert(BrushObj);
-    if (BrushObj->logbrush.lbStyle != BS_NULL)
-      {        
-       DestRect.left = LeftRect + 1;
-       DestRect.right = RightRect - 1;
-       DestRect.top = TopRect + 1;
-       DestRect.bottom = BottomRect - 1;
-       ret = EngBitBlt(SurfObj, 
-                       NULL,
-                       NULL,
-                       NULL,
-                       NULL,
-                       &DestRect,
-                       NULL,
-                       NULL,
-                       BrushObj,
-                       NULL,
-                       PATCOPY);
-      }
+
+    if (BrushObj)
+    {
+      if (BrushObj->logbrush.lbStyle != BS_NULL)
+        {      
+          DestRect.left = LeftRect + 1;
+          DestRect.right = RightRect - 1;
+          DestRect.top = TopRect + 1;
+          DestRect.bottom = BottomRect - 1;
+          ret = EngBitBlt(SurfObj, 
+                          NULL,
+                          NULL,
+                          NULL,
+                          NULL,
+                          &DestRect,
+                          NULL,
+                          NULL,
+                          BrushObj,
+                          NULL,
+                          PATCOPY);
+        }
+    }
     GDIOBJ_UnlockObj( dc->w.hBrush, GO_PEN_MAGIC );    
   }