Alexandre Julliard : gdi32: Avoid creating a copy of the pattern bits for the R2_COPYPEN case.
Module: wine Branch: master Commit: a796ad5ed8d06c6ac2edb67242e00b646bf1e6ca URL: http://source.winehq.org/git/wine.git/?a=commit;h=a796ad5ed8d06c6ac2edb67242... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 29 17:59:59 2012 +0100 gdi32: Avoid creating a copy of the pattern bits for the R2_COPYPEN case. --- dlls/gdi32/dibdrv/objects.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index b658af6..8dee8e8 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -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;
participants (1)
-
Alexandre Julliard