summaryrefslogtreecommitdiffstats
path: root/cc/layers/layer_utils.h
diff options
context:
space:
mode:
authoravallee@chromium.org <avallee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-24 01:33:11 +0000
committeravallee@chromium.org <avallee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-24 01:33:11 +0000
commit3d86dd7a4ebd896a46f4c07cd7a2fbb6df726217 (patch)
tree54751d98283fefa47e68978a6a0218e1966b53b5 /cc/layers/layer_utils.h
parent938023f551e85235e39ec7a9ebbb4cd94764d9f0 (diff)
downloadchromium_src-3d86dd7a4ebd896a46f4c07cd7a2fbb6df726217.zip
chromium_src-3d86dd7a4ebd896a46f4c07cd7a2fbb6df726217.tar.gz
chromium_src-3d86dd7a4ebd896a46f4c07cd7a2fbb6df726217.tar.bz2
Compute accurate screen space bounds for animated layers.
This walks up the layer tree transforming a layer's bounds as a box through the different layer transforms and uses the LayerAnimationController::AnimationBoundsForBox to transform the box at layers which are animated. Expansion of the box is included for filters which change the bounds, however, the LayerAnimationController implementation is currently stubbed. + Added computation of animation bounds of layers in the screen space. - Removed invalid assertion in LayerAnimationControllerTest.AnimatedBounds. ~ Renamed methods to use the uniform naming AnimationBounds. ~ Extracted LTHC::ApplySublayerTransformAboutAnchor from LTHC::CalculateDrawPropertiesInternal. ~ Fixed LayerImpl::AsValueInto to correctly calculate bounds. ! Did not substitute implementation of ApplySublayerTransformAboutAnchor inside CalculateDrawPropertiesInternal due to performance regression. BUG=280375 Review URL: https://codereview.chromium.org/109193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/layer_utils.h')
-rw-r--r--cc/layers/layer_utils.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/cc/layers/layer_utils.h b/cc/layers/layer_utils.h
new file mode 100644
index 0000000..396f070
--- /dev/null
+++ b/cc/layers/layer_utils.h
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_LAYER_UTILS_H_
+#define CC_LAYERS_LAYER_UTILS_H_
+
+#include "cc/base/cc_export.h"
+
+namespace gfx {
+ class BoxF;
+} // namespace gfx
+
+namespace cc {
+ class LayerImpl;
+
+ class CC_EXPORT LayerUtils {
+ public:
+ // 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 and that it was able to
+ // inflate correctly. Returns false otherwise.
+ static bool GetAnimationBounds(const LayerImpl& layer, gfx::BoxF* out);
+ };
+
+} // namespace cc
+
+#endif // CC_LAYERS_LAYER_UTILS_H_