X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..71a09c3579dd5cb4cd8fa7fdc143561cbff74e12:/src/osx/core/dcmemory.cpp diff --git a/src/osx/core/dcmemory.cpp b/src/osx/core/dcmemory.cpp index 1debcb3c0e..a7a47d6213 100644 --- a/src/osx/core/dcmemory.cpp +++ b/src/osx/core/dcmemory.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 01/02/97 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -55,31 +54,30 @@ void wxMemoryDCImpl::Init() wxMemoryDCImpl::~wxMemoryDCImpl() { - if ( m_selected.Ok() ) + if ( m_selected.IsOk() ) { m_selected.EndRawAccess() ; - delete m_graphicContext ; - m_graphicContext = NULL ; + wxDELETE(m_graphicContext); } } void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { - if ( m_selected.Ok() ) + if ( m_selected.IsOk() ) { m_selected.EndRawAccess() ; - delete m_graphicContext ; - m_graphicContext = NULL ; + wxDELETE(m_graphicContext); } m_selected = bitmap; - if (m_selected.Ok()) + if (m_selected.IsOk()) { if ( m_selected.GetDepth() != 1 ) m_selected.UseAlpha() ; m_selected.BeginRawAccess() ; - m_width = bitmap.GetWidth(); - m_height = bitmap.GetHeight(); + m_width = bitmap.GetScaledWidth(); + m_height = bitmap.GetScaledHeight(); + m_contentScaleFactor = bitmap.GetScaleFactor(); CGColorSpaceRef genericColorSpace = wxMacGetGenericRGBColorSpace(); CGContextRef bmCtx = (CGContextRef) m_selected.GetHBITMAP(); @@ -99,12 +97,12 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (width) - (*width) = m_selected.GetWidth(); + (*width) = m_selected.GetScaledWidth(); if (height) - (*height) = m_selected.GetHeight(); + (*height) = m_selected.GetScaledHeight(); } else {