mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Minor fixes
svn path=/trunk/; revision=1404
This commit is contained in:
parent
d17678ebd0
commit
06bf88e073
4 changed files with 19 additions and 31 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue