mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 06:12:59 +00:00
- Don't create XLATEOBJ for BitBlt and StretchBlt operations that don't use source DC.
svn path=/trunk/; revision=10015
This commit is contained in:
parent
bce67c86c4
commit
226251dab1
1 changed files with 110 additions and 99 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: bitmaps.c,v 1.77 2004/07/03 17:40:27 navaraf Exp $ */
|
/* $Id: bitmaps.c,v 1.78 2004/07/07 16:36:08 navaraf Exp $ */
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
|
|
||||||
#define IN_RECT(r,x,y) \
|
#define IN_RECT(r,x,y) \
|
||||||
|
@ -139,10 +139,13 @@ NtGdiBitBlt(
|
||||||
BrushObj = NULL;
|
BrushObj = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create the XLATEOBJ. */
|
||||||
|
if (UsesSource)
|
||||||
|
{
|
||||||
if (DCDest->w.hPalette != 0)
|
if (DCDest->w.hPalette != 0)
|
||||||
DestPalette = DCDest->w.hPalette;
|
DestPalette = DCDest->w.hPalette;
|
||||||
|
|
||||||
if (UsesSource && DCSrc->w.hPalette != 0)
|
if (DCSrc->w.hPalette != 0)
|
||||||
SourcePalette = DCSrc->w.hPalette;
|
SourcePalette = DCSrc->w.hPalette;
|
||||||
|
|
||||||
PalSourceGDI = PALETTE_LockPalette(SourcePalette);
|
PalSourceGDI = PALETTE_LockPalette(SourcePalette);
|
||||||
|
@ -186,7 +189,7 @@ NtGdiBitBlt(
|
||||||
XlateObj = (XLATEOBJ*)IntEngCreateMonoXlate(SourceMode, DestPalette,
|
XlateObj = (XLATEOBJ*)IntEngCreateMonoXlate(SourceMode, DestPalette,
|
||||||
SourcePalette, DCSrc->w.backgroundColor);
|
SourcePalette, DCSrc->w.backgroundColor);
|
||||||
}
|
}
|
||||||
else if (UsesSource && 1 == DCSrc->w.bitsPerPixel)
|
else if (DCSrc->w.bitsPerPixel == 1)
|
||||||
{
|
{
|
||||||
ULONG Colors[2];
|
ULONG Colors[2];
|
||||||
|
|
||||||
|
@ -220,11 +223,13 @@ NtGdiBitBlt(
|
||||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Perform the bitblt operation */
|
/* Perform the bitblt operation */
|
||||||
Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj,
|
Status = IntEngBitBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip, XlateObj,
|
||||||
&DestRect, &SourcePoint, NULL, &BrushObj->BrushObject, &BrushOrigin, ROP);
|
&DestRect, &SourcePoint, NULL, &BrushObj->BrushObject, &BrushOrigin, ROP);
|
||||||
|
|
||||||
|
if (UsesSource)
|
||||||
EngDeleteXlate(XlateObj);
|
EngDeleteXlate(XlateObj);
|
||||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||||
if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap)
|
if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap)
|
||||||
|
@ -1140,10 +1145,13 @@ NtGdiStretchBlt(
|
||||||
BrushObj = NULL;
|
BrushObj = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create the XLATEOBJ. */
|
||||||
|
if (UsesSource)
|
||||||
|
{
|
||||||
if (DCDest->w.hPalette != 0)
|
if (DCDest->w.hPalette != 0)
|
||||||
DestPalette = DCDest->w.hPalette;
|
DestPalette = DCDest->w.hPalette;
|
||||||
|
|
||||||
if (UsesSource && DCSrc->w.hPalette != 0)
|
if (DCSrc->w.hPalette != 0)
|
||||||
SourcePalette = DCSrc->w.hPalette;
|
SourcePalette = DCSrc->w.hPalette;
|
||||||
|
|
||||||
PalSourceGDI = PALETTE_LockPalette(SourcePalette);
|
PalSourceGDI = PALETTE_LockPalette(SourcePalette);
|
||||||
|
@ -1181,6 +1189,7 @@ NtGdiStretchBlt(
|
||||||
PALETTE_UnlockPalette(DestPalette);
|
PALETTE_UnlockPalette(DestPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: Use the same logic for create XLATEOBJ as in NtGdiBitBlt. */
|
||||||
XlateObj = (XLATEOBJ*)IntEngCreateXlate(DestMode, SourceMode, DestPalette, SourcePalette);
|
XlateObj = (XLATEOBJ*)IntEngCreateXlate(DestMode, SourceMode, DestPalette, SourcePalette);
|
||||||
if (NULL == XlateObj)
|
if (NULL == XlateObj)
|
||||||
{
|
{
|
||||||
|
@ -1192,11 +1201,13 @@ NtGdiStretchBlt(
|
||||||
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Perform the bitblt operation */
|
/* Perform the bitblt operation */
|
||||||
Status = IntEngStretchBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip,
|
Status = IntEngStretchBlt(BitmapDest, BitmapSrc, NULL, DCDest->CombinedClip,
|
||||||
XlateObj, &DestRect, &SourceRect, NULL, NULL, NULL, COLORONCOLOR);
|
XlateObj, &DestRect, &SourceRect, NULL, NULL, NULL, COLORONCOLOR);
|
||||||
|
|
||||||
|
if (UsesSource)
|
||||||
EngDeleteXlate(XlateObj);
|
EngDeleteXlate(XlateObj);
|
||||||
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
BITMAPOBJ_UnlockBitmap(DCDest->w.hBitmap);
|
||||||
if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap)
|
if (UsesSource && DCSrc->w.hBitmap != DCDest->w.hBitmap)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue