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
This commit is contained in:
@@ -1080,6 +1080,14 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
if ((w != ww) || (h != hh))
|
if ((w != ww) || (h != hh))
|
||||||
use_bitmap = use_bitmap.Rescale( 0, 0, ww, hh, ww, 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
|
// apply mask if any
|
||||||
GdkBitmap *mask = (GdkBitmap *) NULL;
|
GdkBitmap *mask = (GdkBitmap *) NULL;
|
||||||
if (use_bitmap.GetMask()) mask = use_bitmap.GetMask()->GetBitmap();
|
if (use_bitmap.GetMask()) mask = use_bitmap.GetMask()->GetBitmap();
|
||||||
|
@@ -1080,6 +1080,14 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
if ((w != ww) || (h != hh))
|
if ((w != ww) || (h != hh))
|
||||||
use_bitmap = use_bitmap.Rescale( 0, 0, ww, hh, ww, 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
|
// apply mask if any
|
||||||
GdkBitmap *mask = (GdkBitmap *) NULL;
|
GdkBitmap *mask = (GdkBitmap *) NULL;
|
||||||
if (use_bitmap.GetMask()) mask = use_bitmap.GetMask()->GetBitmap();
|
if (use_bitmap.GetMask()) mask = use_bitmap.GetMask()->GetBitmap();
|
||||||
|
Reference in New Issue
Block a user