mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 00:49:26 +01:00
gtk: fix copying one DC into another with SRCCOPY rop (fixes issue #0013746)
git-svn-id: trunk@20056 -
This commit is contained in:
parent
35ab55a365
commit
1eb5c2a539
@ -42,10 +42,8 @@ type
|
|||||||
{ TGtk1DeviceContext }
|
{ TGtk1DeviceContext }
|
||||||
|
|
||||||
TGtk1DeviceContext = class(TGtkDeviceContext)
|
TGtk1DeviceContext = class(TGtkDeviceContext)
|
||||||
private
|
|
||||||
protected
|
|
||||||
function GetFunction: TGdkFunction; override;
|
|
||||||
public
|
public
|
||||||
|
function GetFunction: TGdkFunction; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|||||||
@ -316,8 +316,6 @@ type
|
|||||||
procedure CreateBrush; virtual;
|
procedure CreateBrush; virtual;
|
||||||
procedure CreatePen; virtual;
|
procedure CreatePen; virtual;
|
||||||
procedure CreateBitmap; virtual;
|
procedure CreateBitmap; virtual;
|
||||||
|
|
||||||
function GetFunction: TGdkFunction; virtual; abstract;
|
|
||||||
protected
|
protected
|
||||||
// winapi
|
// winapi
|
||||||
function SelectBitmap(AGdiObject: PGdiObject): PGdiObject; virtual;
|
function SelectBitmap(AGdiObject: PGdiObject): PGdiObject; virtual;
|
||||||
@ -328,8 +326,8 @@ type
|
|||||||
procedure SelectBrushProps; virtual;
|
procedure SelectBrushProps; virtual;
|
||||||
procedure SelectTextProps; virtual;
|
procedure SelectTextProps; virtual;
|
||||||
procedure SelectPenProps; virtual;
|
procedure SelectPenProps; virtual;
|
||||||
|
|
||||||
procedure SelectRegion;
|
procedure SelectRegion;
|
||||||
|
function GetFunction: TGdkFunction; virtual; abstract;
|
||||||
public
|
public
|
||||||
// device handles
|
// device handles
|
||||||
|
|
||||||
|
|||||||
@ -2614,8 +2614,10 @@ var
|
|||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('SrcDevBitmapToDrawable Simple copy');
|
DebugLn('SrcDevBitmapToDrawable Simple copy');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
gdk_gc_set_function(DstDevContext.GC, GDK_COPY);
|
||||||
gdk_window_copy_area(DstDevContext.Drawable, DstDevContext.GC, X, Y,
|
gdk_window_copy_area(DstDevContext.Drawable, DstDevContext.GC, X, Y,
|
||||||
SrcDrawable, XSrc, YSrc, Width, Height);
|
SrcDrawable, XSrc, YSrc, Width, Height);
|
||||||
|
gdk_gc_set_function(DstDevContext.GC, DstDevContext.GetFunction);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2803,7 +2805,7 @@ begin
|
|||||||
if (SrcWidth = 0) or (SrcHeight = 0) then exit;
|
if (SrcWidth = 0) or (SrcHeight = 0) then exit;
|
||||||
|
|
||||||
SizeChange := (Width <> SrcWidth) or (Height <> SrcHeight) or FlipVert or FlipHorz;
|
SizeChange := (Width <> SrcWidth) or (Height <> SrcHeight) or FlipVert or FlipHorz;
|
||||||
ROpIsSpecial := (ROp <> SRCCOPY);
|
ROpIsSpecial := (Rop <> SRCCOPY);
|
||||||
|
|
||||||
SrcDCOrigin := SrcDevContext.Offset;
|
SrcDCOrigin := SrcDevContext.Offset;
|
||||||
Inc(XSrc, SrcDCOrigin.X);
|
Inc(XSrc, SrcDCOrigin.X);
|
||||||
|
|||||||
@ -38,10 +38,9 @@ type
|
|||||||
{ TGtk2DeviceContext }
|
{ TGtk2DeviceContext }
|
||||||
|
|
||||||
TGtk2DeviceContext = class(TGtkDeviceContext)
|
TGtk2DeviceContext = class(TGtkDeviceContext)
|
||||||
protected
|
|
||||||
function GetFunction: TGdkFunction; override;
|
|
||||||
public
|
public
|
||||||
procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor);
|
procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor);
|
||||||
|
function GetFunction: TGdkFunction; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);
|
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user