fix for preserving the clip rgn (control redraws missing after switch to faster redraw, in the end we probably best reset the clip region after a wxDC has been destroyed for a grafport
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -81,15 +81,21 @@ public :
|
|||||||
wxASSERT( dc->Ok() ) ;
|
wxASSERT( dc->Ok() ) ;
|
||||||
GetPort( &m_oldPort ) ;
|
GetPort( &m_oldPort ) ;
|
||||||
SetPort( (GrafPtr) dc->m_macPort ) ;
|
SetPort( (GrafPtr) dc->m_macPort ) ;
|
||||||
|
m_clipRgn = NewRgn() ;
|
||||||
|
GetClip( m_clipRgn ) ;
|
||||||
m_dc = dc ;
|
m_dc = dc ;
|
||||||
dc->MacSetupPort( NULL ) ;
|
dc->MacSetupPort( NULL ) ;
|
||||||
}
|
}
|
||||||
~wxMacFastPortSetter()
|
~wxMacFastPortSetter()
|
||||||
{
|
{
|
||||||
|
SetPort( (GrafPtr) m_dc->m_macPort ) ;
|
||||||
|
SetClip( m_clipRgn ) ;
|
||||||
SetPort( m_oldPort ) ;
|
SetPort( m_oldPort ) ;
|
||||||
m_dc->MacCleanupPort( NULL ) ;
|
m_dc->MacCleanupPort( NULL ) ;
|
||||||
|
DisposeRgn( m_clipRgn ) ;
|
||||||
}
|
}
|
||||||
private :
|
private :
|
||||||
|
RgnHandle m_clipRgn ;
|
||||||
GrafPtr m_oldPort ;
|
GrafPtr m_oldPort ;
|
||||||
const wxDC* m_dc ;
|
const wxDC* m_dc ;
|
||||||
} ;
|
} ;
|
||||||
@@ -98,6 +104,30 @@ private :
|
|||||||
typedef wxMacPortSetter wxMacFastPortSetter ;
|
typedef wxMacPortSetter wxMacFastPortSetter ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
// start moving to a dual implementation for QD and CGContextRef
|
||||||
|
|
||||||
|
class wxMacGraphicsContext
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
void DrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) = 0 ;
|
||||||
|
void SetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) = 0 ;
|
||||||
|
void SetClippingRegion( const wxRegion ®ion ) = 0 ;
|
||||||
|
void DestroyClippingRegion() = 0 ;
|
||||||
|
void SetTextForeground( const wxColour &col ) = 0 ;
|
||||||
|
void SetTextBackground( const wxColour &col ) = 0 ;
|
||||||
|
void SetLogicalScale( double x , double y ) = 0 ;
|
||||||
|
void SetUserScale( double x , double y ) = 0;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
class wxMacQuickDrawContext : public wxMacGraphicsContext
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
} ;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
||||||
{
|
{
|
||||||
m_formerClip = NewRgn() ;
|
m_formerClip = NewRgn() ;
|
||||||
|
@@ -81,15 +81,21 @@ public :
|
|||||||
wxASSERT( dc->Ok() ) ;
|
wxASSERT( dc->Ok() ) ;
|
||||||
GetPort( &m_oldPort ) ;
|
GetPort( &m_oldPort ) ;
|
||||||
SetPort( (GrafPtr) dc->m_macPort ) ;
|
SetPort( (GrafPtr) dc->m_macPort ) ;
|
||||||
|
m_clipRgn = NewRgn() ;
|
||||||
|
GetClip( m_clipRgn ) ;
|
||||||
m_dc = dc ;
|
m_dc = dc ;
|
||||||
dc->MacSetupPort( NULL ) ;
|
dc->MacSetupPort( NULL ) ;
|
||||||
}
|
}
|
||||||
~wxMacFastPortSetter()
|
~wxMacFastPortSetter()
|
||||||
{
|
{
|
||||||
|
SetPort( (GrafPtr) m_dc->m_macPort ) ;
|
||||||
|
SetClip( m_clipRgn ) ;
|
||||||
SetPort( m_oldPort ) ;
|
SetPort( m_oldPort ) ;
|
||||||
m_dc->MacCleanupPort( NULL ) ;
|
m_dc->MacCleanupPort( NULL ) ;
|
||||||
|
DisposeRgn( m_clipRgn ) ;
|
||||||
}
|
}
|
||||||
private :
|
private :
|
||||||
|
RgnHandle m_clipRgn ;
|
||||||
GrafPtr m_oldPort ;
|
GrafPtr m_oldPort ;
|
||||||
const wxDC* m_dc ;
|
const wxDC* m_dc ;
|
||||||
} ;
|
} ;
|
||||||
@@ -98,6 +104,30 @@ private :
|
|||||||
typedef wxMacPortSetter wxMacFastPortSetter ;
|
typedef wxMacPortSetter wxMacFastPortSetter ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
// start moving to a dual implementation for QD and CGContextRef
|
||||||
|
|
||||||
|
class wxMacGraphicsContext
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
void DrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) = 0 ;
|
||||||
|
void SetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) = 0 ;
|
||||||
|
void SetClippingRegion( const wxRegion ®ion ) = 0 ;
|
||||||
|
void DestroyClippingRegion() = 0 ;
|
||||||
|
void SetTextForeground( const wxColour &col ) = 0 ;
|
||||||
|
void SetTextBackground( const wxColour &col ) = 0 ;
|
||||||
|
void SetLogicalScale( double x , double y ) = 0 ;
|
||||||
|
void SetUserScale( double x , double y ) = 0;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
class wxMacQuickDrawContext : public wxMacGraphicsContext
|
||||||
|
{
|
||||||
|
public :
|
||||||
|
} ;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
||||||
{
|
{
|
||||||
m_formerClip = NewRgn() ;
|
m_formerClip = NewRgn() ;
|
||||||
|
Reference in New Issue
Block a user