Implement Flush() method for Cairo graphics context
wxCairoContext implementation for wxMSW and wxQT use internally helper surface so there is a need to flush it on demand.
This commit is contained in:
@@ -102,6 +102,7 @@ All (GUI):
|
||||
- Fix wxGCDC::Clear() for rotated graphics context.
|
||||
- Fix wxGCDC::GetClippingBox() for transformed wxDC (MSW, GTK+).
|
||||
- Add support for affine transformation matrix in wxGCDC.
|
||||
- Add wxGraphicsContext::Flush() for Cairo renderer.
|
||||
|
||||
wxGTK:
|
||||
|
||||
|
@@ -494,6 +494,7 @@ public:
|
||||
virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) wxOVERRIDE;
|
||||
virtual void PushState() wxOVERRIDE;
|
||||
virtual void PopState() wxOVERRIDE;
|
||||
virtual void Flush() wxOVERRIDE;
|
||||
|
||||
virtual void GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height,
|
||||
wxDouble *descent, wxDouble *externalLeading ) const wxOVERRIDE;
|
||||
@@ -2476,6 +2477,22 @@ void wxCairoContext::PopState()
|
||||
cairo_restore(m_context);
|
||||
}
|
||||
|
||||
void wxCairoContext::Flush()
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
if ( m_mswSurface )
|
||||
{
|
||||
cairo_surface_flush(m_mswSurface);
|
||||
}
|
||||
#endif
|
||||
#ifdef __WXQT__
|
||||
if ( m_qtSurface )
|
||||
{
|
||||
cairo_surface_flush(m_qtSurface);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxCairoContext::DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h )
|
||||
{
|
||||
wxGraphicsBitmap bitmap = GetRenderer()->CreateBitmap(bmp);
|
||||
|
Reference in New Issue
Block a user