mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
layout: Don't start the reflow pass unless some node needs to be
reflowed. Reduces CPU usage when mousing over simple pages. Part of #9999.
This commit is contained in:
parent
acfd8e448c
commit
7cb9429a0f
1 changed files with 23 additions and 20 deletions
|
@ -30,7 +30,8 @@ use gfx::font_context;
|
|||
use gfx::paint_thread::LayoutToPaintMsg;
|
||||
use gfx_traits::{color, Epoch, LayerId, ScrollPolicy};
|
||||
use heapsize::HeapSizeOf;
|
||||
use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT};
|
||||
use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REFLOW_OUT_OF_FLOW};
|
||||
use incremental::{REPAINT};
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use layout_debug;
|
||||
|
@ -1331,6 +1332,7 @@ impl LayoutThread {
|
|||
|
||||
// Perform the primary layout passes over the flow tree to compute the locations of all
|
||||
// the boxes.
|
||||
if flow::base(&*root_flow).restyle_damage.intersects(REFLOW | REFLOW_OUT_OF_FLOW) {
|
||||
profile(time::ProfilerCategory::LayoutMain,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
@ -1351,6 +1353,7 @@ impl LayoutThread {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
profile(time::ProfilerCategory::LayoutStoreOverflow,
|
||||
self.profiler_metadata(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue