Add WebRender integration to Servo.

WebRender is an experimental GPU accelerated rendering backend for Servo.

The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).

WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
This commit is contained in:
Glenn Watson 2016-02-18 07:57:31 +10:00
parent f7f0eea470
commit c0531c312f
75 changed files with 2869 additions and 888 deletions

View file

@ -35,6 +35,7 @@ use util::geometry::{PagePx, ViewportPx};
use util::ipc::OptionalIpcSender;
use util::opts::{self, Opts};
use util::prefs;
use webrender_traits;
/// A uniquely-identifiable pipeline of script thread, layout thread, and paint thread.
pub struct Pipeline {
@ -113,6 +114,8 @@ pub struct InitialPipelineState {
pub load_data: LoadData,
/// The ID of the pipeline namespace for this script thread.
pub pipeline_namespace_id: PipelineNamespaceId,
/// Optional webrender api (if enabled).
pub webrender_api_sender: Option<webrender_traits::RenderApiSender>,
}
impl Pipeline {
@ -225,6 +228,7 @@ impl Pipeline {
layout_content_process_shutdown_port: layout_content_process_shutdown_port,
script_content_process_shutdown_chan: script_content_process_shutdown_chan,
script_content_process_shutdown_port: script_content_process_shutdown_port,
webrender_api_sender: state.webrender_api_sender,
};
let privileged_pipeline_content = PrivilegedPipelineContent {
@ -376,6 +380,7 @@ pub struct UnprivilegedPipelineContent {
layout_content_process_shutdown_port: IpcReceiver<()>,
script_content_process_shutdown_chan: IpcSender<()>,
script_content_process_shutdown_port: IpcReceiver<()>,
webrender_api_sender: Option<webrender_traits::RenderApiSender>,
}
impl UnprivilegedPipelineContent {
@ -419,7 +424,8 @@ impl UnprivilegedPipelineContent {
self.time_profiler_chan,
self.mem_profiler_chan,
self.layout_shutdown_chan,
self.layout_content_process_shutdown_chan.clone());
self.layout_content_process_shutdown_chan.clone(),
self.webrender_api_sender);
if wait_for_completion {
self.script_content_process_shutdown_port.recv().unwrap();