gdi32: Avoid creating a copy of the pattern bits for the R2_COPYPEN case.

This commit is contained in:
Alexandre Julliard 2012-11-29 17:59:59 +01:00
parent 7339308e16
commit a796ad5ed8

View File

@ -1782,7 +1782,7 @@ static BOOL alloc_brush_mask_bits( dib_brush *brush )
static void free_brush_mask_bits( dib_brush *brush )
{
HeapFree(GetProcessHeap(), 0, brush->masks.and);
if (brush->masks.xor != brush->dib.bits.ptr) HeapFree(GetProcessHeap(), 0, brush->masks.xor);
brush->masks.and = brush->masks.xor = NULL;
}
@ -1798,6 +1798,12 @@ static BOOL create_pattern_brush_bits( dib_brush *brush )
DWORD *brush_bits = brush->dib.bits.ptr;
DWORD *and_bits, *xor_bits;
if (brush->rop == R2_COPYPEN)
{
brush->masks.xor = brush_bits; /* use the pattern bits directly */
return TRUE;
}
if (!alloc_brush_mask_bits( brush )) return FALSE;
and_bits = brush->masks.and;