diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index a4d375b687..0ed5021b6d 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -80,7 +80,7 @@ Editor::initialize_canvas () _track_canvas = _track_canvas_viewport->canvas (); _track_canvas->set_background_color (UIConfiguration::instance().color ("arrange base")); - _track_canvas->use_nsglview (); + _track_canvas->use_nsglview (UIConfiguration::instance().get_nsgl_view_mode () == NSGLHiRes); /* scroll group for items that should not automatically scroll * (e.g verbose cursor). It shares the canvas coordinate space. diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index c3495e96d8..3514f22eb4 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -66,7 +66,7 @@ EditorSummary::EditorSummary (Editor* e) _image (0), _background_dirty (true) { - CairoWidget::use_nsglview (); + CairoWidget::use_nsglview (UIConfiguration::instance().get_nsgl_view_mode () == NSGLHiRes); add_events (Gdk::POINTER_MOTION_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK); set_can_focus (); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 5fdd685094..9844dd93c0 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -92,8 +92,6 @@ using namespace ARDOUR; using namespace ARDOUR_UI_UTILS; using namespace ArdourWidgets; -extern int query_darwin_version (); // cocoacarbon.mm - class ClickOptions : public OptionEditorMiniPage { public: @@ -3021,17 +3019,17 @@ These settings will only take effect after %1 is restarted.\n\ #ifdef __APPLE__ ComboOption* glmode = new ComboOption ( - "use-opengl-view", + "nsgl-view-mode", _("Render Canvas on openGL texture (requires restart)"), - sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_opengl_view), - sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_opengl_view) + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_nsgl_view_mode), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_nsgl_view_mode) ); - glmode->add (NSGLAuto, _("Automatic")); + glmode->add (NSGLHiRes, _("Yes, with Retina scaling")); + glmode->add (NSGLLoRes, _("Yes, low resolution")); glmode->add (NSGLDisable, _("No")); - glmode->add (NSGLEnable, _("Yes")); Gtkmm2ext::UI::instance()->set_tip (glmode->tip_widget(), string_compose ( - _("Render editor canvas, on a openGL texture, bypassing color-correction and retina scaling.\nThis requires restarting %1 before having an effect"), PROGRAM_NAME)); + _("Render editor canvas, on a openGL texture which may improve graphics performance.\nThis requires restarting %1 before having an effect"), PROGRAM_NAME)); add_option (_("Appearance"), glmode); #endif @@ -4901,15 +4899,6 @@ RCOptionEditor::parameter_changed (string const & p) plugin_scan_refresh (); } else if (p == "conceal-vst2-if-vst3-exists") { plugin_scan_refresh (); - } else if (p == "use-opengl-view" && _cairo_image_surface) { -#ifdef __APPLE__ - AppleNSGLViewMode m = UIConfiguration::instance().get_use_opengl_view (); - if (m == NSGLEnable || (m == NSGLAuto && query_darwin_version () < 23)) { - _cairo_image_surface->set_sensitive (false); - } else { - _cairo_image_surface->set_sensitive (true); - } -#endif } } diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index e33f6bd9d7..4eb13e8cd4 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -239,20 +239,8 @@ UIConfiguration::pre_gui_init () } #endif #ifdef __APPLE__ - switch (get_use_opengl_view()) { - case NSGLAuto: - if (query_darwin_version () >= 23) { - g_setenv ("ARDOUR_NSGL", "0", 0); - } else { - g_setenv ("ARDOUR_NSGL", "1", 0); - } - break; - case NSGLDisable: - g_setenv ("ARDOUR_NSGL", "0", 0); - break; - case NSGLEnable: - g_setenv ("ARDOUR_NSGL", "1", 0); - break; + if (NSGLDisable == get_nsgl_view_mode()) { + g_setenv ("ARDOUR_NSGL", "0", 0); } #endif return 0; diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index f3de652ca2..ffe8088cd7 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -107,7 +107,7 @@ UI_CONFIG_VARIABLE (double, waveform_clip_level, "waveform-clip-level", -0.09339 UI_CONFIG_VARIABLE (bool, no_new_session_dialog, "no-new-session-dialog", false) UI_CONFIG_VARIABLE (bool, buggy_gradients, "buggy-gradients", false) UI_CONFIG_VARIABLE (bool, cairo_image_surface, "cairo-image-surface", false) -UI_CONFIG_VARIABLE (ARDOUR::AppleNSGLViewMode, use_opengl_view, "use-opengl-view", NSGLAuto) +UI_CONFIG_VARIABLE (ARDOUR::AppleNSGLViewMode, nsgl_view_mode, "nsgl-view-mode", NSGLHiRes) UI_CONFIG_VARIABLE (uint64_t, waveform_cache_size, "waveform-cache-size", 100) /* units of megagbytes */ UI_CONFIG_VARIABLE (int32_t, recent_session_sort, "recent-session-sort", 0) UI_CONFIG_VARIABLE (bool, save_export_analysis_image, "save-export-analysis-image", false) diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index a3b395b941..d90837f3de 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -686,9 +686,9 @@ enum PluginGUIBehavior { }; enum AppleNSGLViewMode { - NSGLAuto, // disable on Catalina and above + NSGLHiRes, + NSGLLoRes, NSGLDisable, - NSGLEnable }; /** A struct used to describe changes to processors in a route. diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index 4566d1d759..ac48c78ba1 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -762,9 +762,9 @@ setup_enum_writer () REGISTER_ENUM(PluginGUIDestroyVST); REGISTER(_PluginGUIBehavior); - REGISTER_ENUM(NSGLAuto); + REGISTER_ENUM(NSGLHiRes); + REGISTER_ENUM(NSGLLoRes); REGISTER_ENUM(NSGLDisable); - REGISTER_ENUM(NSGLEnable); REGISTER(_AppleNSGLViewMode); REGISTER_ENUM (Small); diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 8ebb09070e..2a02bf8e03 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -2582,9 +2582,9 @@ LuaBindings::common (lua_State* L) .endNamespace () .beginNamespace ("AppleNSGLViewMode") - .addConst ("NSGLAuto", ARDOUR::AppleNSGLViewMode(NSGLAuto)) + .addConst ("NSGLHiRes", ARDOUR::AppleNSGLViewMode(NSGLHiRes)) + .addConst ("NSGLLoRes", ARDOUR::AppleNSGLViewMode(NSGLLoRes)) .addConst ("NSGLDisable", ARDOUR::AppleNSGLViewMode(NSGLDisable)) - .addConst ("NSGLEnable", ARDOUR::AppleNSGLViewMode(NSGLEnable)) .endNamespace () .beginNamespace ("PluginGUIBehavior")