Wait for actual paint before setting paint related metrics

This commit is contained in:
Fernando Jiménez Moreno 2017-07-26 20:24:42 +02:00
parent 1059ef4fde
commit 1b123400eb
16 changed files with 203 additions and 72 deletions

View file

@ -1255,6 +1255,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
debug!("constellation got iframe size message");
self.handle_iframe_size_msg(iframe_sizes);
}
FromLayoutMsg::PendingPaintMetric(pipeline_id, epoch) => {
debug!("constellation got a pending paint metric message");
self.handle_pending_paint_metric(pipeline_id, epoch);
}
FromLayoutMsg::SetCursor(cursor) => {
self.handle_set_cursor_msg(cursor)
}
@ -1700,6 +1704,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
});
}
fn handle_pending_paint_metric(&self, pipeline_id: PipelineId, epoch: Epoch) {
self.compositor_proxy.send(ToCompositorMsg::PendingPaintMetric(pipeline_id, epoch))
}
fn handle_set_cursor_msg(&mut self, cursor: Cursor) {
self.compositor_proxy.send(ToCompositorMsg::SetCursor(cursor))
}

View file

@ -486,7 +486,9 @@ impl UnprivilegedPipelineContent {
STF: ScriptThreadFactory<Message=Message>
{
let image_cache = Arc::new(ImageCacheImpl::new(self.webrender_api_sender.create_api()));
let paint_time_metrics = PaintTimeMetrics::new(self.time_profiler_chan.clone());
let paint_time_metrics = PaintTimeMetrics::new(self.id,
self.time_profiler_chan.clone(),
self.layout_to_constellation_chan.clone());
let layout_pair = STF::create(InitialScriptState {
id: self.id,
browsing_context_id: self.browsing_context_id,