Commit a457dffd authored by Bernhard Stegmaier's avatar Bernhard Stegmaier Committed by Dick Hollenbeck

OSX drawing artifacts

parent f43cf037
......@@ -281,6 +281,15 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
RedrawComponent( DC, wxPoint( 0, 0 ) );
#ifdef USE_WX_OVERLAY
if( IsShown() )
{
m_overlay.Reset();
wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC );
overlaydc.Clear();
}
#endif
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
......
......@@ -112,6 +112,15 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawWorkSheet( DC, screen, 0, IU_PER_MILS, wxEmptyString );
#ifdef USE_WX_OVERLAY
if( IsShown() )
{
m_overlay.Reset();
wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC );
overlaydc.Clear();
}
#endif
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
......
......@@ -534,6 +534,15 @@ void PL_EDITOR_FRAME::RedrawActiveWindow( wxDC* aDC, bool aEraseBg )
DrawWorkSheet( aDC, GetScreen(), 0, IU_PER_MILS, GetCurrFileName() );
#ifdef USE_WX_OVERLAY
if( IsShown() )
{
m_overlay.Reset();
wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)aDC );
overlaydc.Clear();
}
#endif
if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
......
=== modified file 'Makefile.in'
--- Makefile.in 2014-02-05 21:57:29 +0000
+++ Makefile.in 2014-02-05 22:00:01 +0000
--- Makefile.in 2014-06-11 15:08:00 +0000
+++ Makefile.in 2014-06-11 15:10:36 +0000
@@ -14601,7 +14601,7 @@
monodll_carbon_frame.o \
monodll_carbon_mdi.o \
......@@ -92,8 +92,8 @@
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp
=== modified file 'include/wx/overlay.h'
--- include/wx/overlay.h 2014-02-05 21:57:29 +0000
+++ include/wx/overlay.h 2014-02-05 21:57:47 +0000
--- include/wx/overlay.h 2014-06-11 15:08:00 +0000
+++ include/wx/overlay.h 2014-06-11 15:10:36 +0000
@@ -13,7 +13,7 @@
#include "wx/defs.h"
......@@ -105,8 +105,8 @@
#define wxHAS_NATIVE_OVERLAY 1
=== modified file 'include/wx/private/overlay.h'
--- include/wx/private/overlay.h 2014-02-05 21:57:29 +0000
+++ include/wx/private/overlay.h 2014-02-05 21:57:47 +0000
--- include/wx/private/overlay.h 2014-06-11 15:08:00 +0000
+++ include/wx/private/overlay.h 2014-06-11 15:10:36 +0000
@@ -16,7 +16,11 @@
#ifdef wxHAS_NATIVE_OVERLAY
......@@ -121,8 +121,8 @@
#else
=== modified file 'src/osx/cocoa/overlay.mm'
--- src/osx/cocoa/overlay.mm 2014-02-05 21:57:29 +0000
+++ src/osx/cocoa/overlay.mm 2014-02-05 21:57:47 +0000
--- src/osx/cocoa/overlay.mm 2014-06-11 15:08:00 +0000
+++ src/osx/cocoa/overlay.mm 2014-06-11 15:12:45 +0000
@@ -34,6 +34,7 @@
#include "wx/private/overlay.h"
......@@ -180,7 +180,7 @@
}
void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height )
@@ -107,84 +66,50 @@
@@ -107,84 +66,54 @@
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
m_window = dc->GetWindow();
......@@ -222,6 +222,8 @@
+ m_overlayWindow = m_window->MacGetTopLevelWindowRef();
+
+ NSRect box = [m_overlayWindow frame];
+ box.origin.x = 0;
+ box.origin.y = 0;
+
+ if( [m_overlayWindow isVisible] )
+ {
......@@ -280,6 +282,8 @@
- [m_overlayWindow release];
- m_overlayWindow = NULL ;
+ NSRect box = [m_overlayWindow frame];
+ box.origin.x = 0;
+ box.origin.y = 0;
+
+ [m_overlayWindow discardCachedImage];
+ [m_overlayWindow cacheImageInRect:box];
......
=== modified file 'Makefile.in'
--- Makefile.in 2014-01-26 11:10:36 +0000
+++ Makefile.in 2014-01-26 11:15:53 +0000
@@ -14601,7 +14601,7 @@
--- Makefile.in 2014-06-08 14:30:42 +0000
+++ Makefile.in 2014-06-08 14:30:57 +0000
@@ -14619,7 +14619,7 @@
monodll_carbon_frame.o \
monodll_carbon_mdi.o \
monodll_carbon_metafile.o \
......@@ -10,7 +10,7 @@
monodll_carbon_popupwin.o \
monodll_carbon_renderer.o \
monodll_carbon_settings.o \
@@ -14748,7 +14748,7 @@
@@ -14766,7 +14766,7 @@
monolib_carbon_frame.o \
monolib_carbon_mdi.o \
monolib_carbon_metafile.o \
......@@ -19,7 +19,7 @@
monolib_carbon_popupwin.o \
monolib_carbon_renderer.o \
monolib_carbon_settings.o \
@@ -14895,7 +14895,7 @@
@@ -14913,7 +14913,7 @@
coredll_carbon_frame.o \
coredll_carbon_mdi.o \
coredll_carbon_metafile.o \
......@@ -28,7 +28,7 @@
coredll_carbon_popupwin.o \
coredll_carbon_renderer.o \
coredll_carbon_settings.o \
@@ -15027,7 +15027,7 @@
@@ -15045,7 +15045,7 @@
corelib_carbon_frame.o \
corelib_carbon_mdi.o \
corelib_carbon_metafile.o \
......@@ -37,7 +37,7 @@
corelib_carbon_popupwin.o \
corelib_carbon_renderer.o \
corelib_carbon_settings.o \
@@ -17774,6 +17774,9 @@
@@ -17792,6 +17792,9 @@
monodll_osx_cocoa_notebook.o: $(srcdir)/src/osx/cocoa/notebook.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/notebook.mm
......@@ -47,7 +47,7 @@
monodll_osx_cocoa_radiobut.o: $(srcdir)/src/osx/cocoa/radiobut.mm $(MONODLL_ODEP)
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/radiobut.mm
@@ -23642,6 +23645,9 @@
@@ -23666,6 +23669,9 @@
monolib_osx_cocoa_notebook.o: $(srcdir)/src/osx/cocoa/notebook.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/notebook.mm
......@@ -57,7 +57,7 @@
monolib_osx_cocoa_radiobut.o: $(srcdir)/src/osx/cocoa/radiobut.mm $(MONOLIB_ODEP)
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/radiobut.mm
@@ -33584,8 +33590,8 @@
@@ -33620,8 +33626,8 @@
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@coredll_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp
......@@ -68,7 +68,7 @@
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(COREDLL_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp
@@ -37961,8 +37967,8 @@
@@ -38003,8 +38009,8 @@
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@corelib_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp
......@@ -80,9 +80,29 @@
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(CORELIB_ODEP)
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp
=== modified file 'include/wx/osx/cocoa/private/overlay.h'
--- include/wx/osx/cocoa/private/overlay.h 2014-06-08 14:30:42 +0000
+++ include/wx/osx/cocoa/private/overlay.h 2014-06-11 12:07:05 +0000
@@ -41,15 +41,8 @@
void CreateOverlayWindow();
WXWindow m_overlayWindow;
- WXWindow m_overlayParentWindow;
- CGContextRef m_overlayContext ;
// we store the window in case we would have to issue a Refresh()
wxWindow* m_window ;
-
- int m_x ;
- int m_y ;
- int m_width ;
- int m_height ;
} ;
#endif // _WX_MAC_CARBON_PRIVATE_OVERLAY_H_
=== modified file 'include/wx/overlay.h'
--- include/wx/overlay.h 2014-01-26 11:10:36 +0000
+++ include/wx/overlay.h 2014-01-26 11:10:44 +0000
--- include/wx/overlay.h 2014-06-08 14:30:42 +0000
+++ include/wx/overlay.h 2014-06-08 14:30:57 +0000
@@ -13,7 +13,7 @@
#include "wx/defs.h"
......@@ -94,8 +114,8 @@
#define wxHAS_NATIVE_OVERLAY 1
=== modified file 'include/wx/private/overlay.h'
--- include/wx/private/overlay.h 2014-01-26 11:10:36 +0000
+++ include/wx/private/overlay.h 2014-01-26 11:10:44 +0000
--- include/wx/private/overlay.h 2014-06-08 14:30:42 +0000
+++ include/wx/private/overlay.h 2014-06-08 14:30:57 +0000
@@ -16,7 +16,11 @@
#ifdef wxHAS_NATIVE_OVERLAY
......@@ -110,8 +130,8 @@
#else
=== modified file 'src/osx/cocoa/overlay.mm'
--- src/osx/cocoa/overlay.mm 2014-01-26 11:10:36 +0000
+++ src/osx/cocoa/overlay.mm 2014-01-26 11:10:44 +0000
--- src/osx/cocoa/overlay.mm 2014-06-08 14:30:42 +0000
+++ src/osx/cocoa/overlay.mm 2014-06-11 12:06:53 +0000
@@ -34,6 +34,7 @@
#include "wx/private/overlay.h"
......@@ -120,7 +140,15 @@
// ============================================================================
// implementation
@@ -58,48 +59,6 @@
@@ -42,7 +43,6 @@
wxOverlayImpl::wxOverlayImpl()
{
m_window = NULL ;
- m_overlayContext = NULL ;
m_overlayWindow = NULL ;
}
@@ -58,48 +58,6 @@
void wxOverlayImpl::CreateOverlayWindow()
{
......@@ -169,7 +197,7 @@
}
void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height )
@@ -107,84 +66,50 @@
@@ -107,84 +65,49 @@
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
m_window = dc->GetWindow();
......@@ -211,6 +239,8 @@
+ m_overlayWindow = m_window->MacGetTopLevelWindowRef();
+
+ NSRect box = [m_overlayWindow frame];
+ box.origin.x = 0;
+ box.origin.y = 0;
+
+ if( [m_overlayWindow isVisible] )
+ {
......@@ -228,7 +258,6 @@
- win_impl->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
- dc->SetClippingRegion( m_x , m_y , m_width , m_height ) ;
- }
+
}
void wxOverlayImpl::EndDrawing( wxDC* dc)
......@@ -241,11 +270,13 @@
- CGContextFlush( m_overlayContext );
}
void wxOverlayImpl::Clear(wxDC* WXUNUSED(dc))
-void wxOverlayImpl::Clear(wxDC* WXUNUSED(dc))
+void wxOverlayImpl::Clear( wxDC* WXUNUSED(dc) )
{
wxASSERT_MSG( IsOk() , _("You cannot Clear an overlay that is not inited") );
- CGRect box = CGRectMake( m_x - 1, m_y - 1 , m_width + 2 , m_height + 2 );
- CGContextClearRect( m_overlayContext, box );
+
+ if( [m_overlayWindow isVisible] )
+ {
+ [m_overlayWindow restoreCachedImage];
......@@ -256,11 +287,10 @@
void wxOverlayImpl::Reset()
{
- if ( m_overlayContext )
+ if ( m_overlayContext)
{
m_overlayContext = NULL ;
}
- {
- m_overlayContext = NULL ;
- }
-
// todo : don't dispose, only hide and reposition on next run
- if (m_overlayWindow)
+ if (m_overlayWindow && [m_overlayWindow isVisible])
......@@ -269,6 +299,8 @@
- [m_overlayWindow release];
- m_overlayWindow = NULL ;
+ NSRect box = [m_overlayWindow frame];
+ box.origin.x = 0;
+ box.origin.y = 0;
+
+ [m_overlayWindow discardCachedImage];
+ [m_overlayWindow cacheImageInRect:box];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment