mirror of
https://github.com/reactos/reactos.git
synced 2024-07-18 10:26:09 +00:00
Minor fixes
svn path=/trunk/; revision=1404
This commit is contained in:
parent
d17678ebd0
commit
06bf88e073
|
@ -99,7 +99,6 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
|
||||||
// Check for CopyBits or BitBlt hooks if one is not a GDI managed bitmap
|
// Check for CopyBits or BitBlt hooks if one is not a GDI managed bitmap
|
||||||
if((Dest->iType!=STYPE_BITMAP) || (Source->iType!=STYPE_BITMAP))
|
if((Dest->iType!=STYPE_BITMAP) || (Source->iType!=STYPE_BITMAP))
|
||||||
{
|
{
|
||||||
|
|
||||||
// Destination surface is device managed
|
// Destination surface is device managed
|
||||||
if(Dest->iType!=STYPE_BITMAP)
|
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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
|
|
@ -84,6 +84,10 @@ typedef BOOL (*PFN_CopyBits)(PSURFOBJ, PSURFOBJ, PCLIPOBJ,
|
||||||
|
|
||||||
typedef VOID (*PFN_Synchronize)(DHPDEV, PRECTL);
|
typedef VOID (*PFN_Synchronize)(DHPDEV, PRECTL);
|
||||||
|
|
||||||
|
typedef VOID (*PFN_MovePointer)(PSURFOBJ, LONG, LONG, PRECTL);
|
||||||
|
|
||||||
|
typedef HBITMAP (*PFN_CreateDeviceBitmap)(DHPDEV, SIZEL, ULONG);
|
||||||
|
|
||||||
typedef struct _SURFGDI {
|
typedef struct _SURFGDI {
|
||||||
BYTE BytesPerPixel;
|
BYTE BytesPerPixel;
|
||||||
|
|
||||||
|
@ -98,6 +102,7 @@ typedef struct _SURFGDI {
|
||||||
PFN_CopyBits CopyBits;
|
PFN_CopyBits CopyBits;
|
||||||
PFN_Synchronize Synchronize;
|
PFN_Synchronize Synchronize;
|
||||||
BOOL SynchronizeAccess;
|
BOOL SynchronizeAccess;
|
||||||
|
PFN_CreateDeviceBitmap CreateDeviceBitmap;
|
||||||
} SURFGDI, *PSURFGDI;
|
} SURFGDI, *PSURFGDI;
|
||||||
|
|
||||||
typedef struct _XFORMGDI {
|
typedef struct _XFORMGDI {
|
||||||
|
|
|
@ -49,31 +49,21 @@ VOID InitializeHooks(SURFGDI *SurfGDI)
|
||||||
{
|
{
|
||||||
SurfGDI->BitBlt = NULL;
|
SurfGDI->BitBlt = NULL;
|
||||||
SurfGDI->CopyBits = NULL;
|
SurfGDI->CopyBits = NULL;
|
||||||
|
SurfGDI->CreateDeviceBitmap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HBITMAP EngCreateDeviceBitmap(DHSURF dhsurf, SIZEL Size, ULONG Format)
|
HBITMAP EngCreateDeviceBitmap(DHSURF dhsurf, SIZEL Size, ULONG Format)
|
||||||
{
|
{
|
||||||
HBITMAP NewBitmap;
|
HBITMAP NewBitmap;
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
SURFGDI *SurfGDI;
|
|
||||||
|
|
||||||
SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
|
NewBitmap = EngCreateBitmap(Size, bytesPerPixel(Format) * Size.cx, Format, 0, NULL);
|
||||||
SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), NULL);
|
SurfObj = AccessUserObject(NewBitmap);
|
||||||
|
SurfObj->dhpdev = dhsurf;
|
||||||
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;
|
|
||||||
|
|
||||||
return NewBitmap;
|
return NewBitmap;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HBITMAP EngCreateBitmap(IN SIZEL Size,
|
HBITMAP EngCreateBitmap(IN SIZEL Size,
|
||||||
|
@ -82,14 +72,6 @@ HBITMAP EngCreateBitmap(IN SIZEL Size,
|
||||||
IN ULONG Flags,
|
IN ULONG Flags,
|
||||||
IN PVOID Bits)
|
IN PVOID Bits)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* SHOULD CALL THIS */
|
|
||||||
/* HBITMAP STDCALL W32kCreateBitmap(INT Width,
|
|
||||||
INT Height,
|
|
||||||
UINT Planes,
|
|
||||||
UINT BitsPerPel,
|
|
||||||
CONST VOID *Bits) */
|
|
||||||
|
|
||||||
HBITMAP NewBitmap;
|
HBITMAP NewBitmap;
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
SURFGDI *SurfGDI;
|
SURFGDI *SurfGDI;
|
||||||
|
@ -102,7 +84,8 @@ HBITMAP EngCreateBitmap(IN SIZEL Size,
|
||||||
InitializeHooks(SurfGDI);
|
InitializeHooks(SurfGDI);
|
||||||
SurfGDI->BytesPerPixel = bytesPerPixel(Format);
|
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)
|
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->hsurf = 0;
|
||||||
SurfObj->sizlBitmap = Size;
|
SurfObj->sizlBitmap = Size;
|
||||||
SurfObj->iBitmapFormat = Format;
|
SurfObj->iBitmapFormat = Format;
|
||||||
SurfObj->lDelta = Width;
|
|
||||||
SurfObj->iType = STYPE_BITMAP;
|
SurfObj->iType = STYPE_BITMAP;
|
||||||
|
|
||||||
// Use flags to determine bitmap type -- TOP_DOWN or whatever
|
// Use flags to determine bitmap type -- TOP_DOWN or whatever
|
||||||
|
@ -140,8 +122,6 @@ HSURF EngCreateDeviceSurface(DHSURF dhsurf, SIZEL Size, ULONG Format)
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
SURFGDI *SurfGDI;
|
SURFGDI *SurfGDI;
|
||||||
|
|
||||||
// DrvCreateDeviceSurface???
|
|
||||||
|
|
||||||
SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
|
SurfObj = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFOBJ), NULL);
|
||||||
SurfGDI = EngAllocMem(FL_ZERO_MEMORY, sizeof(SURFGDI), 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!
|
// it looks like this Dev is actually a pointer to the DC!
|
||||||
PDC Dc = (PDC)Dev;
|
PDC Dc = (PDC)Dev;
|
||||||
|
DbgPrint("Associate 1\n");
|
||||||
// DRVENABLEDATA *DED;
|
// DRVENABLEDATA *DED;
|
||||||
|
|
||||||
SurfGDI = AccessInternalObject(Surface);
|
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_SYNCHRONIZE) SurfGDI->Synchronize = Dc->DriverFunctions.Synchronize;
|
||||||
if(Hooks & HOOK_SYNCHRONIZEACCESS) SurfGDI->SynchronizeAccess = TRUE;
|
if(Hooks & HOOK_SYNCHRONIZEACCESS) SurfGDI->SynchronizeAccess = TRUE;
|
||||||
|
|
||||||
|
SurfGDI->CreateDeviceBitmap = Dc->DriverFunctions.CreateDeviceBitmap;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue