X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f884a0dccd6b642f35c441ac9bfc87a6d5b4d35..fe6f7f3c78174df4818c9e4f12c377b9f0cc323c:/src/dfb/bitmap.cpp diff --git a/src/dfb/bitmap.cpp b/src/dfb/bitmap.cpp index 26b3ada098..91684bdad3 100644 --- a/src/dfb/bitmap.cpp +++ b/src/dfb/bitmap.cpp @@ -290,7 +290,6 @@ public: // wxBitmap //----------------------------------------------------------------------------- -IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase) IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxBitmapBase) wxBitmap::wxBitmap(int width, int height, int depth) @@ -325,9 +324,16 @@ bool wxBitmap::CreateWithFormat(int width, int height, int dfbFormat) } #if wxUSE_IMAGE -wxBitmap::wxBitmap(const wxImage& image, int depth) +wxBitmap::wxBitmap(const wxImage& imageOrig, int depth) { - wxCHECK_RET( image.Ok(), wxT("invalid image") ); + wxCHECK_RET( imageOrig.Ok(), wxT("invalid image") ); + + wxImage image(imageOrig); + + // convert mask to alpha channel, because wxMask isn't implemented yet + // FIXME: don't do this, implement proper wxMask support + if ( image.HasMask() ) + image.InitAlpha(); DFBSurfacePixelFormat format = DepthToFormat(depth); if ( format == DSPF_UNKNOWN && image.HasAlpha() ) @@ -362,9 +368,6 @@ wxBitmap::wxBitmap(const wxImage& image, int depth) return; } } - - // FIXME: implement mask creation from image's mask (or alpha channel?) - wxASSERT_MSG( !image.HasMask(), "image masks are ignored for now" ); } wxImage wxBitmap::ConvertToImage() const