From 1eb5c2a539f4241aef7fc8c0fb77a1e3a33803b5 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 20 May 2009 01:59:15 +0000 Subject: [PATCH] gtk: fix copying one DC into another with SRCCOPY rop (fixes issue #0013746) git-svn-id: trunk@20056 - --- lcl/interfaces/gtk/gtk1def.pp | 4 +--- lcl/interfaces/gtk/gtkdef.pp | 4 +--- lcl/interfaces/gtk/gtkwidgetset.inc | 4 +++- lcl/interfaces/gtk2/gtk2def.pp | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lcl/interfaces/gtk/gtk1def.pp b/lcl/interfaces/gtk/gtk1def.pp index 2cfff47e92..dc4fb37f28 100644 --- a/lcl/interfaces/gtk/gtk1def.pp +++ b/lcl/interfaces/gtk/gtk1def.pp @@ -42,10 +42,8 @@ type { TGtk1DeviceContext } TGtk1DeviceContext = class(TGtkDeviceContext) - private - protected - function GetFunction: TGdkFunction; override; public + function GetFunction: TGdkFunction; override; end; implementation diff --git a/lcl/interfaces/gtk/gtkdef.pp b/lcl/interfaces/gtk/gtkdef.pp index 4b4528f5be..53a2fb7f54 100644 --- a/lcl/interfaces/gtk/gtkdef.pp +++ b/lcl/interfaces/gtk/gtkdef.pp @@ -316,8 +316,6 @@ type procedure CreateBrush; virtual; procedure CreatePen; virtual; procedure CreateBitmap; virtual; - - function GetFunction: TGdkFunction; virtual; abstract; protected // winapi function SelectBitmap(AGdiObject: PGdiObject): PGdiObject; virtual; @@ -328,8 +326,8 @@ type procedure SelectBrushProps; virtual; procedure SelectTextProps; virtual; procedure SelectPenProps; virtual; - procedure SelectRegion; + function GetFunction: TGdkFunction; virtual; abstract; public // device handles diff --git a/lcl/interfaces/gtk/gtkwidgetset.inc b/lcl/interfaces/gtk/gtkwidgetset.inc index efd596eacd..bd8acedc19 100644 --- a/lcl/interfaces/gtk/gtkwidgetset.inc +++ b/lcl/interfaces/gtk/gtkwidgetset.inc @@ -2614,8 +2614,10 @@ var {$IFDEF VerboseStretchCopyArea} DebugLn('SrcDevBitmapToDrawable Simple copy'); {$ENDIF} + gdk_gc_set_function(DstDevContext.GC, GDK_COPY); gdk_window_copy_area(DstDevContext.Drawable, DstDevContext.GC, X, Y, SrcDrawable, XSrc, YSrc, Width, Height); + gdk_gc_set_function(DstDevContext.GC, DstDevContext.GetFunction); Exit; end; @@ -2803,7 +2805,7 @@ begin if (SrcWidth = 0) or (SrcHeight = 0) then exit; SizeChange := (Width <> SrcWidth) or (Height <> SrcHeight) or FlipVert or FlipHorz; - ROpIsSpecial := (ROp <> SRCCOPY); + ROpIsSpecial := (Rop <> SRCCOPY); SrcDCOrigin := SrcDevContext.Offset; Inc(XSrc, SrcDCOrigin.X); diff --git a/lcl/interfaces/gtk2/gtk2def.pp b/lcl/interfaces/gtk2/gtk2def.pp index c00d199060..2ace1ddf61 100644 --- a/lcl/interfaces/gtk2/gtk2def.pp +++ b/lcl/interfaces/gtk2/gtk2def.pp @@ -38,10 +38,9 @@ type { TGtk2DeviceContext } TGtk2DeviceContext = class(TGtkDeviceContext) - protected - function GetFunction: TGdkFunction; override; public procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor); + function GetFunction: TGdkFunction; override; end; procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);