Commit 6150ffff authored by vmpstr@chromium.org's avatar vmpstr@chromium.org

cc: Add a checkerboard trace event instant to picture layer impl.

This is a small patch that adds a trace event instant whenever we draw
checkerboards. This is useful for debugging or figuring out exactly
when we checkerboarded.

R=enne

Review URL: https://codereview.chromium.org/275173002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269631 0039d316-1c4b-4281-b951-d872f2087c98
parent c125e533
...@@ -234,6 +234,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, ...@@ -234,6 +234,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
// unused can be considered for removal. // unused can be considered for removal.
std::vector<PictureLayerTiling*> seen_tilings; std::vector<PictureLayerTiling*> seen_tilings;
bool had_checkerboard_quads = false;
for (PictureLayerTilingSet::CoverageIterator iter( for (PictureLayerTilingSet::CoverageIterator iter(
tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_);
iter; iter;
...@@ -248,6 +249,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, ...@@ -248,6 +249,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
visible_geometry_rect.width() * visible_geometry_rect.height(); visible_geometry_rect.width() * visible_geometry_rect.height();
if (!*iter || !iter->IsReadyToDraw()) { if (!*iter || !iter->IsReadyToDraw()) {
had_checkerboard_quads = true;
if (draw_checkerboard_for_missing_tiles()) { if (draw_checkerboard_for_missing_tiles()) {
scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create();
SkColor color = DebugColors::DefaultCheckerboardColor(); SkColor color = DebugColors::DefaultCheckerboardColor();
...@@ -343,6 +345,12 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, ...@@ -343,6 +345,12 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
seen_tilings.push_back(iter.CurrentTiling()); seen_tilings.push_back(iter.CurrentTiling());
} }
if (had_checkerboard_quads) {
TRACE_EVENT_INSTANT0("cc",
"PictureLayerImpl::AppendQuads checkerboard",
TRACE_EVENT_SCOPE_THREAD);
}
// Aggressively remove any tilings that are not seen to save memory. Note // Aggressively remove any tilings that are not seen to save memory. Note
// that this is at the expense of doing cause more frequent re-painting. A // that this is at the expense of doing cause more frequent re-painting. A
// better scheme would be to maintain a tighter visible_content_rect for the // better scheme would be to maintain a tighter visible_content_rect for the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment