From 1abedc328bdf1e5d10fd6f0a385d3d83d77a42ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 14 Nov 2004 23:03:51 +0000 Subject: [PATCH] fixed rendering of bitmaps with alpha channel under GTK+ 2.0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dcclient.cpp | 8 ++++++++ src/gtk1/dcclient.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index d3dd84f7a6..537499b4dd 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1079,6 +1079,14 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, wxBitmap use_bitmap = bitmap; if ((w != ww) || (h != hh)) use_bitmap = use_bitmap.Rescale( 0, 0, ww, hh, ww, hh ); + +#if !GTK_CHECK_VERSION(2,2,0) + // NB: We can't render pixbufs with GTK+ < 2.2, we need to use pixmaps code. + // Pixbufs-based bitmaps with alpha channel don't have a mask, so we + // have to call GetPixmap() here -- it converts the pixbuf into pixmap + // and also creates the mask as a side-effect: + use_bitmap.GetPixmap(); +#endif // apply mask if any GdkBitmap *mask = (GdkBitmap *) NULL; diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index d3dd84f7a6..537499b4dd 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1079,6 +1079,14 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, wxBitmap use_bitmap = bitmap; if ((w != ww) || (h != hh)) use_bitmap = use_bitmap.Rescale( 0, 0, ww, hh, ww, hh ); + +#if !GTK_CHECK_VERSION(2,2,0) + // NB: We can't render pixbufs with GTK+ < 2.2, we need to use pixmaps code. + // Pixbufs-based bitmaps with alpha channel don't have a mask, so we + // have to call GetPixmap() here -- it converts the pixbuf into pixmap + // and also creates the mask as a side-effect: + use_bitmap.GetPixmap(); +#endif // apply mask if any GdkBitmap *mask = (GdkBitmap *) NULL; -- 2.45.2