X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..9611b7975f7c5cd86f0be0d6adcc67f7ddd98c72:/src/osx/carbon/dcclient.cpp diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 2a7404bd44..9c165badcb 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -96,6 +96,7 @@ void wxWindowDCImpl::DoGetSize( int* width, int* height ) const *height = m_height; } +#if wxOSX_USE_CARBON wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const { // wxScreenDC is derived from wxWindowDC, so a screen dc will @@ -103,7 +104,6 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const if (!m_window) return wxNullBitmap; -#if wxOSX_USE_CARBON ControlRef handle = (ControlRef) m_window->GetHandle(); if ( !handle ) return wxNullBitmap; @@ -111,9 +111,6 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const HIRect rect; CGImageRef image; CGContextRef context; - void* data; - - size_t bytesPerRow; HIViewCreateOffscreenImage( handle, 0, &rect, &image); @@ -136,10 +133,8 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const CGContextRestoreGState(context); return bmp; -#else - return wxNullBitmap; -#endif } +#endif /* * wxClientDCImpl @@ -182,6 +177,7 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) : wxWindowDCImpl( owner, window ) { + wxASSERT_MSG( window->MacGetCGContextRef() != NULL, _T("using wxPaintDC without being in a native paint event") ); wxPoint origin = window->GetClientAreaOrigin() ; m_window->GetClientSize( &m_width , &m_height); SetDeviceOrigin( origin.x, origin.y );