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

@@ -541,6 +541,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
virtual wxGraphicsFont CreateFont( const wxFont& font,
@@ -1078,22 +1079,6 @@ wxGDIPlusBitmapData::~wxGDIPlusBitmapData()
delete m_helper;
}
// ----------------------------------------------------------------------------
// wxGraphicsBitmap implementation
// ----------------------------------------------------------------------------
#if wxUSE_IMAGE
wxImage wxGraphicsBitmap::ConvertToImage() const
{
const wxGDIPlusBitmapData* const
data = static_cast<wxGDIPlusBitmapData*>(GetGraphicsData());
return data ? data->ConvertToImage() : wxNullImage;
}
#endif // wxUSE_IMAGE
//-----------------------------------------------------------------------------
// wxGDIPlusPath implementation
//-----------------------------------------------------------------------------
@@ -2194,8 +2179,19 @@ wxGraphicsBitmap wxGDIPlusRenderer::CreateBitmapFromImage(const wxImage& image)
return wxNullGraphicsBitmap;
}
wxImage wxGDIPlusRenderer::CreateImageFromBitmap(const wxGraphicsBitmap& bmp)
{
ENSURE_LOADED_OR_RETURN(wxNullImage);
const wxGDIPlusBitmapData* const
data = static_cast<wxGDIPlusBitmapData*>(bmp.GetGraphicsData());
return data ? data->ConvertToImage() : wxNullImage;
}
#endif // wxUSE_IMAGE
wxGraphicsBitmap wxGDIPlusRenderer::CreateBitmapFromNativeBitmap( void *bitmap )
{
ENSURE_LOADED_OR_RETURN(wxNullGraphicsBitmap);