diff options
author | avallee@chromium.org <avallee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 22:18:39 +0000 |
---|---|---|
committer | avallee@chromium.org <avallee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 22:18:39 +0000 |
commit | bf9ed2c3a0080086f5458b7da164afb91c61e7d5 (patch) | |
tree | 39632a5086af62b4e8a2d9d3ecad65deaab768a0 /cc/layers | |
parent | 3eb06e59ed487936852867ff537b4a3cdbef8b8f (diff) | |
download | chromium_src-bf9ed2c3a0080086f5458b7da164afb91c61e7d5.zip chromium_src-bf9ed2c3a0080086f5458b7da164afb91c61e7d5.tar.gz chromium_src-bf9ed2c3a0080086f5458b7da164afb91c61e7d5.tar.bz2 |
Support for drawing a debug border around animated layers
This is the groundwork for showing a border around the
animation bounds of a layer. The animation bounds are the
bounds of the layer transformed to screen space where layers
that have an animation instead transform by an "inflate"
step.
To follow, compute the animation bounds of layers when
needed.
+ Add debug rect code to show a lime green border around
layers that have animation bounds.
+ Add --show-layer-animation-bounds that will enable the
drawing of the green box.
BUG=
Review URL: https://codereview.chromium.org/92853002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers')
-rw-r--r-- | cc/layers/heads_up_display_layer_impl.cc | 6 | ||||
-rw-r--r-- | cc/layers/layer_impl.h | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index b7437bf..61489ee 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc @@ -652,6 +652,12 @@ void HeadsUpDisplayLayerImpl::DrawDebugRects( stroke_width = DebugColors::NonFastScrollableRectBorderWidth(); label_text = "repaints on scroll"; break; + case ANIMATION_BOUNDS_RECT_TYPE: + stroke_color = DebugColors::LayerAnimationBoundsBorderColor(); + fill_color = DebugColors::LayerAnimationBoundsFillColor(); + stroke_width = DebugColors::LayerAnimationBoundsBorderWidth(); + label_text = "animation bounds"; + break; } gfx::RectF debug_layer_rect = gfx::ScaleRect(debug_rects[i].rect, diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 35147913..cfbd353 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -361,6 +361,12 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, float contents_scale_y() const { return draw_properties_.contents_scale_y; } void SetContentsScale(float contents_scale_x, float contents_scale_y); + // Computes a box in screen space that should entirely contain the layer's + // bounds through the entirety of the layer's current animation. Returns true + // and sets |out| to the inflation if there are animations that can inflate + // bounds in the path to the root layer. Returns false otherwise. + bool GetAnimationBounds(gfx::BoxF* out) const { return false; } + virtual void CalculateContentsScale(float ideal_contents_scale, float device_scale_factor, float page_scale_factor, |