Decoupled gfx and metrics

This commit is contained in:
Georg Streich 2018-01-15 16:25:51 +01:00
parent 75f39b42ab
commit 4b7cb2080e
7 changed files with 29 additions and 24 deletions

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate gfx;
extern crate gfx_traits;
extern crate ipc_channel;
#[macro_use]
@ -17,8 +16,7 @@ extern crate servo_config;
extern crate servo_url;
extern crate time;
use gfx::display_list::{DisplayItem, DisplayList};
use gfx_traits::Epoch;
use gfx_traits::{Epoch, DisplayList};
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId;
use profile_traits::time::{ProfilerChan, ProfilerCategory, send_profile_data};
@ -324,24 +322,9 @@ impl PaintTimeMetrics {
return;
}
let mut is_contentful = false;
// Analyze the display list to figure out if this may be the first
// contentful paint (i.e. the display list contains items of type text,
// image, non-white canvas or SVG).
for item in &display_list.list {
match item {
&DisplayItem::Text(_) |
&DisplayItem::Image(_) => {
is_contentful = true;
break;
}
_ => (),
}
}
self.pending_metrics.borrow_mut().insert(epoch, (
profiler_metadata_factory.new_metadata(),
is_contentful,
display_list.is_contentful(),
));
// Send the pending metric information to the compositor thread.