X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5eb5a0ac961d438f6d9f8bd4bd501ed041f73003..a96b4743ff1eb85279194a28f7c388dc5fcab648:/src/cocoa/dc.mm diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index cf80a9700e..c40f86acae 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -9,8 +9,11 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#include "wx/dc.h" -#include "wx/log.h" +#include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/dc.h" +#endif //WX_PRECOMP #include "wx/cocoa/autorelease.h" @@ -478,12 +481,11 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) [transform concat]; [flipTransform concat]; - NSImage *nsimage = [[NSImage alloc] - initWithSize:NSMakeSize(bmp.GetWidth(), bmp.GetHeight())]; - [nsimage addRepresentation: const_cast(bmp).GetNSBitmapImageRep()]; + NSImage *nsimage = [bmp.GetNSImage(useMask) retain]; + [nsimage drawAtPoint: NSMakePoint(0,0) fromRect: NSMakeRect(0.0,0.0,bmp.GetWidth(),bmp.GetHeight()) - operation: NSCompositeCopy + operation: NSCompositeSourceOver fraction: 1.0]; [nsimage release];