mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
layout: Inform webrender about new pipeline as early as possible.
This commit is contained in:
parent
808c34498b
commit
edcdcf7c13
2 changed files with 30 additions and 2 deletions
|
@ -532,6 +532,20 @@ impl LayoutThread {
|
||||||
trace_layout: bool,
|
trace_layout: bool,
|
||||||
dump_flow_tree: bool,
|
dump_flow_tree: bool,
|
||||||
) -> LayoutThread {
|
) -> 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(
|
let device = Device::new(
|
||||||
MediaType::screen(),
|
MediaType::screen(),
|
||||||
window_size.initial_viewport,
|
window_size.initial_viewport,
|
||||||
|
@ -576,9 +590,9 @@ impl LayoutThread {
|
||||||
document_shared_lock: None,
|
document_shared_lock: None,
|
||||||
running_animations: ServoArc::new(RwLock::new(Default::default())),
|
running_animations: ServoArc::new(RwLock::new(Default::default())),
|
||||||
expired_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)),
|
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||||
webrender_api: webrender_api_sender.create_api(),
|
webrender_api,
|
||||||
webrender_document,
|
webrender_document,
|
||||||
stylist: Stylist::new(device, QuirksMode::NoQuirks),
|
stylist: Stylist::new(device, QuirksMode::NoQuirks),
|
||||||
rw_data: Arc::new(Mutex::new(LayoutThreadData {
|
rw_data: Arc::new(Mutex::new(LayoutThreadData {
|
||||||
|
|
|
@ -450,6 +450,20 @@ impl LayoutThread {
|
||||||
window_size: WindowSizeData,
|
window_size: WindowSizeData,
|
||||||
relayout_event: bool,
|
relayout_event: bool,
|
||||||
) -> LayoutThread {
|
) -> 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),
|
// 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.
|
// but it will be set correctly when the initial reflow takes place.
|
||||||
let device = Device::new(
|
let device = Device::new(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue