You've already forked lazarus-ccr
fixes compilation and prepares gtkroutines for gtk post 0.9.24
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@287 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -54,13 +54,21 @@ procedure WidgetSetDrawRGB32Bitmap(Dest: HDC; DstX, DstY: Integer; SrcX, SrcY, S
|
|||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
begin
|
begin
|
||||||
P := GetDCOffset(TDeviceContext(Dest));
|
{$IFDEF GTK_POST_0924}
|
||||||
|
P := TGtkDeviceContext(Dest).Offset;
|
||||||
|
Inc(DstX, P.X);
|
||||||
|
Inc(DstY, P.Y);
|
||||||
|
gdk_draw_rgb_32_image(TGtkDeviceContext(Dest).Drawable, TGtkDeviceContext(Dest).GC,
|
||||||
|
DstX, DstY, SrcWidth, SrcHeight, GDK_RGB_DITHER_NONE,
|
||||||
|
Pguchar(Bitmap.GetPixelPtrUnsafe(SrcX, SrcY)), Bitmap.RowPixelStride shl 2);
|
||||||
|
{$ELSE}
|
||||||
|
P := GetDCOffset(TGtkDeviceContext(Dest));
|
||||||
Inc(DstX, P.X);
|
Inc(DstX, P.X);
|
||||||
Inc(DstY, P.Y);
|
Inc(DstY, P.Y);
|
||||||
|
|
||||||
gdk_draw_rgb_32_image(TDeviceContext(Dest).Drawable, TDeviceContext(Dest).GC,
|
gdk_draw_rgb_32_image(TDeviceContext(Dest).Drawable, TDeviceContext(Dest).GC,
|
||||||
DstX, DstY, SrcWidth, SrcHeight, GDK_RGB_DITHER_NONE,
|
DstX, DstY, SrcWidth, SrcHeight, GDK_RGB_DITHER_NONE,
|
||||||
Pguchar(Bitmap.GetPixelPtrUnsafe(SrcX, SrcY)), Bitmap.RowPixelStride shl 2);
|
Pguchar(Bitmap.GetPixelPtrUnsafe(SrcX, SrcY)), Bitmap.RowPixelStride shl 2);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure WidgetSetDrawRGB8Bitmap(Dest: HDC; DstX, DstY: Integer; SrcX, SrcY,
|
procedure WidgetSetDrawRGB8Bitmap(Dest: HDC; DstX, DstY: Integer; SrcX, SrcY,
|
||||||
@ -68,13 +76,21 @@ procedure WidgetSetDrawRGB8Bitmap(Dest: HDC; DstX, DstY: Integer; SrcX, SrcY,
|
|||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF GTK_POST_0924}
|
||||||
|
P := TGtkDeviceContext(Dest).Offset;
|
||||||
|
Inc(DstX, P.X);
|
||||||
|
Inc(DstY, P.Y);
|
||||||
|
gdk_draw_gray_image(TGtkDeviceContext(Dest).Drawable, TGtkDeviceContext(Dest).GC,
|
||||||
|
DstX, DstY, SrcWidth, SrcHeight, GDK_RGB_DITHER_NONE,
|
||||||
|
Pguchar(Bitmap.Get8PixelPtrUnsafe(SrcX, SrcY)), Bitmap.RowPixelStride);
|
||||||
|
{$ELSE}
|
||||||
P := GetDCOffset(TDeviceContext(Dest));
|
P := GetDCOffset(TDeviceContext(Dest));
|
||||||
Inc(DstX, P.X);
|
Inc(DstX, P.X);
|
||||||
Inc(DstY, P.Y);
|
Inc(DstY, P.Y);
|
||||||
|
|
||||||
gdk_draw_gray_image(TDeviceContext(Dest).Drawable, TDeviceContext(Dest).GC,
|
gdk_draw_gray_image(TDeviceContext(Dest).Drawable, TDeviceContext(Dest).GC,
|
||||||
DstX, DstY, SrcWidth, SrcHeight, GDK_RGB_DITHER_NONE,
|
DstX, DstY, SrcWidth, SrcHeight, GDK_RGB_DITHER_NONE,
|
||||||
Pguchar(Bitmap.Get8PixelPtrUnsafe(SrcX, SrcY)), Bitmap.RowPixelStride);
|
Pguchar(Bitmap.Get8PixelPtrUnsafe(SrcX, SrcY)), Bitmap.RowPixelStride);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -558,7 +558,7 @@ begin
|
|||||||
SwapInt(FWidth, ABitmap.FWidth);
|
SwapInt(FWidth, ABitmap.FWidth);
|
||||||
SwapInt(FHeight, ABitmap.FHeight);
|
SwapInt(FHeight, ABitmap.FHeight);
|
||||||
SwapInt(FRowPixelStride, ABitmap.FRowPixelStride);
|
SwapInt(FRowPixelStride, ABitmap.FRowPixelStride);
|
||||||
SwapInt(FSizeOfPixel, ABitmap.SizeOfPixel);
|
SwapInt(FSizeOfPixel, ABitmap.FSizeOfPixel);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRGBBitmapCore.GetPixelPtrUnsafe(X, Y: Integer): PRGBPixel;
|
function TRGBBitmapCore.GetPixelPtrUnsafe(X, Y: Integer): PRGBPixel;
|
||||||
|
Reference in New Issue
Block a user