WR multi-document update

This commit is contained in:
Dzmitry Malyshau 2017-07-26 12:28:38 -04:00
parent 8db39f8fde
commit 101c426eb7
14 changed files with 119 additions and 86 deletions

View file

@ -228,8 +228,11 @@ pub struct Constellation<Message, LTF, STF> {
/// timer thread.
scheduler_chan: IpcSender<TimerSchedulerMsg>,
/// A single WebRender document the constellation operates on.
webrender_document: webrender_api::DocumentId,
/// A channel for the constellation to send messages to the
/// Webrender thread.
/// WebRender thread.
webrender_api_sender: webrender_api::RenderApiSender,
/// The set of all event loops in the browser. We generate a new
@ -325,6 +328,9 @@ pub struct InitialConstellationState {
/// A channel to the memory profiler thread.
pub mem_profiler_chan: mem::ProfilerChan,
/// Webrender document ID.
pub webrender_document: webrender_api::DocumentId,
/// Webrender API.
pub webrender_api_sender: webrender_api::RenderApiSender,
@ -561,6 +567,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
webdriver: WebDriverData::new(),
scheduler_chan: TimerScheduler::start(),
document_states: HashMap::new(),
webrender_document: state.webrender_document,
webrender_api_sender: state.webrender_api_sender,
shutting_down: false,
handled_warnings: VecDeque::new(),
@ -664,9 +671,9 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
let result = Pipeline::spawn::<Message, LTF, STF>(InitialPipelineState {
id: pipeline_id,
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
parent_info: parent_info,
browsing_context_id,
top_level_browsing_context_id,
parent_info,
constellation_chan: self.script_sender.clone(),
layout_to_constellation_chan: self.layout_sender.clone(),
scheduler_chan: self.scheduler_chan.clone(),
@ -675,17 +682,18 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
bluetooth_thread: self.bluetooth_thread.clone(),
swmanager_thread: self.swmanager_sender.clone(),
font_cache_thread: self.font_cache_thread.clone(),
resource_threads: resource_threads,
resource_threads,
time_profiler_chan: self.time_profiler_chan.clone(),
mem_profiler_chan: self.mem_profiler_chan.clone(),
window_size: initial_window_size,
event_loop: event_loop,
load_data: load_data,
event_loop,
load_data,
device_pixel_ratio: self.window_size.device_pixel_ratio,
pipeline_namespace_id: self.next_pipeline_namespace_id(),
prev_visibility: prev_visibility,
prev_visibility,
webrender_api_sender: self.webrender_api_sender.clone(),
is_private: is_private,
webrender_document: self.webrender_document,
is_private,
webvr_thread: self.webvr_thread.clone()
});

View file

@ -156,6 +156,7 @@ pub struct InitialPipelineState {
/// Information about the page to load.
pub load_data: LoadData,
/// The ID of the pipeline namespace for this script thread.
pub pipeline_namespace_id: PipelineNamespaceId,
@ -165,6 +166,9 @@ pub struct InitialPipelineState {
/// Webrender api.
pub webrender_api_sender: webrender_api::RenderApiSender,
/// The ID of the document processed by this script thread.
pub webrender_document: webrender_api::DocumentId,
/// Whether this pipeline is considered private.
pub is_private: bool,
/// A channel to the webvr thread.
@ -265,6 +269,7 @@ impl Pipeline {
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,
webrender_document: state.webrender_document,
webvr_thread: state.webvr_thread,
};
@ -464,6 +469,7 @@ pub struct UnprivilegedPipelineContent {
script_content_process_shutdown_chan: IpcSender<()>,
script_content_process_shutdown_port: IpcReceiver<()>,
webrender_api_sender: webrender_api::RenderApiSender,
webrender_document: webrender_api::DocumentId,
webvr_thread: Option<IpcSender<WebVRMsg>>,
}
@ -510,6 +516,7 @@ impl UnprivilegedPipelineContent {
self.mem_profiler_chan,
Some(self.layout_content_process_shutdown_chan),
self.webrender_api_sender,
self.webrender_document,
self.prefs.get("layout.threads").expect("exists").value()
.as_u64().expect("count") as usize,
paint_time_metrics);