Auto merge of #8995 - pcwalton:measure-text-shaping, r=mbrubeck

gfx: Measure text shaping time in the time profiler.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8995)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-17 10:57:29 +05:30
commit 338f66003e
5 changed files with 54 additions and 6 deletions

View file

@ -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};
@ -1034,6 +1035,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);
}