use direct NSImage drawing commands
This commit is contained in:
committed by
Vadim Zeitlin
parent
0bdd7e5f48
commit
bca583234e
@@ -2159,8 +2159,15 @@ void wxMacCoreGraphicsContext::Rotate( wxDouble angle )
|
||||
|
||||
void wxMacCoreGraphicsContext::DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h )
|
||||
{
|
||||
#if wxOSX_USE_COCOA
|
||||
{
|
||||
CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h );
|
||||
wxOSXDrawNSImage( m_cgContext, &r, bmp.GetNSImage());
|
||||
}
|
||||
#else
|
||||
wxGraphicsBitmap bitmap = GetRenderer()->CreateBitmap(bmp);
|
||||
DrawBitmap(bitmap, x, y, w, h);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxMacCoreGraphicsContext::DrawBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h )
|
||||
@@ -2218,10 +2225,7 @@ void wxMacCoreGraphicsContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDoubl
|
||||
#if wxOSX_USE_COCOA
|
||||
{
|
||||
CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h );
|
||||
const WX_NSImage nsImage = icon.GetNSImage();
|
||||
|
||||
CGImageRef cgImage = wxOSXGetCGImageFromNSImage( nsImage , &r, m_cgContext );
|
||||
wxMacDrawCGImage( m_cgContext, &r, cgImage);
|
||||
wxOSXDrawNSImage( m_cgContext, &r, icon.GetNSImage());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user