diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-11-12 12:15:30 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-11-13 11:54:51 -0500 |
commit | edcdcf7c130d820b16d016b41979ec02fda08e77 (patch) | |
tree | 117372f93f8768b842dc625a16c1eb370fb052cf /components | |
parent | 808c34498b3120ee6b93247b664421f723184ab5 (diff) | |
download | servo-edcdcf7c130d820b16d016b41979ec02fda08e77.tar.gz servo-edcdcf7c130d820b16d016b41979ec02fda08e77.zip |
layout: Inform webrender about new pipeline as early as possible.
Diffstat (limited to 'components')
-rw-r--r-- | components/layout_thread/lib.rs | 18 | ||||
-rw-r--r-- | components/layout_thread_2020/lib.rs | 14 |
2 files changed, 30 insertions, 2 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 48b7591c242..848ed595381 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -532,6 +532,20 @@ impl LayoutThread { trace_layout: bool, dump_flow_tree: bool, ) -> LayoutThread { + // Let webrender know about this pipeline by sending an empty display list. + let mut epoch = Epoch(0); + let webrender_api = webrender_api_sender.create_api(); + let mut txn = webrender_api::Transaction::new(); + txn.set_display_list( + webrender_api::Epoch(epoch.0), + None, + Default::default(), + (id.to_webrender(), Default::default(), Default::default()), + false, + ); + webrender_api.send_transaction(webrender_document, txn); + epoch.next(); + let device = Device::new( MediaType::screen(), window_size.initial_viewport, @@ -576,9 +590,9 @@ impl LayoutThread { document_shared_lock: None, running_animations: ServoArc::new(RwLock::new(Default::default())), expired_animations: ServoArc::new(RwLock::new(Default::default())), - epoch: Cell::new(Epoch(0)), + epoch: Cell::new(epoch), viewport_size: Size2D::new(Au(0), Au(0)), - webrender_api: webrender_api_sender.create_api(), + webrender_api, webrender_document, stylist: Stylist::new(device, QuirksMode::NoQuirks), rw_data: Arc::new(Mutex::new(LayoutThreadData { diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs index 106dace088b..bf18c584231 100644 --- a/components/layout_thread_2020/lib.rs +++ b/components/layout_thread_2020/lib.rs @@ -450,6 +450,20 @@ impl LayoutThread { window_size: WindowSizeData, relayout_event: bool, ) -> LayoutThread { + // Let webrender know about this pipeline by sending an empty display list. + let mut epoch = Epoch(0); + let webrender_api = webrender_api_sender.create_api(); + let mut txn = webrender_api::Transaction::new(); + txn.set_display_list( + webrender_api::Epoch(epoch.0), + None, + Default::default(), + (id.to_webrender(), Default::default(), Default::default()), + false, + ); + webrender_api.send_transaction(webrender_document, txn); + epoch.next(); + // The device pixel ratio is incorrect (it does not have the hidpi value), // but it will be set correctly when the initial reflow takes place. let device = Device::new( |