From cd7d36c065d638f48cff0845a43e35b9ed1e25f6 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 20 Oct 2006 10:56:36 +0000 Subject: [PATCH] replacing old core graphics with new graphics context implementation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/private.h | 2 +- include/wx/mac/setup0.h | 2 +- src/common/dcbase.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h index 2f6b0bd510..50cdec1bec 100644 --- a/include/wx/mac/carbon/private.h +++ b/include/wx/mac/carbon/private.h @@ -1080,7 +1080,7 @@ public: // graphics implementation // ============================================================================ -#if wxMAC_USE_CORE_GRAPHICS +#if wxMAC_USE_CORE_GRAPHICS && !wxUSE_GRAPHICS_CONTEXT class WXDLLEXPORT wxMacCGPath : public wxGraphicPath { diff --git a/include/wx/mac/setup0.h b/include/wx/mac/setup0.h index 9e2c824b85..14ba6c8136 100644 --- a/include/wx/mac/setup0.h +++ b/include/wx/mac/setup0.h @@ -561,7 +561,7 @@ // // Recommended setting: 1 #ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 +#define wxUSE_GRAPHICS_CONTEXT 1 #endif // ---------------------------------------------------------------------------- diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 84ac42aa3c..9fcea2c858 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -1270,6 +1270,9 @@ void wxOverlayImpl::Init( wxWindowDC* dc, int x , int y , int width , int height void wxOverlayImpl::BeginDrawing( wxWindowDC* dc) { +// TODO CS + dc->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) ); +/* delete dc->m_graphicContext ; dc->m_graphicContext = new wxMacCGContext( m_overlayContext ); // we are right now startin at 0,0 not at the wxWindow's origin, so most of the calculations @@ -1277,15 +1280,14 @@ void wxOverlayImpl::BeginDrawing( wxWindowDC* dc) // just to make sure : dc->m_macLocalOrigin.x = 0 ; dc->m_macLocalOrigin.y = 0 ; + */ wxSize size = m_window->GetSize() ; dc->SetClippingRegion( 0 , 0 , size.x , size.y ) ; } void wxOverlayImpl::EndDrawing( wxWindowDC* dc) { - delete dc->m_graphicContext ; - dc->m_graphicContext = NULL ; - + dc->SetGraphicsContext(NULL); } void wxOverlayImpl::Clear(wxWindowDC* dc) -- 2.45.2