mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
gfx: Measure text shaping time in the time profiler.
This commit is contained in:
parent
072222e69e
commit
df93b1f194
5 changed files with 54 additions and 6 deletions
|
@ -24,6 +24,7 @@ use flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUti
|
|||
use flow_ref::{self, FlowRef};
|
||||
use fnv::FnvHasher;
|
||||
use gfx::display_list::{ClippingRegion, DisplayList, LayerInfo, OpaqueNode, StackingContext};
|
||||
use gfx::font;
|
||||
use gfx::font_cache_task::FontCacheTask;
|
||||
use gfx::font_context;
|
||||
use gfx::paint_task::{LayoutToPaintMsg, PaintLayer};
|
||||
|
@ -1027,6 +1028,18 @@ impl LayoutTask {
|
|||
}
|
||||
});
|
||||
|
||||
// TODO(pcwalton): Measure energy usage of text shaping, perhaps?
|
||||
let text_shaping_time =
|
||||
(font::get_and_reset_text_shaping_performance_counter() as u64) /
|
||||
(opts::get().layout_threads as u64);
|
||||
time::send_profile_data(time::ProfilerCategory::LayoutTextShaping,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
0,
|
||||
text_shaping_time,
|
||||
0,
|
||||
0);
|
||||
|
||||
// Retrieve the (possibly rebuilt) root flow.
|
||||
self.root_flow = self.try_get_layout_root(node);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue