From 806dd7d8ecc9a5114dec235bcc559e0fda514781 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 15 May 2013 09:17:42 +0200 Subject: [PATCH] Items are not recached until GAL is changed (earlier it was done on every rendering backend switch). --- common/drawpanel_gal.cpp | 5 +++++ include/class_drawpanel_gal.h | 1 + 2 files changed, 6 insertions(+) diff --git a/common/drawpanel_gal.cpp b/common/drawpanel_gal.cpp index 4f97c941d5..7e8cf7acf6 100644 --- a/common/drawpanel_gal.cpp +++ b/common/drawpanel_gal.cpp @@ -134,6 +134,9 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool eraseBackground, const wxRect* rect ) void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType, bool aUseShaders ) { + if( aGalType == m_currentGal && m_gal != NULL ) + return; + if( m_gal ) delete m_gal; @@ -164,4 +167,6 @@ void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType, bool aUseShaders ) wxSize size = GetClientSize(); m_gal->ResizeScreen( size.GetX(), size.GetY() ); + + m_currentGal = aGalType; } diff --git a/include/class_drawpanel_gal.h b/include/class_drawpanel_gal.h index 6629908a3a..6587f91044 100644 --- a/include/class_drawpanel_gal.h +++ b/include/class_drawpanel_gal.h @@ -87,6 +87,7 @@ protected: KiGfx::PAINTER* m_painter; ///< Contains information about how to draw items ///< using GAL KiGfx::WX_VIEW_CONTROLS* m_viewControls; ///< Control for VIEW (moving, zooming, etc.) + GalType m_currentGal; ///< Currently used GAL std::string m_galShaderPath; ///< Path to shader files, used in OpenGL mode };