Use user mode mem for bitmaps larger than 4K to save pool memory.

svn path=/trunk/; revision=56462
This commit is contained in:
Timo Kreuzer 2012-05-01 12:47:21 +00:00
parent aedd14f915
commit 9c5d9d1b46

View file

@ -143,7 +143,7 @@ NtGdiCreateBitmap(
IN OPTIONAL LPBYTE pUnsafeBits) IN OPTIONAL LPBYTE pUnsafeBits)
{ {
HBITMAP hbmp; HBITMAP hbmp;
ULONG cRealBpp, cjWidthBytes, iFormat; ULONG cRealBpp, cjWidthBytes, iFormat, fjBitmap;
ULONGLONG cjSize; ULONGLONG cjSize;
PSURFACE psurf; PSURFACE psurf;
@ -165,12 +165,15 @@ NtGdiCreateBitmap(
return NULL; return NULL;
} }
/* Allocations larger than PAGE_SIZE go into user mem */
fjBitmap = (cjSize > PAGE_SIZE) ? BMF_USERMEM : 0;
/* Allocate the surface (but don't set the bits) */ /* Allocate the surface (but don't set the bits) */
psurf = SURFACE_AllocSurface(STYPE_BITMAP, psurf = SURFACE_AllocSurface(STYPE_BITMAP,
nWidth, nWidth,
nHeight, nHeight,
iFormat, iFormat,
0, fjBitmap,
0, 0,
NULL); NULL);
if (!psurf) if (!psurf)