Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2202)

Unified Diff: cc/debug/debug_rect_history.cc

Issue 92853002: Support for drawing a debug border around animated layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copy switches for chromeos Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/debug/debug_rect_history.h ('k') | cc/debug/layer_tree_debug_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/debug_rect_history.cc
diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc
index b972b321d8dbecedffc70f07cd95443b43413731..679beafdbb475f501f01adb4bd8c3cb68f3a5258 100644
--- a/cc/debug/debug_rect_history.cc
+++ b/cc/debug/debug_rect_history.cc
@@ -58,6 +58,9 @@ void DebugRectHistory::SaveDebugRectsForCurrentFrame(
if (debug_state.show_non_occluding_rects)
SaveNonOccludingRects(non_occluding_screen_space_rects);
+
+ if (debug_state.show_layer_animation_bounds_rects)
+ SaveLayerAnimationBoundsRects(render_surface_layer_list);
}
void DebugRectHistory::SavePaintRects(LayerImpl* layer) {
@@ -232,4 +235,28 @@ void DebugRectHistory::SaveNonFastScrollableRectsCallback(LayerImpl* layer) {
}
}
+void DebugRectHistory::SaveLayerAnimationBoundsRects(
+ const LayerImplList& render_surface_layer_list) {
+ typedef LayerIterator<LayerImpl,
+ LayerImplList,
+ RenderSurfaceImpl,
+ LayerIteratorActions::FrontToBack> LayerIteratorType;
+ LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list);
+ for (LayerIteratorType it =
+ LayerIteratorType::Begin(&render_surface_layer_list);
+ it != end; ++it) {
+ if (!it.represents_itself())
+ continue;
+ gfx::BoxF inflated_bounds;
+ if (!(*it)->GetAnimationBounds(&inflated_bounds))
+ continue;
+
+ debug_rects_.push_back(DebugRect(ANIMATION_BOUNDS_RECT_TYPE,
+ gfx::RectF(inflated_bounds.x(),
+ inflated_bounds.y(),
+ inflated_bounds.width(),
+ inflated_bounds.height())));
+ }
+}
+
} // namespace cc
« no previous file with comments | « cc/debug/debug_rect_history.h ('k') | cc/debug/layer_tree_debug_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698