prefs: Move some DebugOptions to Preferences and clean up (#34998)

- Move options configuring antialiasing and WebRender shader precache to
  the `Preferences` to group them with other related WebRender and DOM
  settings.
- Remove the option to disable antialiasing for canvases. This was
  unused.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-01-17 12:47:47 +01:00 committed by GitHub
parent e1b4649faf
commit 2d09552234
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 24 additions and 81 deletions

View file

@ -121,20 +121,6 @@ pub struct DebugOptions {
/// List all the debug options.
pub help: bool,
/// If set with `disable-text-aa`, disable antialiasing on fonts. This is
/// primarily useful for reftests where pixel perfect results are required
/// when using fonts such as the Ahem font for layout tests.
pub disable_text_antialiasing: bool,
/// Disable subpixel antialiasing of rendered text.
pub disable_subpixel_text_antialiasing: bool,
/// Disable antialiasing of rendered text on the HTML canvas element.
/// If set with `disable-canvas-aa`, disable antialiasing on the HTML canvas
/// element. Like `disable-text-aa`, this is useful for reftests where
/// pixel perfect results are required.
pub disable_canvas_antialiasing: bool,
/// Print the DOM after each restyle.
pub dump_style_tree: bool,
@ -180,11 +166,6 @@ pub struct DebugOptions {
/// Show webrender profiling stats on screen.
pub webrender_stats: bool,
/// True to compile all webrender shaders at init time. This is mostly
/// useful when modifying the shaders, to ensure they all compile
/// after each change is made.
pub precache_shaders: bool,
/// True to use OS native signposting facilities. This makes profiling events (script activity,
/// reflow, compositing, etc.) appear in Instruments.app on macOS.
pub signpost: bool,
@ -196,17 +177,13 @@ impl DebugOptions {
match option {
"help" => self.help = true,
"convert-mouse-to-touch" => self.convert_mouse_to_touch = true,
"disable-canvas-aa" => self.disable_canvas_antialiasing = true,
"disable-share-style-cache" => self.disable_share_style_cache = true,
"disable-subpixel-aa" => self.disable_subpixel_text_antialiasing = true,
"disable-text-aa" => self.disable_text_antialiasing = true,
"dump-display-list" => self.dump_display_list = true,
"dump-stacking-context-tree" => self.dump_stacking_context_tree = true,
"dump-flow-tree" => self.dump_flow_tree = true,
"dump-rule-tree" => self.dump_rule_tree = true,
"dump-style-tree" => self.dump_style_tree = true,
"gc-profile" => self.gc_profile = true,
"precache-shaders" => self.precache_shaders = true,
"profile-script-events" => self.profile_script_events = true,
"relayout-event" => self.relayout_event = true,
"replace-surrogates" => self.replace_surrogates = true,

View file

@ -136,6 +136,13 @@ pub struct Preferences {
pub dom_worklet_blockingsleep: bool,
pub dom_worklet_testing_enabled: bool,
pub dom_worklet_timeout_ms: i64,
/// True to compile all WebRender shaders when Servo initializes. This is mostly
/// useful when modifying the shaders, to ensure they all compile after each change is
/// made.
pub gfx_precache_shaders: bool,
/// Whether or not antialiasing is enabled for text rendering.
pub gfx_text_antialiasing_enabled: bool,
/// Whether or not subpixel antialiasing is enabled for text rendering.
pub gfx_subpixel_text_antialiasing_enabled: bool,
pub gfx_texture_swizzling_enabled: bool,
pub js_asmjs_enabled: bool,
@ -305,6 +312,8 @@ impl Preferences {
fonts_monospace: String::new(),
fonts_sans_serif: String::new(),
fonts_serif: String::new(),
gfx_precache_shaders: true,
gfx_text_antialiasing_enabled: true,
gfx_subpixel_text_antialiasing_enabled: true,
gfx_texture_swizzling_enabled: true,
js_asmjs_enabled: true,