diff options
author | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-03 23:56:02 +0000 |
---|---|---|
committer | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-03 23:56:02 +0000 |
commit | 6248bcc8d0717d4af4836299f54f51d0939042a8 (patch) | |
tree | f15c96ee198d1a424a46847227fd2a1ae7e0ca78 /cc/animation/transform_operations.h | |
parent | 22646b0458de4b49e9f84d051d5fb24316ad0271 (diff) | |
download | chromium_src-6248bcc8d0717d4af4836299f54f51d0939042a8.zip chromium_src-6248bcc8d0717d4af4836299f54f51d0939042a8.tar.gz chromium_src-6248bcc8d0717d4af4836299f54f51d0939042a8.tar.bz2 |
cc: Compute the maximum scale of animations
This adds MaximumScale and HasOnlyTranslationTransforms
methods to LayerAnimationController.
BUG=224913
Review URL: https://codereview.chromium.org/214003004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/animation/transform_operations.h')
-rw-r--r-- | cc/animation/transform_operations.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cc/animation/transform_operations.h b/cc/animation/transform_operations.h index 7d42cea..f086eb1 100644 --- a/cc/animation/transform_operations.h +++ b/cc/animation/transform_operations.h @@ -60,6 +60,17 @@ class CC_EXPORT TransformOperations { // Returns true if these operations affect scale. bool AffectsScale() const; + // Returns true if these operations are only translations. + bool IsTranslation() const; + + // Sets |max_scale| to be the maximum scale in any dimension when calling + // Blend on |from| with progress in the range [min_progress, max_progress]. If + // this maximum scale cannot be computed, returns false. + bool MaximumScale(const TransformOperations& from, + SkMScalar min_progress, + SkMScalar max_progress, + float* max_scale) const; + // Returns true if this operation and its descendants have the same types // as other and its descendants. bool MatchesTypes(const TransformOperations& other) const; @@ -87,6 +98,11 @@ class CC_EXPORT TransformOperations { bool ComputeDecomposedTransform() const; + // If these operations have no more than one scale operation, and if the only + // other operations are translations, sets |scale| to the scale component + // of these operations. Otherwise, returns false. + bool ScaleComponent(gfx::Vector3dF* scale) const; + // For efficiency, we cache the decomposed transform. mutable scoped_ptr<gfx::DecomposedTransform> decomposed_transform_; mutable bool decomposed_transform_dirty_; |