X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b230a33c5df127591d6877a63d85038d869387e..30767dfe33da2b5b5cea6f3eaa88d5509c40c08b:/src/gtk/bitmap.cpp diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index ede32fc443..1be0bb94a4 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -228,7 +228,7 @@ wxBitmapRefData::~wxBitmapRefData() //----------------------------------------------------------------------------- -#define M_BMPDATA wx_static_cast(wxBitmapRefData*, m_refData) +#define M_BMPDATA static_cast(m_refData) IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject) @@ -258,7 +258,7 @@ wxBitmap::wxBitmap(const char* const* bits) wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data")); GdkBitmap* mask = NULL; - SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, wx_const_cast(char**, bits))); + SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, const_cast(bits))); if (M_BMPDATA->m_pixmap != NULL && mask != NULL) { @@ -285,6 +285,9 @@ bool wxBitmap::Create( int width, int height, int depth ) if (depth == 32) { SetPixbuf(gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, width, height), 32); + // must initialize alpha, otherwise GetPixmap() + // will create a mask out of garbage + gdk_pixbuf_fill(M_BMPDATA->m_pixbuf, 0x000000ff); } else if (depth == 24) { @@ -930,7 +933,7 @@ wxGDIRefData* wxBitmap::CreateGDIRefData() const wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const { - const wxBitmapRefData* oldRef = wx_static_cast(const wxBitmapRefData*, data); + const wxBitmapRefData* oldRef = static_cast(data); wxBitmapRefData* newRef = new wxBitmapRefData; newRef->m_width = oldRef->m_width; newRef->m_height = oldRef->m_height;