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

@ -17,7 +17,7 @@
use app_units::Au;
use euclid::{Transform3D, Point2D, Vector2D, Rect, Size2D, TypedRect, SideOffsets2D};
use euclid::num::{One, Zero};
use gfx_traits::StackingContextId;
use gfx_traits::{self, StackingContextId};
use gfx_traits::print_tree::PrintTree;
use ipc_channel::ipc::IpcSharedMemory;
use msg::constellation_msg::PipelineId;
@ -146,6 +146,25 @@ impl DisplayList {
}
}
impl gfx_traits::DisplayList for DisplayList {
/// 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). Used by metrics.
fn is_contentful(&self) -> bool {
for item in &self.list {
match item {
&DisplayItem::Text(_) |
&DisplayItem::Image(_) => {
return true
}
_ => (),
}
}
false
}
}
/// Display list sections that make up a stacking context. Each section here refers
/// to the steps in CSS 2.1 Appendix E.
///