Minor fixes
authorJason Filby <jason.filby@gmail.com>
Sat, 14 Oct 2000 22:42:11 +0000 (22:42 +0000)
committerJason Filby <jason.filby@gmail.com>
Sat, 14 Oct 2000 22:42:11 +0000 (22:42 +0000)
svn path=/trunk/; revision=1404

reactos/subsys/win32k/eng/bitblt.c
reactos/subsys/win32k/eng/bitmap.c
reactos/subsys/win32k/eng/objects.h
reactos/subsys/win32k/eng/surface.c

index 947576e..b46b6a3 100644 (file)
@@ -99,7 +99,6 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
    // Check for CopyBits or BitBlt hooks if one is not a GDI managed bitmap
    if((Dest->iType!=STYPE_BITMAP) || (Source->iType!=STYPE_BITMAP))
    {
-
       // Destination surface is device managed
       if(Dest->iType!=STYPE_BITMAP)
       {
index 7deae92..0c037c3 100644 (file)
@@ -1,3 +1,5 @@
+THIS FILE IS DEPRECIATED AND MUST BE REMOVED FROM CVS (if i forget..)
+
 /*
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
index 044eb69..a263b77 100644 (file)
@@ -84,6 +84,10 @@ typedef BOOL (*PFN_CopyBits)(PSURFOBJ, PSURFOBJ, PCLIPOBJ,
 
 typedef VOID (*PFN_Synchronize)(DHPDEV, PRECTL);
 
+typedef VOID (*PFN_MovePointer)(PSURFOBJ, LONG, LONG, PRECTL);
+
+typedef HBITMAP (*PFN_CreateDeviceBitmap)(DHPDEV, SIZEL, ULONG);
+
 typedef struct _SURFGDI {
    BYTE  BytesPerPixel;
 
@@ -98,6 +102,7 @@ typedef struct _SURFGDI {
    PFN_CopyBits CopyBits;
    PFN_Synchronize Synchronize;
    BOOL SynchronizeAccess;
+   PFN_CreateDeviceBitmap CreateDeviceBitmap;
 } SURFGDI, *PSURFGDI;
 
 typedef struct _XFORMGDI {
index 7716c95..a7c18f5 100644 (file)
@@ -49,31 +49,21 @@ VOID InitializeHooks(SURFGDI *SurfGDI)
 {
    SurfGDI->BitBlt   = NULL;
    SurfGDI->CopyBits = NULL;
+   SurfGDI->CreateDeviceBitmap = NULL;
 }
 
 HBITMAP EngCreateDeviceBitmap(DHSURF dhsurf, SIZEL Size, ULONG Format)
 {
    HBITMAP NewBitmap;
    SURFOBJ *SurfObj;
-   SURFGDI *SurfGDI;
-
-   SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
-   SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), NULL);
-
-   NewBitmap = CreateGDIHandle(SurfGDI, SurfObj);
 
-   InitializeHooks(SurfGDI);
-
-   SurfGDI->BytesPerPixel = bytesPerPixel(Format);
-
-   SurfObj->dhsurf = dhsurf;
-   SurfObj->hsurf  = dhsurf; // FIXME: Is this correct??
-   SurfObj->sizlBitmap = Size;
-   SurfObj->iBitmapFormat = Format;
-   SurfObj->lDelta = SurfGDI->BytesPerPixel * Size.cx;
-   SurfObj->iType = STYPE_DEVBITMAP;
+   NewBitmap = EngCreateBitmap(Size, bytesPerPixel(Format) * Size.cx, Format, 0, NULL);
+   SurfObj = AccessUserObject(NewBitmap);
+   SurfObj->dhpdev = dhsurf;
 
    return NewBitmap;
+
+   return 0;
 }
 
 HBITMAP EngCreateBitmap(IN SIZEL  Size,
@@ -82,14 +72,6 @@ HBITMAP EngCreateBitmap(IN SIZEL  Size,
                         IN ULONG  Flags,
                         IN PVOID  Bits)
 {
-
-/* SHOULD CALL THIS */
-/* HBITMAP STDCALL W32kCreateBitmap(INT  Width,
-                          INT  Height,
-                          UINT  Planes,
-                          UINT  BitsPerPel,
-                          CONST VOID *Bits) */
-
    HBITMAP NewBitmap;
    SURFOBJ *SurfObj;
    SURFGDI *SurfGDI;
@@ -102,7 +84,8 @@ HBITMAP EngCreateBitmap(IN SIZEL  Size,
    InitializeHooks(SurfGDI);
    SurfGDI->BytesPerPixel = bytesPerPixel(Format);
 
-   SurfObj->cjBits = Width * Size.cy;
+   SurfObj->lDelta = ((bytesPerPixel(Format) * Width) + 31) & ~31; // round up 4 bytes
+   SurfObj->cjBits = SurfObj->lDelta * Size.cy;
 
    if(Bits!=NULL)
    {
@@ -122,11 +105,10 @@ HBITMAP EngCreateBitmap(IN SIZEL  Size,
       }
    }
 
-   SurfObj->dhsurf = 0;
+   SurfObj->dhsurf = 0; // device managed surface
    SurfObj->hsurf  = 0;
    SurfObj->sizlBitmap = Size;
    SurfObj->iBitmapFormat = Format;
-   SurfObj->lDelta = Width;
    SurfObj->iType = STYPE_BITMAP;
 
    // Use flags to determine bitmap type -- TOP_DOWN or whatever
@@ -140,8 +122,6 @@ HSURF EngCreateDeviceSurface(DHSURF dhsurf, SIZEL Size, ULONG Format)
    SURFOBJ *SurfObj;
    SURFGDI *SurfGDI;
 
-   // DrvCreateDeviceSurface???
-
    SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
    SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), NULL);
 
@@ -180,7 +160,7 @@ BOOL EngAssociateSurface(HSURF Surface, HDEV Dev, ULONG Hooks)
 
 // it looks like this Dev is actually a pointer to the DC!
    PDC Dc = (PDC)Dev;
-
+DbgPrint("Associate 1\n");
 //   DRVENABLEDATA *DED;
 
    SurfGDI = AccessInternalObject(Surface);
@@ -204,6 +184,8 @@ BOOL EngAssociateSurface(HSURF Surface, HDEV Dev, ULONG Hooks)
    if(Hooks & HOOK_SYNCHRONIZE)       SurfGDI->Synchronize       = Dc->DriverFunctions.Synchronize;
    if(Hooks & HOOK_SYNCHRONIZEACCESS) SurfGDI->SynchronizeAccess = TRUE;
 
+   SurfGDI->CreateDeviceBitmap = Dc->DriverFunctions.CreateDeviceBitmap;
+
    return TRUE;
 }