From d2120864c94d18e24d97528814b3d324d738000c Mon Sep 17 00:00:00 2001 From: lana Date: Wed, 27 Jul 2016 19:51:27 -0700 Subject: [PATCH] add record option --- components/servo/lib.rs | 1 + components/util/opts.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 515f4d898a70..4674825e3129 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -151,6 +151,7 @@ impl Browser where Window: WindowMethods + 'static { enable_msaa: opts.use_msaa, enable_profiler: opts.webrender_stats, debug: opts.webrender_debug, + enable_recording: opts.enable_recording, }); (Some(webrender), Some(webrender_sender)) } else { diff --git a/components/util/opts.rs b/components/util/opts.rs index 81b83d2b2738..31e10d14de28 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -167,6 +167,9 @@ pub struct Opts { /// Dumps the layer tree when it changes. pub dump_layer_tree: bool, + ///Record and write to disk each frame sent to webrender. + pub enable_recording: bool, + /// Emits notifications when there is a relayout. pub relayout_event: bool, @@ -243,6 +246,9 @@ pub struct DebugOptions { /// Print the layer tree whenever it changes. pub dump_layer_tree: bool, + ///Record display lists sent to webrender. + pub enable_recording: bool, + /// Print notifications when there is a relayout. pub relayout_event: bool, @@ -318,6 +324,7 @@ impl DebugOptions { "dump-display-list" => debug_options.dump_display_list = true, "dump-display-list-json" => debug_options.dump_display_list_json = true, "dump-layer-tree" => debug_options.dump_layer_tree = true, + "record" => debug_options.enable_recording = true, "relayout-event" => debug_options.relayout_event = true, "profile-script-events" => debug_options.profile_script_events = true, "profile-heartbeats" => debug_options.profile_heartbeats = true, @@ -361,6 +368,7 @@ pub fn print_debug_usage(app: &str) -> ! { print_option("dump-display-list", "Print the display list after each layout."); print_option("dump-display-list-json", "Print the display list in JSON form."); print_option("dump-layer-tree", "Print the layer tree whenever it changes."); + print_option("record", "Serializes all frame data sent to webrender and writes to record folder."); print_option("relayout-event", "Print notifications when there is a relayout."); print_option("profile-script-events", "Enable profiling of script-related events."); print_option("profile-heartbeats", "Enable heartbeats for all thread categories."); @@ -504,6 +512,7 @@ pub fn default_opts() -> Opts { dump_display_list: false, dump_display_list_json: false, dump_layer_tree: false, + enable_recording: false, relayout_event: false, profile_script_events: false, profile_heartbeats: false, @@ -811,6 +820,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult { dump_display_list: debug_options.dump_display_list, dump_display_list_json: debug_options.dump_display_list_json, dump_layer_tree: debug_options.dump_layer_tree, + enable_recording: debug_options.enable_recording, relayout_event: debug_options.relayout_event, disable_share_style_cache: debug_options.disable_share_style_cache, convert_mouse_to_touch: debug_options.convert_mouse_to_touch,