From 502113941da16d7949d8dfb8da0d39a0c3761975 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 24 Oct 2009 19:22:40 +0000 Subject: [PATCH] switching to explicit flush mode, otherwise clientdc destruction lead to contention in customrenderers in osx git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dcgraph.cpp | 4 +--- src/osx/carbon/dcclient.cpp | 4 ++++ src/osx/carbon/graphics.cpp | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 94a541d21c..6a63c43f98 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -265,9 +265,7 @@ void wxGCDCImpl::EndPage() void wxGCDCImpl::Flush() { -#ifdef __WXOSX_OR_COCOA__ - CGContextFlush( (CGContextRef) m_graphicContext->GetNativeContext() ); -#endif + m_graphicContext->Flush(); } void wxGCDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 663640741c..0a257909e7 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -181,6 +181,10 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) : wxPoint origin = window->GetClientAreaOrigin() ; m_window->GetClientSize( &m_width , &m_height); SetDeviceOrigin( origin.x, origin.y ); +#ifdef __WXOSX_IPHONE__ + m_graphicContext->ResetClip(); + m_clipping = false; +#endif DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; } diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 1467704afd..ce0a00a507 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -2010,9 +2010,6 @@ void wxMacCoreGraphicsContext::SetNativeContext( CGContextRef cg ) CGContextRestoreGState( m_cgContext ); if ( m_contextSynthesized ) { - // TODO: in case of performance problems, try issuing this not too - // frequently (half of refresh rate) - CGContextFlush(m_cgContext); #if wxOSX_USE_CARBON QDEndCGContext( GetWindowPort( m_windowRef ) , &m_cgContext); #endif