X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3d7f7703ee16c35dca819794bec8bd730848cd0..84f6927eca931441abec9b6d21c0e412841eaab9:/src/cocoa/dcmemory.mm?ds=sidebyside diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 10b01be3b3..dc526fba9c 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -9,8 +9,11 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/dcmemory.h" -#include "wx/log.h" +#include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/dcmemory.h" +#endif //WX_PRECOMP #import #import @@ -86,14 +89,13 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) m_selectedBitmap.GetHeight())]; // Now copy the data - NSImage *nsimage = [[NSImage alloc] - initWithSize:NSMakeSize(m_selectedBitmap.GetWidth(), - m_selectedBitmap.GetHeight())]; - [nsimage addRepresentation: const_cast(m_selectedBitmap).GetNSBitmapImageRep()]; + NSImage *nsimage = [m_selectedBitmap.GetNSImage(false) retain]; + [m_cocoaNSImage lockFocus]; [nsimage drawAtPoint: NSMakePoint(0,0) fromRect: NSMakeRect(0.0,0.0,m_selectedBitmap.GetWidth(),m_selectedBitmap.GetHeight()) operation: NSCompositeCopy fraction: 1.0]; + [m_cocoaNSImage unlockFocus]; [nsimage release]; } @@ -133,7 +135,7 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, [transform concat]; [flipTransform concat]; - wxLogDebug("[m_cocoaNSImage isFlipped]=%d", [m_cocoaNSImage isFlipped]); + wxLogTrace(wxTRACE_COCOA,wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]); [m_cocoaNSImage drawAtPoint: NSMakePoint(0,0) fromRect: NSMakeRect(xsrc, m_selectedBitmap.GetHeight()-height-ysrc,