gtk: fix copying one DC into another with SRCCOPY rop (fixes issue #0013746)

git-svn-id: trunk@20056 -
This commit is contained in:
paul 2009-05-20 01:59:15 +00:00
parent 35ab55a365
commit 1eb5c2a539
4 changed files with 6 additions and 9 deletions

View File

@ -42,10 +42,8 @@ type
{ TGtk1DeviceContext }
TGtk1DeviceContext = class(TGtkDeviceContext)
private
protected
function GetFunction: TGdkFunction; override;
public
function GetFunction: TGdkFunction; override;
end;
implementation

View File

@ -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

View File

@ -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);

View File

@ -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);