diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 3482d730be46..603348333191 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -1834,7 +1834,8 @@ impl IOCompositor { let show_debug_borders = opts::get().show_debug_borders; self.context = Some(rendergl::RenderContext::new(self.native_display.clone(), show_debug_borders, - opts::get().output_file.is_some())) + opts::get().output_file.is_some(), + opts::get().use_gl)) } fn find_topmost_layer_at_point_for_layer(&self, diff --git a/components/util/opts.rs b/components/util/opts.rs index 785f59092400..61bd434d9714 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -176,6 +176,9 @@ pub struct Opts { /// Do not use native titlebar pub no_native_titlebar: bool, + + /// Set graphics renderer to be GL or ES2 + pub use_gl: bool, } fn print_usage(app: &str, opts: &Options) { @@ -384,6 +387,10 @@ fn default_user_agent_string(agent: UserAgent) -> String { #[cfg(target_os = "android")] const DEFAULT_USER_AGENT: UserAgent = UserAgent::Android; + + + + // FIXME: This requires https://github.com/servo/servo/issues/7138 to provide the // correct string in Gonk builds (i.e., it will never be chosen today). #[cfg(target_os = "gonk")] @@ -439,6 +446,7 @@ pub fn default_opts() -> Opts { convert_mouse_to_touch: false, exit_after_load: false, no_native_titlebar: false, + use_gl: true, } } @@ -480,6 +488,7 @@ pub fn from_cmdline_args(args: &[String]) { opts.optmulti("", "pref", "A preference to set to enable", "dom.mozbrowser.enabled"); opts.optflag("b", "no-native-titlebar", "Do not use native titlebar"); + opts.optflag("E", "es2", "Select ES2 for backend graphic option"); let opt_match = match opts.parse(args) { Ok(m) => m, @@ -623,6 +632,7 @@ pub fn from_cmdline_args(args: &[String]) { trace_layout: debug_options.trace_layout, devtools_port: devtools_port, webdriver_port: webdriver_port, + use_gl:!opt_match.opt_present("E"), initial_window_size: initial_window_size, user_agent: user_agent, multiprocess: opt_match.opt_present("M"),