Delegate wxGraphicsBitmap::ConvertToImage to the renderer so we do not end up with more than one definition of the method when building with both the GDI+ GC and the Cairo GC enabled at the same time.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-10-20 04:49:12 +00:00
parent c9b7d15bbb
commit 6e6f074b45
5 changed files with 53 additions and 45 deletions

View File

@@ -1267,7 +1267,7 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitm
// Create a surface object and copy the bitmap pixel data to it. if the
// image has alpha (or a mask represented as alpha) then we'll use a
// different format and iterator than if it doesn't...
const cairo_format_t bufferFormat = bmp.GetDepth() == 32
cairo_format_t bufferFormat = bmp.GetDepth() == 32
#ifdef __WXGTK__
|| bmp.GetMask()
#endif
@@ -1558,22 +1558,6 @@ wxCairoBitmapData::~wxCairoBitmapData()
delete [] m_buffer;
}
// ----------------------------------------------------------------------------
// wxGraphicsBitmap implementation
// ----------------------------------------------------------------------------
#if wxUSE_IMAGE
wxImage wxGraphicsBitmap::ConvertToImage() const
{
const wxCairoBitmapData* const
data = static_cast<wxCairoBitmapData*>(GetGraphicsData());
return data ? data->ConvertToImage() : wxNullImage;
}
#endif // wxUSE_IMAGE
//-----------------------------------------------------------------------------
// wxCairoContext implementation
//-----------------------------------------------------------------------------
@@ -2292,6 +2276,7 @@ public :
virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap );
#if wxUSE_IMAGE
virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image);
virtual wxImage CreateImageFromBitmap(const wxGraphicsBitmap& bmp);
#endif // wxUSE_IMAGE
// create a graphics bitmap from a native bitmap
@@ -2558,8 +2543,19 @@ wxGraphicsBitmap wxCairoRenderer::CreateBitmapFromImage(const wxImage& image)
return bmp;
}
wxImage wxCairoRenderer::CreateImageFromBitmap(const wxGraphicsBitmap& bmp)
{
ENSURE_LOADED_OR_RETURN(wxNullImage);
const wxCairoBitmapData* const
data = static_cast<wxCairoBitmapData*>(bmp.GetGraphicsData());
return data ? data->ConvertToImage() : wxNullImage;
}
#endif // wxUSE_IMAGE
wxGraphicsBitmap wxCairoRenderer::CreateBitmapFromNativeBitmap( void* bitmap )
{
ENSURE_LOADED_OR_RETURN(wxNullGraphicsBitmap);