mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +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
|
@ -41,6 +41,7 @@ pub enum ProfilerCategory {
|
|||
Compositing,
|
||||
LayoutPerform,
|
||||
LayoutStyleRecalc,
|
||||
LayoutTextShaping,
|
||||
LayoutRestyleDamagePropagation,
|
||||
LayoutNonIncrementalReset,
|
||||
LayoutSelectorMatch,
|
||||
|
@ -49,7 +50,6 @@ pub enum ProfilerCategory {
|
|||
LayoutGeneratedContent,
|
||||
LayoutMain,
|
||||
LayoutParallelWarmup,
|
||||
LayoutShaping,
|
||||
LayoutDispListBuild,
|
||||
PaintingPerTile,
|
||||
PaintingPrepBuff,
|
||||
|
@ -99,8 +99,25 @@ pub fn profile<T, F>(category: ProfilerCategory,
|
|||
let val = callback();
|
||||
let end_time = precise_time_ns();
|
||||
let end_energy = read_energy_uj();
|
||||
send_profile_data(category,
|
||||
meta,
|
||||
profiler_chan,
|
||||
start_time,
|
||||
end_time,
|
||||
start_energy,
|
||||
end_energy);
|
||||
val
|
||||
}
|
||||
|
||||
pub fn send_profile_data(category: ProfilerCategory,
|
||||
meta: Option<TimerMetadata>,
|
||||
profiler_chan: ProfilerChan,
|
||||
start_time: u64,
|
||||
end_time: u64,
|
||||
start_energy: u64,
|
||||
end_energy: u64) {
|
||||
profiler_chan.send(ProfilerMsg::Time((category, meta),
|
||||
(start_time, end_time),
|
||||
(start_energy, end_energy)));
|
||||
val
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue