mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:50:06 +02:00
Gtk2: skip mask in any case when creating 1bpp GdkBitmap otherwise gtk2 crashes. issue #21673
git-svn-id: trunk@38356 -
This commit is contained in:
parent
16ec1d1b95
commit
c04a85a663
@ -295,17 +295,21 @@ begin
|
|||||||
GdiObject^.Depth := ImgDepth;
|
GdiObject^.Depth := ImgDepth;
|
||||||
|
|
||||||
// create Pixmap from data
|
// create Pixmap from data
|
||||||
if ImgDepth = 1
|
if ImgDepth = 1 then
|
||||||
then begin
|
begin
|
||||||
// create a GdkBitmap
|
// create a GdkBitmap
|
||||||
if ImgData <> nil
|
if ImgData <> nil then
|
||||||
then Drawable := gdk_bitmap_create_from_data(nil, ImgData, ImgWidth, ImgHeight)
|
begin
|
||||||
else Drawable := gdk_pixmap_new(nil, ImgWidth, ImgHeight, 1);
|
Drawable := gdk_bitmap_create_from_data(nil, ImgData, ImgWidth, ImgHeight);
|
||||||
|
//gtk2 crashes if we create mask on gdkbitmap.issue #21673
|
||||||
|
ASkipMask := True;
|
||||||
|
end else
|
||||||
|
Drawable := gdk_pixmap_new(nil, ImgWidth, ImgHeight, 1);
|
||||||
|
|
||||||
GdiObject^.GDIBitmapObject := Drawable;
|
GdiObject^.GDIBitmapObject := Drawable;
|
||||||
GdiObject^.GDIBitmapType := gbBitmap;
|
GdiObject^.GDIBitmapType := gbBitmap;
|
||||||
end
|
end else
|
||||||
else begin
|
begin
|
||||||
if (ImgData <> nil) and (ImgDepth = 32)
|
if (ImgData <> nil) and (ImgDepth = 32)
|
||||||
then begin
|
then begin
|
||||||
case Desc.LineEnd of
|
case Desc.LineEnd of
|
||||||
|
Loading…
Reference in New Issue
Block a user