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
This commit is contained in:
Stefan Csomor
2009-10-24 19:22:40 +00:00
parent eda34276d6
commit 502113941d
3 changed files with 5 additions and 6 deletions

View File

@@ -265,9 +265,7 @@ void wxGCDCImpl::EndPage()
void wxGCDCImpl::Flush() void wxGCDCImpl::Flush()
{ {
#ifdef __WXOSX_OR_COCOA__ m_graphicContext->Flush();
CGContextFlush( (CGContextRef) m_graphicContext->GetNativeContext() );
#endif
} }
void wxGCDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) void wxGCDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h )

View File

@@ -181,6 +181,10 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) :
wxPoint origin = window->GetClientAreaOrigin() ; wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height); m_window->GetClientSize( &m_width , &m_height);
SetDeviceOrigin( origin.x, origin.y ); SetDeviceOrigin( origin.x, origin.y );
#ifdef __WXOSX_IPHONE__
m_graphicContext->ResetClip();
m_clipping = false;
#endif
DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
} }

View File

@@ -2010,9 +2010,6 @@ void wxMacCoreGraphicsContext::SetNativeContext( CGContextRef cg )
CGContextRestoreGState( m_cgContext ); CGContextRestoreGState( m_cgContext );
if ( m_contextSynthesized ) 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 #if wxOSX_USE_CARBON
QDEndCGContext( GetWindowPort( m_windowRef ) , &m_cgContext); QDEndCGContext( GetWindowPort( m_windowRef ) , &m_cgContext);
#endif #endif