X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07edda049fbe3b6ae08daff5ce864543f155bab0..2bc4cc1ead29f6de1f0576a416025edadb13d7cc:/src/osx/carbon/renderer.cpp diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index 0f04a383a9..26aa6d6baf 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -39,12 +39,9 @@ #endif // wxHAS_DRAW_TITLE_BAR_BITMAP -// check if we're currently in a paint event -inline bool wxInPaintEvent(wxWindow* win, wxDC& dc) +// check if we're having a CGContext we can draw into +inline bool wxHasCGContext(wxWindow* win, wxDC& dc) { - if ( win->MacGetCGContextRef() != NULL ) - return true; - wxGCDCImpl* gcdc = wxDynamicCast( dc.GetImpl() , wxGCDCImpl); if ( gcdc ) @@ -52,11 +49,6 @@ inline bool wxInPaintEvent(wxWindow* win, wxDC& dc) if ( gcdc->GetGraphicsContext()->GetNativeContext() ) return true; } - /* - return win->MacGetCGContextRef() != NULL || - // wxMemoryDC's also have a valid CGContext. - dc.IsKindOf( CLASSINFO(wxMemoryDC) ); - */ return false; } @@ -171,7 +163,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win, dc.SetBrush( *wxTRANSPARENT_BRUSH ); HIRect headerRect = CGRectMake( x, y, w, h ); - if ( !wxInPaintEvent(win, dc) ) + if ( !wxHasCGContext(win, dc) ) { win->Refresh( &rect ); } @@ -260,7 +252,7 @@ void wxRendererMac::DrawTreeItemButton( wxWindow *win, dc.SetBrush( *wxTRANSPARENT_BRUSH ); HIRect headerRect = CGRectMake( x, y, w, h ); - if ( !wxInPaintEvent(win, dc) ) + if ( !wxHasCGContext(win, dc) ) { win->Refresh( &rect ); } @@ -306,7 +298,7 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win, // under compositing we should only draw when called by the OS, otherwise just issue a redraw command // strange redraw errors occur if we don't do this - if ( !wxInPaintEvent(win, dc) ) + if ( !wxHasCGContext(win, dc) ) { wxRect rect( (int) splitterRect.origin.x, (int) splitterRect.origin.y, (int) splitterRect.size.width, (int) splitterRect.size.height ); @@ -376,7 +368,7 @@ wxRendererMac::DrawMacThemeButton(wxWindow *win, dc.SetBrush( *wxTRANSPARENT_BRUSH ); HIRect headerRect = CGRectMake( x, y, w, h ); - if ( !wxInPaintEvent(win, dc) ) + if ( !wxHasCGContext(win, dc) ) { win->Refresh( &rect ); } @@ -584,7 +576,7 @@ void wxRendererMac::DrawTextCtrl(wxWindow* win, wxDC& dc, dc.SetBrush( *wxTRANSPARENT_BRUSH ); HIRect hiRect = CGRectMake( x, y, w, h ); - if ( !wxInPaintEvent(win, dc) ) + if ( !wxHasCGContext(win, dc) ) { win->Refresh( &rect ); }