Commit a796ad5e authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 7339308e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment