Enable access to the native bitmap object wrapped by wxGraphicsBitmap

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-05-11 22:06:50 +00:00
parent caf1a3aa68
commit 8b180bded6
7 changed files with 46 additions and 10 deletions

View File

@@ -969,13 +969,14 @@ wxMacCoreGraphicsFontData::~wxMacCoreGraphicsFontData()
#endif
}
class wxMacCoreGraphicsBitmapData : public wxGraphicsObjectRefData
class wxMacCoreGraphicsBitmapData : public wxGraphicsBitmapData
{
public:
wxMacCoreGraphicsBitmapData( wxGraphicsRenderer* renderer, CGImageRef bitmap, bool monochrome );
~wxMacCoreGraphicsBitmapData();
virtual CGImageRef GetBitmap() { return m_bitmap; }
void* GetNativeBitmap() const { return (void*)m_bitmap; }
bool IsMonochrome() { return m_monochrome; }
#if wxUSE_IMAGE
@@ -990,7 +991,7 @@ private :
bool m_monochrome;
};
wxMacCoreGraphicsBitmapData::wxMacCoreGraphicsBitmapData( wxGraphicsRenderer* renderer, CGImageRef bitmap, bool monochrome ) : wxGraphicsObjectRefData( renderer ),
wxMacCoreGraphicsBitmapData::wxMacCoreGraphicsBitmapData( wxGraphicsRenderer* renderer, CGImageRef bitmap, bool monochrome ) : wxGraphicsBitmapData( renderer ),
m_bitmap(bitmap), m_monochrome(monochrome)
{
}
@@ -2245,7 +2246,7 @@ void wxMacCoreGraphicsContext::DrawBitmap( const wxGraphicsBitmap &bmp, wxDouble
return;
#ifdef __WXMAC__
wxMacCoreGraphicsBitmapData* refdata =static_cast<wxMacCoreGraphicsBitmapData*>(bmp.GetRefData());
wxMacCoreGraphicsBitmapData* refdata = static_cast<wxMacCoreGraphicsBitmapData*>(bmp.GetRefData());
CGImageRef image = refdata->GetBitmap();
CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h );
if ( refdata->IsMonochrome() == 1 )