From 66f37beff7343b902b17bb0962c4d033c1a3b330 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 27 Jul 2025 20:22:59 -0700 Subject: [PATCH] Move canvas selection to common Makes all canvases obey the same rendering parameter. Also keeps the canvas selection with the anti-alias selection, which makes logical sense. Reduce the antialias selection to a single choice rather than two different choices for different canvases --- common/dialogs/panel_common_settings.cpp | 17 +- common/dialogs/panel_common_settings_base.cpp | 46 ++- common/dialogs/panel_common_settings_base.fbp | 364 +++++++++--------- common/dialogs/panel_common_settings_base.h | 10 +- common/eda_draw_frame.cpp | 6 +- common/gal/cairo/cairo_compositor.cpp | 6 +- common/gal/cairo/cairo_gal.cpp | 6 +- common/gal/gal_display_options.cpp | 3 +- common/gal/opengl/opengl_compositor.cpp | 14 +- common/gal/opengl/opengl_gal.cpp | 6 +- common/gal_display_options_common.cpp | 7 +- common/settings/app_settings.cpp | 9 - common/settings/common_settings.cpp | 9 +- common/widgets/gal_options_panel.cpp | 15 - common/widgets/gal_options_panel_base.cpp | 32 +- common/widgets/gal_options_panel_base.fbp | 280 -------------- common/widgets/gal_options_panel_base.h | 7 +- .../dialogs/panel_eeschema_color_settings.cpp | 2 +- eeschema/printing/sch_printout.cpp | 2 +- eeschema/widgets/panel_symbol_chooser.cpp | 4 +- include/eda_draw_frame.h | 2 +- include/gal/cairo/cairo_compositor.h | 10 +- include/gal/gal_display_options.h | 19 +- include/gal/opengl/opengl_compositor.h | 6 +- include/settings/app_settings.h | 1 - include/settings/common_settings.h | 4 +- pcbnew/footprint_edit_frame.cpp | 4 +- pcbnew/footprint_preview_panel.cpp | 6 +- qa/qa_utils/pcb_test_frame.cpp | 2 +- 29 files changed, 291 insertions(+), 608 deletions(-) diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index 8ad180f248..9ad166e287 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -168,8 +169,12 @@ bool PANEL_COMMON_SETTINGS::TransferDataFromWindow() commonSettings->m_System.file_history_size = m_fileHistorySize->GetValue(); commonSettings->m_System.clear_3d_cache_interval = m_Clear3DCacheFilesOlder->GetValue(); - commonSettings->m_Graphics.opengl_aa_mode = m_antialiasing->GetSelection(); - commonSettings->m_Graphics.cairo_aa_mode = m_antialiasingFallback->GetSelection(); + commonSettings->m_Graphics.aa_mode = m_antialiasing->GetSelection(); + + if( m_rbAccelerated->GetValue() ) + commonSettings->m_Graphics.canvas_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; + else + commonSettings->m_Graphics.canvas_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; if( m_canvasScaleCtrl ) { @@ -255,8 +260,12 @@ void PANEL_COMMON_SETTINGS::applySettingsToPanel( COMMON_SETTINGS& aSettings ) m_fileHistorySize->SetValue( aSettings.m_System.file_history_size ); - m_antialiasing->SetSelection( aSettings.m_Graphics.opengl_aa_mode ); - m_antialiasingFallback->SetSelection( aSettings.m_Graphics.cairo_aa_mode ); + m_antialiasing->SetSelection( aSettings.m_Graphics.aa_mode ); + + if( aSettings.m_Graphics.canvas_type == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) + m_rbAccelerated->SetValue( true ); + else + m_rbFallback->SetValue( true ); m_Clear3DCacheFilesOlder->SetValue( aSettings.m_System.clear_3d_cache_interval ); diff --git a/common/dialogs/panel_common_settings_base.cpp b/common/dialogs/panel_common_settings_base.cpp index 5119882cf3..f14f977153 100644 --- a/common/dialogs/panel_common_settings_base.cpp +++ b/common/dialogs/panel_common_settings_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -19,47 +19,55 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind wxBoxSizer* bLeftSizer; bLeftSizer = new wxBoxSizer( wxVERTICAL ); - m_staticText20 = new wxStaticText( this, wxID_ANY, _("Antialiasing"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20 = new wxStaticText( this, wxID_ANY, _("Rendering Engine"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText20->Wrap( -1 ); bLeftSizer->Add( m_staticText20, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); - wxBoxSizer* bAntialiasingSizer; - bAntialiasingSizer = new wxBoxSizer( wxVERTICAL ); - wxGridBagSizer* gbSizer11; - gbSizer11 = new wxGridBagSizer( 6, 4 ); + gbSizer11 = new wxGridBagSizer( 2, 4 ); gbSizer11->SetFlexibleDirection( wxBOTH ); gbSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); gbSizer11->SetEmptyCellSize( wxSize( -1,2 ) ); wxStaticText* antialiasingLabel; - antialiasingLabel = new wxStaticText( this, wxID_ANY, _("Accelerated graphics:"), wxDefaultPosition, wxDefaultSize, 0 ); + antialiasingLabel = new wxStaticText( this, wxID_ANY, _("Antialiasing:"), wxDefaultPosition, wxDefaultSize, 0 ); antialiasingLabel->Wrap( -1 ); - gbSizer11->Add( antialiasingLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + gbSizer11->Add( antialiasingLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); wxString m_antialiasingChoices[] = { _("No Antialiasing"), _("Fast Antialiasing"), _("High Quality Antialiasing") }; int m_antialiasingNChoices = sizeof( m_antialiasingChoices ) / sizeof( wxString ); m_antialiasing = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_antialiasingNChoices, m_antialiasingChoices, 0 ); m_antialiasing->SetSelection( 0 ); - gbSizer11->Add( m_antialiasing, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + gbSizer11->Add( m_antialiasing, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); - m_antialiasingFallbackLabel = new wxStaticText( this, wxID_ANY, _("Fallback graphics:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_antialiasingFallbackLabel->Wrap( -1 ); - gbSizer11->Add( m_antialiasingFallbackLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + wxFlexGridSizer* fgSizer1; + fgSizer1 = new wxFlexGridSizer( 0, 1, 4, 0 ); + fgSizer1->SetFlexibleDirection( wxBOTH ); + fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - wxString m_antialiasingFallbackChoices[] = { _("No Antialiasing"), _("Fast Antialiasing"), _("High Quality Antialiasing") }; - int m_antialiasingFallbackNChoices = sizeof( m_antialiasingFallbackChoices ) / sizeof( wxString ); - m_antialiasingFallback = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_antialiasingFallbackNChoices, m_antialiasingFallbackChoices, 0 ); - m_antialiasingFallback->SetSelection( 0 ); - gbSizer11->Add( m_antialiasingFallback, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + m_rbAccelerated = new wxRadioButton( this, wxID_ANY, _("Accelerated Graphics"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_rbAccelerated->SetToolTip( _("Hardware-accelerated graphics (recommended)") ); + + fgSizer1->Add( m_rbAccelerated, 0, wxLEFT, 5 ); + + m_rbFallback = new wxRadioButton( this, wxID_ANY, _("Fallback Graphics"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbFallback->SetToolTip( _("Software graphics (for computers which do not support KiCad's hardware acceleration requirements)") ); + + fgSizer1->Add( m_rbFallback, 0, wxLEFT|wxTOP, 5 ); + + + gbSizer11->Add( fgSizer1, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 0 ); gbSizer11->AddGrowableCol( 1 ); - bAntialiasingSizer->Add( gbSizer11, 0, wxTOP|wxBOTTOM, 5 ); + bLeftSizer->Add( gbSizer11, 0, wxLEFT, 5 ); + + wxBoxSizer* bAntialiasingSizer; + bAntialiasingSizer = new wxBoxSizer( wxVERTICAL ); bLeftSizer->Add( bAntialiasingSizer, 0, wxTOP|wxLEFT|wxEXPAND, 5 ); @@ -112,7 +120,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizer8; bSizer8 = new wxBoxSizer( wxVERTICAL ); - m_defaultPDFViewer = new wxRadioButton( this, wxID_ANY, _("System default PDF viewer"), wxDefaultPosition, wxDefaultSize, 0 ); + m_defaultPDFViewer = new wxRadioButton( this, wxID_ANY, _("System default PDF viewer"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); bSizer8->Add( m_defaultPDFViewer, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); diff --git a/common/dialogs/panel_common_settings_base.fbp b/common/dialogs/panel_common_settings_base.fbp index 38a7469021..b3bd2f272f 100644 --- a/common/dialogs/panel_common_settings_base.fbp +++ b/common/dialogs/panel_common_settings_base.fbp @@ -102,7 +102,7 @@ 0 0 wxID_ANY - Antialiasing + Rendering Engine 0 0 @@ -192,36 +192,176 @@ 5 - wxTOP|wxLEFT|wxEXPAND + wxLEFT 0 - + + -1,2 + wxBOTH + 1 + + 4 - bAntialiasingSizer - wxVERTICAL + gbSizer11 + wxFLEX_GROWMODE_SPECIFIED none - + 2 + 5 - wxTOP|wxBOTTOM - 0 - - -1,2 - wxBOTH - 1 - - 4 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxLEFT + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Antialiasing: + 0 + + 0 + + + 0 - gbSizer11 + 1 + antialiasingLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + + + -1 + + + + 5 + 1 + 1 + wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + "No Antialiasing" "Fast Antialiasing" "High Quality Antialiasing" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_antialiasing + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 0 + 1 + 1 + wxEXPAND + 0 + 1 + + 1 + wxBOTH + + + 0 + + fgSizer1 wxFLEX_GROWMODE_SPECIFIED none - 6 - + 0 + 4 + 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxLEFT - 0 - 1 - + wxLEFT + 0 + 1 1 1 @@ -250,8 +390,7 @@ 0 0 wxID_ANY - Accelerated graphics: - 0 + Accelerated Graphics 0 @@ -259,71 +398,7 @@ 0 1 - antialiasingLabel - 1 - - - none - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - - - 5 - 2 - 1 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT - 0 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - "No Antialiasing" "Fast Antialiasing" "High Quality Antialiasing" - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_antialiasing + m_rbAccelerated 1 @@ -331,30 +406,27 @@ 1 Resizable - 0 1 - - ; forward_declare + wxRB_GROUP + ; ; forward_declare 0 - + Hardware-accelerated graphics (recommended) wxFILTER_NONE wxDefaultValidator + 0 - + 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxLEFT - 1 - 1 - + wxLEFT|wxTOP + 0 + 1 1 1 @@ -383,8 +455,7 @@ 0 0 wxID_ANY - Fallback graphics: - 0 + Fallback Graphics 0 @@ -392,7 +463,7 @@ 0 1 - m_antialiasingFallbackLabel + m_rbFallback 1 @@ -403,78 +474,14 @@ 1 - ; forward_declare + ; ; forward_declare 0 - - - - - -1 - - - - 5 - 2 - 1 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT - 1 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - "No Antialiasing" "Fast Antialiasing" "High Quality Antialiasing" - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_antialiasingFallback - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; forward_declare - 0 - + Software graphics (for computers which do not support KiCad's hardware acceleration requirements) wxFILTER_NONE wxDefaultValidator + 0 @@ -484,6 +491,17 @@ + + 5 + wxTOP|wxLEFT|wxEXPAND + 0 + + + bAntialiasingSizer + wxVERTICAL + none + + 5 @@ -1045,7 +1063,7 @@ Resizable 1 - + wxRB_GROUP ; forward_declare 0 @@ -1066,7 +1084,7 @@ 5 wxBOTTOM|wxRIGHT|wxEXPAND 0 - + bSizer7 wxHORIZONTAL diff --git a/common/dialogs/panel_common_settings_base.h b/common/dialogs/panel_common_settings_base.h index b9175c170c..2ba3060b98 100644 --- a/common/dialogs/panel_common_settings_base.h +++ b/common/dialogs/panel_common_settings_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -21,15 +21,15 @@ class STD_BITMAP_BUTTON; #include #include #include -#include +#include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -47,8 +47,8 @@ class PANEL_COMMON_SETTINGS_BASE : public RESETTABLE_PANEL wxStaticText* m_staticText20; wxStaticLine* m_staticline3; wxChoice* m_antialiasing; - wxStaticText* m_antialiasingFallbackLabel; - wxChoice* m_antialiasingFallback; + wxRadioButton* m_rbAccelerated; + wxRadioButton* m_rbFallback; wxStaticText* m_staticText21; wxStaticLine* m_staticline2; wxTextCtrl* m_textEditorPath; diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index d15525c812..4d4bc635e5 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -919,7 +919,7 @@ void EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) } -EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::loadCanvasTypeSetting( APP_SETTINGS_BASE* aCfg ) +EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::loadCanvasTypeSetting() { #ifdef __WXMAC__ // Cairo renderer doesn't handle Retina displays so there's really only one game @@ -928,7 +928,7 @@ EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::loadCanvasTypeSetting( APP_SETTING #endif EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; - APP_SETTINGS_BASE* cfg = aCfg ? aCfg : Kiface().KifaceSettings(); + COMMON_SETTINGS* cfg = Pgm().GetCommonSettings(); if( cfg ) canvasType = static_cast( cfg->m_Graphics.canvas_type ); @@ -990,7 +990,7 @@ bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas return false; } - if( APP_SETTINGS_BASE* cfg = Kiface().KifaceSettings() ) + if( COMMON_SETTINGS* cfg = Pgm().GetCommonSettings() ) cfg->m_Graphics.canvas_type = static_cast( aCanvasType ); return false; diff --git a/common/gal/cairo/cairo_compositor.cpp b/common/gal/cairo/cairo_compositor.cpp index c71a41ee89..885a61fb83 100644 --- a/common/gal/cairo/cairo_compositor.cpp +++ b/common/gal/cairo/cairo_compositor.cpp @@ -60,12 +60,12 @@ void CAIRO_COMPOSITOR::Initialize() } -void CAIRO_COMPOSITOR::SetAntialiasingMode( CAIRO_ANTIALIASING_MODE aMode ) +void CAIRO_COMPOSITOR::SetAntialiasingMode( GAL_ANTIALIASING_MODE aMode ) { switch( aMode ) { - case CAIRO_ANTIALIASING_MODE::FAST: m_currentAntialiasingMode = CAIRO_ANTIALIAS_FAST; break; - case CAIRO_ANTIALIASING_MODE::GOOD: m_currentAntialiasingMode = CAIRO_ANTIALIAS_GOOD; break; + case GAL_ANTIALIASING_MODE::AA_FAST: m_currentAntialiasingMode = CAIRO_ANTIALIAS_FAST; break; + case GAL_ANTIALIASING_MODE::AA_HIGHQUALITY: m_currentAntialiasingMode = CAIRO_ANTIALIAS_GOOD; break; default: m_currentAntialiasingMode = CAIRO_ANTIALIAS_NONE; } diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index a2f66b9db1..57658469f9 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -1631,7 +1631,7 @@ void CAIRO_GAL::setCompositor() // Recreate the compositor with the new Cairo context m_compositor.reset( new CAIRO_COMPOSITOR( &m_currentContext ) ); m_compositor->Resize( m_screenSize.x, m_screenSize.y ); - m_compositor->SetAntialiasingMode( m_options.cairo_antialiasing_mode ); + m_compositor->SetAntialiasingMode( m_options.antialiasing_mode ); // Prepare buffers m_mainBuffer = m_compositor->CreateBuffer(); @@ -1669,9 +1669,9 @@ bool CAIRO_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) bool refresh = false; if( m_validCompositor && - aOptions.cairo_antialiasing_mode != m_compositor->GetAntialiasingMode() ) + aOptions.antialiasing_mode != m_compositor->GetAntialiasingMode() ) { - m_compositor->SetAntialiasingMode( m_options.cairo_antialiasing_mode ); + m_compositor->SetAntialiasingMode( m_options.antialiasing_mode ); m_validCompositor = false; deinitSurface(); diff --git a/common/gal/gal_display_options.cpp b/common/gal/gal_display_options.cpp index d03862c2c4..4ba7e25588 100644 --- a/common/gal/gal_display_options.cpp +++ b/common/gal/gal_display_options.cpp @@ -44,8 +44,7 @@ static const wxChar* traceGalDispOpts = wxT( "KICAD_GAL_DISPLAY_OPTIONS" ); GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS() - : gl_antialiasing_mode( OPENGL_ANTIALIASING_MODE::NONE ), - cairo_antialiasing_mode( CAIRO_ANTIALIASING_MODE::NONE ), + : antialiasing_mode( GAL_ANTIALIASING_MODE::AA_NONE ), m_gridStyle( GRID_STYLE::DOTS ), m_gridSnapping( GRID_SNAPPING::ALWAYS ), m_gridLineWidth( 1.0 ), diff --git a/common/gal/opengl/opengl_compositor.cpp b/common/gal/opengl/opengl_compositor.cpp index 11eb729f9e..392c84f5ce 100644 --- a/common/gal/opengl/opengl_compositor.cpp +++ b/common/gal/opengl/opengl_compositor.cpp @@ -49,7 +49,7 @@ OPENGL_COMPOSITOR::OPENGL_COMPOSITOR() : m_mainFbo( 0 ), m_depthBuffer( 0 ), m_curFbo( DIRECT_RENDERING ), - m_currentAntialiasingMode( OPENGL_ANTIALIASING_MODE::NONE ) + m_currentAntialiasingMode( GAL_ANTIALIASING_MODE::AA_NONE ) { m_antialiasing = std::make_unique( this ); } @@ -72,7 +72,7 @@ OPENGL_COMPOSITOR::~OPENGL_COMPOSITOR() } -void OPENGL_COMPOSITOR::SetAntialiasingMode( OPENGL_ANTIALIASING_MODE aMode ) +void OPENGL_COMPOSITOR::SetAntialiasingMode( GAL_ANTIALIASING_MODE aMode ) { m_currentAntialiasingMode = aMode; @@ -81,7 +81,7 @@ void OPENGL_COMPOSITOR::SetAntialiasingMode( OPENGL_ANTIALIASING_MODE aMode ) } -OPENGL_ANTIALIASING_MODE OPENGL_COMPOSITOR::GetAntialiasingMode() const +GAL_ANTIALIASING_MODE OPENGL_COMPOSITOR::GetAntialiasingMode() const { return m_currentAntialiasingMode; } @@ -94,10 +94,10 @@ void OPENGL_COMPOSITOR::Initialize() switch( m_currentAntialiasingMode ) { - case OPENGL_ANTIALIASING_MODE::SMAA: + case GAL_ANTIALIASING_MODE::AA_FAST: m_antialiasing = std::make_unique( this ); break; - case OPENGL_ANTIALIASING_MODE::SUPERSAMPLING: + case GAL_ANTIALIASING_MODE::AA_HIGHQUALITY: m_antialiasing = std::make_unique( this ); break; default: @@ -406,7 +406,7 @@ int OPENGL_COMPOSITOR::GetAntialiasSupersamplingFactor() const { switch ( m_currentAntialiasingMode ) { - case OPENGL_ANTIALIASING_MODE::SUPERSAMPLING: return 2; + case GAL_ANTIALIASING_MODE::AA_HIGHQUALITY: return 2; default: return 1; } } @@ -415,7 +415,7 @@ VECTOR2D OPENGL_COMPOSITOR::GetAntialiasRenderingOffset() const { switch( m_currentAntialiasingMode ) { - case OPENGL_ANTIALIASING_MODE::SUPERSAMPLING: return VECTOR2D( 0.5, -0.5 ); + case GAL_ANTIALIASING_MODE::AA_HIGHQUALITY: return VECTOR2D( 0.5, -0.5 ); default: return VECTOR2D( 0, 0 ); } } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index f7ee1ef3aa..d0e399990f 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -348,7 +348,7 @@ OPENGL_GAL::OPENGL_GAL( const KIGFX::VC_SETTINGS& aVcSettings, GAL_DISPLAY_OPTIO m_bitmapCache = std::make_unique(); m_compositor = new OPENGL_COMPOSITOR; - m_compositor->SetAntialiasingMode( m_options.gl_antialiasing_mode ); + m_compositor->SetAntialiasingMode( m_options.antialiasing_mode ); // Initialize the flags m_isFramebufferInitialized = false; @@ -510,9 +510,9 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) bool refresh = false; - if( m_options.gl_antialiasing_mode != m_compositor->GetAntialiasingMode() ) + if( m_options.antialiasing_mode != m_compositor->GetAntialiasingMode() ) { - m_compositor->SetAntialiasingMode( m_options.gl_antialiasing_mode ); + m_compositor->SetAntialiasingMode( m_options.antialiasing_mode ); m_isFramebufferInitialized = false; refresh = true; } diff --git a/common/gal_display_options_common.cpp b/common/gal_display_options_common.cpp index 2cbece46ce..f45531a4ca 100644 --- a/common/gal_display_options_common.cpp +++ b/common/gal_display_options_common.cpp @@ -82,11 +82,8 @@ void GAL_DISPLAY_OPTIONS_IMPL::ReadCommonConfig( COMMON_SETTINGS& aSettings, wxW { wxLogTrace( traceGalDispOpts, wxS( "Reading common config" ) ); - gl_antialiasing_mode = - static_cast( aSettings.m_Graphics.opengl_aa_mode ); - - cairo_antialiasing_mode = - static_cast( aSettings.m_Graphics.cairo_aa_mode ); + antialiasing_mode = + static_cast( aSettings.m_Graphics.aa_mode ); m_dpi = DPI_SCALING_COMMON( &aSettings, aWindow ); UpdateScaleFactor(); diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index b54fc9b383..21486c6810 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -47,9 +47,6 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV m_CustomToolbars( false ), m_appSettingsSchemaVersion( aSchemaVersion ) { - // Make Coverity happy: - m_Graphics.canvas_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; - // Build parameters list: m_params.emplace_back( new PARAM( "find_replace.match_mode", &m_FindReplace.match_mode, 0 ) ); @@ -124,10 +121,6 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV }, {} ) ); - - m_params.emplace_back( new PARAM( "graphics.canvas_type", - &m_Graphics.canvas_type, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) ); - m_params.emplace_back( new PARAM( "graphics.highlight_factor", &m_Graphics.highlight_factor, 0.5f, 0.0, 1.0f ) ); @@ -296,8 +289,6 @@ bool APP_SETTINGS_BASE::MigrateFromLegacy( wxConfigBase* aCfg ) migrateFindReplace( aCfg ); - ret &= fromLegacy( aCfg, "canvas_type", "graphics.canvas_type" ); - ret &= fromLegacy( aCfg, "P22LIB_TREE_MODEL_ADAPTERSelectorColumnWidth", "lib_tree.column_width" ); diff --git a/common/settings/common_settings.cpp b/common/settings/common_settings.cpp index 90c94416a1..190761a2f4 100644 --- a/common/settings/common_settings.cpp +++ b/common/settings/common_settings.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -286,11 +287,11 @@ COMMON_SETTINGS::COMMON_SETTINGS() : &m_Input.drag_right, MOUSE_DRAG_ACTION::PAN, MOUSE_DRAG_ACTION::SELECT, MOUSE_DRAG_ACTION::NONE ) ); - m_params.emplace_back( new PARAM( "graphics.opengl_antialiasing_mode", - &m_Graphics.opengl_aa_mode, 2, 0, 2 ) ); + m_params.emplace_back( new PARAM( "graphics.canvas_type", + &m_Graphics.canvas_type, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) ); - m_params.emplace_back( new PARAM( "graphics.cairo_antialiasing_mode", - &m_Graphics.cairo_aa_mode, 0, 0, 2 ) ); + m_params.emplace_back( new PARAM( "graphics.antialiasing_mode", + &m_Graphics.aa_mode, 2, 0, 2 ) ); m_params.emplace_back( new PARAM( "system.autosave_interval", &m_System.autosave_interval, 600 ) ); diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 79d9e134e5..4ae381073d 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -86,15 +86,6 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, APP_SETTINGS_BASE* aApp bool GAL_OPTIONS_PANEL::TransferDataToWindow() { -#ifndef __WXMAC__ - auto canvasType = static_cast( m_cfg->m_Graphics.canvas_type ); - - if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) - m_rbAccelerated->SetValue( true ); - else - m_rbFallback->SetValue( true ); -#endif - m_gridSnapOptions->SetSelection( m_cfg->m_Window.grid.snap ); if( m_cfg->m_Window.grid.style == 0 ) @@ -136,12 +127,6 @@ bool GAL_OPTIONS_PANEL::TransferDataFromWindow() m_cfg->m_Window.cursor.fullscreen_cursor = m_rbFullWindowCrosshairs->GetValue(); m_cfg->m_Window.cursor.always_show_cursor = m_forceCursorDisplay->GetValue(); -#ifndef __WXMAC__ - m_cfg->m_Graphics.canvas_type = m_rbAccelerated->GetValue() ? - EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL : - EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; -#endif - return true; } diff --git a/common/widgets/gal_options_panel_base.cpp b/common/widgets/gal_options_panel_base.cpp index 412f08917e..7b66ddf233 100644 --- a/common/widgets/gal_options_panel_base.cpp +++ b/common/widgets/gal_options_panel_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -14,36 +14,6 @@ GAL_OPTIONS_PANEL_BASE::GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id, wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); - m_renderingSizer = new wxBoxSizer( wxVERTICAL ); - - m_staticText9 = new wxStaticText( this, wxID_ANY, _("Rendering Engine"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( -1 ); - m_renderingSizer->Add( m_staticText9, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); - - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_renderingSizer->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); - - wxFlexGridSizer* fgSizer2; - fgSizer2 = new wxFlexGridSizer( 0, 1, 4, 0 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); - fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_rbAccelerated = new wxRadioButton( this, wxID_ANY, _("Accelerated graphics"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_rbAccelerated->SetToolTip( _("Hardware-accelerated graphics (recommended)") ); - - fgSizer2->Add( m_rbAccelerated, 0, wxTOP|wxLEFT, 5 ); - - m_rbFallback = new wxRadioButton( this, wxID_ANY, _("Fallback graphics"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rbFallback->SetToolTip( _("Software graphics (for computers which do not support KiCad's hardware acceleration requirements)") ); - - fgSizer2->Add( m_rbFallback, 0, wxLEFT, 5 ); - - - m_renderingSizer->Add( fgSizer2, 0, wxEXPAND|wxALL, 5 ); - - - mainSizer->Add( m_renderingSizer, 0, wxEXPAND|wxBOTTOM, 5 ); - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Grid Display"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); mainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); diff --git a/common/widgets/gal_options_panel_base.fbp b/common/widgets/gal_options_panel_base.fbp index e24bcfc9e8..b04bacc20d 100644 --- a/common/widgets/gal_options_panel_base.fbp +++ b/common/widgets/gal_options_panel_base.fbp @@ -60,286 +60,6 @@ mainSizer wxVERTICAL none - - 5 - wxEXPAND|wxBOTTOM - 0 - - - m_renderingSizer - wxVERTICAL - protected - - 13 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Rendering Engine - 0 - - 0 - - - 0 - - 1 - m_staticText9 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 2 - wxEXPAND|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline3 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxALL - 0 - - 1 - wxBOTH - - - 0 - - fgSizer2 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 4 - - 5 - wxTOP|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Accelerated graphics - - 0 - - - 0 - - 1 - m_rbAccelerated - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - Hardware-accelerated graphics (recommended) - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Fallback graphics - - 0 - - - 0 - - 1 - m_rbFallback - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Software graphics (for computers which do not support KiCad's hardware acceleration requirements) - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - 13 wxTOP|wxRIGHT|wxLEFT diff --git a/common/widgets/gal_options_panel_base.h b/common/widgets/gal_options_panel_base.h index 7eb88f057d..42bc7da6a3 100644 --- a/common/widgets/gal_options_panel_base.h +++ b/common/widgets/gal_options_panel_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -35,11 +35,6 @@ class GAL_OPTIONS_PANEL_BASE : public wxPanel private: protected: - wxBoxSizer* m_renderingSizer; - wxStaticText* m_staticText9; - wxStaticLine* m_staticline3; - wxRadioButton* m_rbAccelerated; - wxRadioButton* m_rbFallback; wxStaticText* m_staticText1; wxStaticLine* m_staticline1; wxStaticText* m_gridStyleLabel; diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index c5603600e0..4cb1de3c60 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -94,7 +94,7 @@ PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS( wxWindow* aParent m_galDisplayOptions.ReadConfig( *common_settings, app_settings->m_Window, this ); m_galDisplayOptions.m_forceDisplayCursor = false; - m_galType = static_cast( app_settings->m_Graphics.canvas_type ); + m_galType = static_cast( common_settings->m_Graphics.canvas_type ); } diff --git a/eeschema/printing/sch_printout.cpp b/eeschema/printing/sch_printout.cpp index 02834d8979..63ae3d05e5 100644 --- a/eeschema/printing/sch_printout.cpp +++ b/eeschema/printing/sch_printout.cpp @@ -130,7 +130,7 @@ bool SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen, wxDC* aDC, bool aForPrinting wxDC* dc = aDC; m_view = m_parent->GetCanvas()->GetView(); KIGFX::GAL_DISPLAY_OPTIONS options; - options.cairo_antialiasing_mode = KIGFX::CAIRO_ANTIALIASING_MODE::GOOD; + options.antialiasing_mode = KIGFX::GAL_ANTIALIASING_MODE::AA_HIGHQUALITY; std::unique_ptr galPrint = KIGFX::GAL_PRINT::Create( options, dc ); KIGFX::GAL* gal = galPrint->GetGAL(); KIGFX::PRINT_CONTEXT* printCtx = galPrint->GetPrintCtx(); diff --git a/eeschema/widgets/panel_symbol_chooser.cpp b/eeschema/widgets/panel_symbol_chooser.cpp index 6d0dd6cdeb..a7ab82eb84 100644 --- a/eeschema/widgets/panel_symbol_chooser.cpp +++ b/eeschema/widgets/panel_symbol_chooser.cpp @@ -400,8 +400,8 @@ wxPanel* PANEL_SYMBOL_CHOOSER::constructRightPanel( wxWindow* aParent ) if( m_frame->GetCanvas() ) backend = m_frame->GetCanvas()->GetBackend(); - else if( EESCHEMA_SETTINGS* cfg = GetAppSettings( "eeschema" ) ) - backend = (EDA_DRAW_PANEL_GAL::GAL_TYPE) cfg->m_Graphics.canvas_type; + else if( COMMON_SETTINGS* cfg = Pgm().GetCommonSettings() ) + backend = static_cast( cfg->m_Graphics.canvas_type ); wxPanel* panel = new wxPanel( aParent ); wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL ); diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index 01fbafcfa7..2d77b94a36 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -557,7 +557,7 @@ protected: * @param aCfg is the APP_SETTINGS_BASE config storing the canvas type. * If nullptr (default) the KifaceSettings() will be used */ - EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting( APP_SETTINGS_BASE* aCfg = nullptr ); + EDA_DRAW_PANEL_GAL::GAL_TYPE loadCanvasTypeSetting(); /** * Store the canvas type in the application settings. diff --git a/include/gal/cairo/cairo_compositor.h b/include/gal/cairo/cairo_compositor.h index 7326115ad0..b0d26a4a7f 100644 --- a/include/gal/cairo/cairo_compositor.h +++ b/include/gal/cairo/cairo_compositor.h @@ -86,17 +86,17 @@ public: /// @copydoc COMPOSITOR::Present() virtual void Present() override; - void SetAntialiasingMode( CAIRO_ANTIALIASING_MODE aMode ); // clears all buffers - CAIRO_ANTIALIASING_MODE GetAntialiasingMode() const + void SetAntialiasingMode( GAL_ANTIALIASING_MODE aMode ); // clears all buffers + GAL_ANTIALIASING_MODE GetAntialiasingMode() const { switch( m_currentAntialiasingMode ) { case CAIRO_ANTIALIAS_FAST: - return CAIRO_ANTIALIASING_MODE::FAST; + return GAL_ANTIALIASING_MODE::AA_FAST; case CAIRO_ANTIALIAS_GOOD: - return CAIRO_ANTIALIASING_MODE::GOOD; + return GAL_ANTIALIASING_MODE::AA_HIGHQUALITY; default: - return CAIRO_ANTIALIASING_MODE::NONE; + return GAL_ANTIALIASING_MODE::AA_NONE; } } diff --git a/include/gal/gal_display_options.h b/include/gal/gal_display_options.h index b399db106f..208792548e 100644 --- a/include/gal/gal_display_options.h +++ b/include/gal/gal_display_options.h @@ -50,18 +50,11 @@ namespace KIGFX SMALL_CROSS ///< Use small cross instead of dots for the grid }; - enum class OPENGL_ANTIALIASING_MODE + enum class GAL_ANTIALIASING_MODE { - NONE, - SMAA, - SUPERSAMPLING, - }; - - enum class CAIRO_ANTIALIASING_MODE - { - NONE, - FAST, - GOOD, + AA_NONE, + AA_FAST, + AA_HIGHQUALITY, }; enum class GRID_SNAPPING @@ -91,9 +84,7 @@ namespace KIGFX virtual ~GAL_DISPLAY_OPTIONS() {} - OPENGL_ANTIALIASING_MODE gl_antialiasing_mode; - - CAIRO_ANTIALIASING_MODE cairo_antialiasing_mode; + GAL_ANTIALIASING_MODE antialiasing_mode; ///< The grid style to draw the grid in KIGFX::GRID_STYLE m_gridStyle; diff --git a/include/gal/opengl/opengl_compositor.h b/include/gal/opengl/opengl_compositor.h index 6954e2479b..b38bf65de4 100644 --- a/include/gal/opengl/opengl_compositor.h +++ b/include/gal/opengl/opengl_compositor.h @@ -90,8 +90,8 @@ public: void DrawBuffer( unsigned int aSourceHandle, unsigned int aDestHandle ); unsigned int CreateBuffer( VECTOR2I aDimensions ); - void SetAntialiasingMode( OPENGL_ANTIALIASING_MODE aMode ); // clears all buffers - OPENGL_ANTIALIASING_MODE GetAntialiasingMode() const; + void SetAntialiasingMode( GAL_ANTIALIASING_MODE aMode ); // clears all buffers + GAL_ANTIALIASING_MODE GetAntialiasingMode() const; int GetAntialiasSupersamplingFactor() const; VECTOR2D GetAntialiasRenderingOffset() const; @@ -131,7 +131,7 @@ protected: /// Store the used FBO name in case there was more than one compositor used GLuint m_curFbo; - OPENGL_ANTIALIASING_MODE m_currentAntialiasingMode; + GAL_ANTIALIASING_MODE m_currentAntialiasingMode; std::unique_ptr m_antialiasing; }; } // namespace KIGFX diff --git a/include/settings/app_settings.h b/include/settings/app_settings.h index 134eeabb6a..26699befb8 100644 --- a/include/settings/app_settings.h +++ b/include/settings/app_settings.h @@ -136,7 +136,6 @@ public: struct GRAPHICS { - int canvas_type; float highlight_factor; ///< How much to brighten highlighted objects by. float select_factor; ///< How much to brighten selected objects by. }; diff --git a/include/settings/common_settings.h b/include/settings/common_settings.h index 0b816ecf6b..046e592303 100644 --- a/include/settings/common_settings.h +++ b/include/settings/common_settings.h @@ -106,8 +106,8 @@ public: struct GRAPHICS { - int cairo_aa_mode; - int opengl_aa_mode; + int canvas_type; ///< EDA_DRAW_PANEL_GAL::GAL_TYPE_* value, see gal_options_panel.cpp + int aa_mode; }; struct SESSION diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index b673096baa..0c76e03cf8 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -125,7 +125,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : SetIcons( icon_bundle ); // Create GAL canvas - m_canvasType = loadCanvasTypeSetting( GetSettings() ); + m_canvasType = loadCanvasTypeSetting(); PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize, GetGalDisplayOptions(), m_canvasType ); @@ -740,7 +740,7 @@ void FOOTPRINT_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) void FOOTPRINT_EDIT_FRAME::resolveCanvasType() { // Load canvas type from the FOOTPRINT_EDITOR_SETTINGS: - m_canvasType = loadCanvasTypeSetting( GetSettings() ); + m_canvasType = loadCanvasTypeSetting(); // If we had an OpenGL failure this session, use the fallback GAL but don't update the // user preference silently: diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index f4db7553ec..b33498f541 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -241,13 +241,13 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow* UNITS_PROVIDER* aUnitsProvider ) { PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings( "pcbnew" ); - + COMMON_SETTINGS* commonSettings = Pgm().GetCommonSettings(); std::unique_ptr gal_opts; gal_opts = std::make_unique(); - gal_opts->ReadConfig( *Pgm().GetCommonSettings(), cfg->m_Window, aParent ); + gal_opts->ReadConfig( *commonSettings, cfg->m_Window, aParent ); - auto galType = static_cast( cfg->m_Graphics.canvas_type ); + auto galType = static_cast( commonSettings->m_Graphics.canvas_type ); FOOTPRINT_PREVIEW_PANEL* panel = new FOOTPRINT_PREVIEW_PANEL( aKiway, aParent, aUnitsProvider, std::move( gal_opts ), galType ); diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp index 8952784dca..076cbdddf9 100644 --- a/qa/qa_utils/pcb_test_frame.cpp +++ b/qa/qa_utils/pcb_test_frame.cpp @@ -153,7 +153,7 @@ void PCB_TEST_FRAME_BASE::SetSelectableItemTypes( const std::vector aTy void PCB_TEST_FRAME_BASE::createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL_TYPE aGalType ) { // SUPERSAMPLING_X4; - m_displayOptions.gl_antialiasing_mode = KIGFX::OPENGL_ANTIALIASING_MODE::NONE; + m_displayOptions.antialiasing_mode = KIGFX::GAL_ANTIALIASING_MODE::AA_NONE; DPI_SCALING_COMMON dpi( Pgm().GetCommonSettings(), aParent ); m_displayOptions.m_scaleFactor = dpi.GetScaleFactor();