mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
WR multi-document update
This commit is contained in:
parent
a15d13a6ec
commit
8c588e8c36
14 changed files with 111 additions and 86 deletions
|
@ -241,6 +241,9 @@ pub struct LayoutThread {
|
|||
/// Webrender interface.
|
||||
webrender_api: webrender_api::RenderApi,
|
||||
|
||||
/// Webrender document.
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
|
||||
/// The timer object to control the timing of the animations. This should
|
||||
/// only be a test-mode timer during testing for animations.
|
||||
timer: Timer,
|
||||
|
@ -274,6 +277,7 @@ impl LayoutThreadFactory for LayoutThread {
|
|||
mem_profiler_chan: mem::ProfilerChan,
|
||||
content_process_shutdown_chan: Option<IpcSender<()>>,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
layout_threads: usize,
|
||||
paint_time_metrics: PaintTimeMetrics) {
|
||||
thread::Builder::new().name(format!("LayoutThread {:?}", id)).spawn(move || {
|
||||
|
@ -297,6 +301,7 @@ impl LayoutThreadFactory for LayoutThread {
|
|||
time_profiler_chan,
|
||||
mem_profiler_chan.clone(),
|
||||
webrender_api_sender,
|
||||
webrender_document,
|
||||
layout_threads,
|
||||
paint_time_metrics);
|
||||
|
||||
|
@ -459,6 +464,7 @@ impl LayoutThread {
|
|||
time_profiler_chan: time::ProfilerChan,
|
||||
mem_profiler_chan: mem::ProfilerChan,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
layout_threads: usize,
|
||||
paint_time_metrics: PaintTimeMetrics)
|
||||
-> LayoutThread {
|
||||
|
@ -532,6 +538,7 @@ impl LayoutThread {
|
|||
epoch: Cell::new(Epoch(0)),
|
||||
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||
webrender_api: webrender_api_sender.create_api(),
|
||||
webrender_document,
|
||||
stylist: stylist,
|
||||
rw_data: Arc::new(Mutex::new(
|
||||
LayoutThreadData {
|
||||
|
@ -801,6 +808,7 @@ impl LayoutThread {
|
|||
self.mem_profiler_chan.clone(),
|
||||
info.content_process_shutdown_chan,
|
||||
self.webrender_api.clone_sender(),
|
||||
self.webrender_document,
|
||||
info.layout_threads,
|
||||
info.paint_time_metrics);
|
||||
}
|
||||
|
@ -1044,12 +1052,13 @@ impl LayoutThread {
|
|||
self.paint_time_metrics.maybe_set_first_contentful_paint(self, &display_list);
|
||||
|
||||
self.webrender_api.set_display_list(
|
||||
Some(get_root_flow_background_color(layout_root)),
|
||||
self.webrender_document,
|
||||
webrender_api::Epoch(epoch.0),
|
||||
Some(get_root_flow_background_color(layout_root)),
|
||||
viewport_size,
|
||||
builder.finalize(),
|
||||
true);
|
||||
self.webrender_api.generate_frame(None);
|
||||
self.webrender_api.generate_frame(self.webrender_document, None);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue