Commit in reactos/subsys/win32k on MAIN
eng/surface.c+53-421.40 -> 1.41
objects/dib.c+5-131.52 -> 1.53
       /objconv.c+3-31.18 -> 1.19
       /text.c+2-21.97 -> 1.98
+63-60
4 modified files
Handle RLE bottom-up dibs

reactos/subsys/win32k/eng
surface.c 1.40 -> 1.41
diff -u -r1.40 -r1.41
--- surface.c	30 May 2004 14:01:12 -0000	1.40
+++ surface.c	23 Jun 2004 07:31:22 -0000	1.41
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: surface.c,v 1.40 2004/05/30 14:01:12 weiden Exp $
+/* $Id: surface.c,v 1.41 2004/06/23 07:31:22 gvg Exp $
  * 
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -317,57 +317,68 @@
   PVOID UncompressedBits;
   ULONG UncompressedFormat;
 
-  NewBitmap = (PVOID)CreateGDIHandle(sizeof(SURFGDI), sizeof(SURFOBJ), (PVOID*)&SurfGDI, (PVOID*)&SurfObj);
-  if( !ValidEngHandle( NewBitmap ) )
+if (Width < 0) __asm__("int $3\n");
+  NewBitmap = (HBITMAP) CreateGDIHandle(sizeof(SURFGDI), sizeof(SURFOBJ), (PVOID*)&SurfGDI, (PVOID*)&SurfObj);
+  if (! ValidEngHandle(NewBitmap))
 	return 0;
 
   SurfGDI->BitsPerPixel = BitsPerFormat(Format);
-  if (Format == BMF_4RLE) {
-	  SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_4BPP));
-	  SurfObj->cjBits = SurfObj->lDelta * Size.cy;
-	  UncompressedFormat = BMF_4BPP;
+  if (Format == BMF_4RLE)
+    {
+      SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_4BPP));
+      SurfObj->cjBits = SurfObj->lDelta * Size.cy;
+      UncompressedFormat = BMF_4BPP;
       UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0);
-	  Decompress4bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta);
-  } else {
-	  if (Format == BMF_8RLE) {
-		  SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_8BPP));
-		  SurfObj->cjBits = SurfObj->lDelta * Size.cy;
-	      UncompressedFormat = BMF_8BPP;
-	      UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0);
-		  Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta);
-	  } else {
-  SurfObj->lDelta = Width;
-  SurfObj->cjBits = SurfObj->lDelta * Size.cy;
-		  UncompressedBits = Bits;
-		  UncompressedFormat = Format;
-	  }
-  }
-  if(UncompressedBits!=NULL)
-  {
-    SurfObj->pvBits = UncompressedBits;
-  } else
-  {
-    if (SurfObj->cjBits == 0)
+      Decompress4bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta);
+    }
+  else if (Format == BMF_8RLE)
     {
-      SurfObj->pvBits = NULL;
+      SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_8BPP));
+      SurfObj->cjBits = SurfObj->lDelta * Size.cy;
+      UncompressedFormat = BMF_8BPP;
+      UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0);
+      Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta);
     }
-    else
+  else
     {
-      if(Flags & BMF_USERMEM)
-      {
-        SurfObj->pvBits = EngAllocUserMem(SurfObj->cjBits, 0);
-      } else {
-        if(Flags & BMF_NOZEROINIT)
+      SurfObj->lDelta = Width;
+      SurfObj->cjBits = Width * Size.cy;
+      UncompressedBits = Bits;
+      UncompressedFormat = Format;
+    }
+
+  if (UncompressedBits != NULL)
+    {
+      SurfObj->pvBits = UncompressedBits;
+    }
+  else
+    {
+      if (SurfObj->cjBits == 0)
         {
-          SurfObj->pvBits = EngAllocMem(0, SurfObj->cjBits, 0);
-        } else {
-          SurfObj->pvBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0);
+          SurfObj->pvBits = NULL;
         }
-      }
+      else
+        {
+          if (0 != (Flags & BMF_USERMEM))
+            {
+              SurfObj->pvBits = EngAllocUserMem(SurfObj->cjBits, 0);
+            }
+          else
+            {
+              SurfObj->pvBits = EngAllocMem(0 != (Flags & BMF_NOZEROINIT) ? 0 : FL_ZERO_MEMORY,
+                                            SurfObj->cjBits, 0);
+             }
+         }
+     }
+
+
+  if (0 == (Flags & BMF_TOPDOWN))
+    {
+      SurfObj->pvBits = (PVOID) ((PCHAR) UncompressedBits + SurfObj->cjBits - SurfObj->lDelta);
+      SurfObj->lDelta = - SurfObj->lDelta;
     }
-  }
 
-  SurfObj->dhsurf = 0; // device managed surface
+  SurfObj->dhsurf = 0; /* device managed surface */
   SurfObj->hsurf  = 0;
   SurfObj->dhpdev = NULL;
   SurfObj->hdev = NULL;
@@ -380,7 +391,7 @@
 
   InitializeFuncs(SurfGDI, UncompressedFormat);
 
-  // Use flags to determine bitmap type -- TOP_DOWN or whatever
+  /* Use flags to determine bitmap type -- TOP_DOWN or whatever */
 
   return NewBitmap;
 }

reactos/subsys/win32k/objects
dib.c 1.52 -> 1.53
diff -u -r1.52 -r1.53
--- dib.c	22 Jun 2004 20:08:17 -0000	1.52
+++ dib.c	23 Jun 2004 07:31:22 -0000	1.53
@@ -1,5 +1,5 @@
 /*
- * $Id: dib.c,v 1.52 2004/06/22 20:08:17 gvg Exp $
+ * $Id: dib.c,v 1.53 2004/06/23 07:31:22 gvg Exp $
  *
  * ReactOS W32 Subsystem
  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
@@ -132,8 +132,7 @@
   //RGBQUAD  *lpRGB;
   HPALETTE    DDB_Palette, DIB_Palette;
   ULONG       DDB_Palette_Type, DIB_Palette_Type;
-  const BYTE *vBits = (const BYTE*)Bits;
-  INT         scanDirection = 1, DIBWidth;
+  INT         DIBWidth;
 
   // Check parameters
   if (!(bitmap = BITMAPOBJ_LockBitmap(hBitmap)))
@@ -160,18 +159,11 @@
   // Determine width of DIB
   DIBWidth = DIB_GetDIBWidthBytes(SourceSize.cx, bmi->bmiHeader.biBitCount);
 
-  // Determine DIB Vertical Orientation
-  if(bmi->bmiHeader.biHeight > 0)
-  {
-    scanDirection = -1;
-    vBits += DIBWidth * bmi->bmiHeader.biHeight - DIBWidth;
-  }
-
   SourceBitmap = EngCreateBitmap(SourceSize,
-                                 DIBWidth * scanDirection,
+                                 DIBWidth,
                                  BitmapFormat(bmi->bmiHeader.biBitCount, bmi->bmiHeader.biCompression),
-                                 0,
-                                 (PVOID)vBits );
+                                 0 < bmi->bmiHeader.biHeight ? 0 : BMF_TOPDOWN,
+                                 (PVOID) Bits);
   SourceSurf = (SURFOBJ*)AccessUserObject((ULONG)SourceBitmap);
 
   // Destination palette obtained from the hDC

reactos/subsys/win32k/objects
objconv.c 1.18 -> 1.19
diff -u -r1.18 -r1.19
--- objconv.c	10 May 2004 17:07:20 -0000	1.18
+++ objconv.c	23 Jun 2004 07:31:22 -0000	1.19
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: objconv.c,v 1.18 2004/05/10 17:07:20 weiden Exp $ */
+/* $Id: objconv.c,v 1.19 2004/06/23 07:31:22 gvg Exp $ */
 #include <w32k.h>
 
 HBITMAP FASTCALL BitmapToSurf(PBITMAPOBJ BitmapObj, HDEV GDIDevice)
@@ -31,13 +31,13 @@
     {
     BitmapHandle = EngCreateBitmap(Size, BitmapObj->dib->dsBm.bmWidthBytes,
                                    BitmapFormat(BitmapObj->dib->dsBm.bmBitsPixel, BI_RGB),
-                                   0, BitmapObj->dib->dsBm.bmBits);
+                                   BMF_TOPDOWN, BitmapObj->dib->dsBm.bmBits);
     }
   else
     {
     BitmapHandle = EngCreateBitmap(Size, BitmapObj->bitmap.bmWidthBytes,
                                    BitmapFormat(BitmapObj->bitmap.bmBitsPixel, BI_RGB),
-                                   0, BitmapObj->bitmap.bmBits);
+                                   BMF_TOPDOWN, BitmapObj->bitmap.bmBits);
     }
   if (NULL != BitmapHandle && NULL != GDIDevice)
     {

reactos/subsys/win32k/objects
text.c 1.97 -> 1.98
diff -u -r1.97 -r1.98
--- text.c	20 Jun 2004 00:45:37 -0000	1.97
+++ text.c	23 Jun 2004 07:31:22 -0000	1.98
@@ -22,7 +22,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: text.c,v 1.97 2004/06/20 00:45:37 navaraf Exp $ */
+/* $Id: text.c,v 1.98 2004/06/23 07:31:22 gvg Exp $ */
 #include <w32k.h>
 
 #include <ft2build.h>
@@ -1865,7 +1865,7 @@
        * limit the work of the transbitblt.
        */
 
-      HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, 0, glyph->bitmap.buffer);
+      HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, BMF_TOPDOWN, glyph->bitmap.buffer);
       SourceGlyphSurf = (SURFOBJ*)AccessUserObject((ULONG) HSourceGlyph);
     
       /*
CVSspam 0.2.8