From 867a54d87f8d81143b49d8e6db73b3ed281390cb Mon Sep 17 00:00:00 2001 From: lazarus Date: Sat, 17 Aug 2002 23:39:57 +0000 Subject: [PATCH] MG: accelerated FillRect git-svn-id: trunk@1905 - --- lcl/interfaces/gtk/gtkwinapi.inc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 7e7f42d018..ebf09dfb22 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -2654,16 +2654,21 @@ begin // Temporary hold the old brush to // replace it with the given brush OldCurrentBrush := CurrentBrush; - CurrentBrush := PGdiObject(Brush); - SelectedColors:=dcscCustom; + if PGdiObject(Brush)<>OldCurrentBrush then begin + OldCurrentBrush := CurrentBrush; + CurrentBrush := PGdiObject(Brush); + SelectedColors:=dcscCustom; + end; SelectGDKBrushProps(DC); DCOrigin:=GetDCOffset(TDeviceContext(DC)); gdk_draw_rectangle(Drawable, GC, 1, Rect.Left+DCOrigin.X, Rect.Top+DCOrigin.Y, Width, Height); // Restore current brush - SelectedColors:=dcscCustom; - CurrentBrush := OldCurrentBrush; + if PGdiObject(Brush)<>OldCurrentBrush then begin + SelectedColors:=dcscCustom; + CurrentBrush := OldCurrentBrush; + end; Result := True; end; @@ -7226,6 +7231,9 @@ end; { ============================================================================= $Log$ + Revision 1.149 2002/10/08 14:28:14 lazarus + MG: accelerated FillRect + Revision 1.148 2002/10/08 14:10:03 lazarus MG: added TDeviceContext.SelectedColors