summaryrefslogtreecommitdiffstats
path: root/cc/animation/transform_operations.h
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-10-10 12:35:06 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-10 19:35:19 +0000
commite488f71403f5a3a9bd43629b4b9fbb7b9d3d6ff7 (patch)
tree72586c4ded7f4c8bccc5f7d98a3422e4c7414c84 /cc/animation/transform_operations.h
parent571b18256a44c782c1ac0c12bcaf13a73c0c497c (diff)
downloadchromium_src-e488f71403f5a3a9bd43629b4b9fbb7b9d3d6ff7.zip
chromium_src-e488f71403f5a3a9bd43629b4b9fbb7b9d3d6ff7.tar.gz
chromium_src-e488f71403f5a3a9bd43629b4b9fbb7b9d3d6ff7.tar.bz2
cc: Make PictureLayerImpl use a better choice for animated raster scale.
Two changes here: 1. When finding the max scale of an animation, only consider the scales at each of the animations keyframes excluding the animations origin. This is done because the origin is not an interesting scale to use, we are animating away from it. And in the case of a layer at a high scale, we are unable to raster all of its content at that scale. It would be better to use the scale at the end of the transform since that is what we will want to raster eventually. 2. When PictureLayerImpl chooses to use the animation scale: a) Always allow using it if the scale is less than the current raster scale choice. It can only put us in a better position memory-wise. b) Don't use the max() with the current raster scale choice, that means we will never use the animation scale if it is zooming out, which is not what we want. This would also mean we choose a new raster scale on every frame, which is bad. Just use the scale of the animation straight up, and if it's not known, use a source scale of 1. R=ajuma, vmpstr BUG=421812 Review URL: https://codereview.chromium.org/642983003 Cr-Commit-Position: refs/heads/master@{#299162}
Diffstat (limited to 'cc/animation/transform_operations.h')
-rw-r--r--cc/animation/transform_operations.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/cc/animation/transform_operations.h b/cc/animation/transform_operations.h
index f086eb1..1c110ff 100644
--- a/cc/animation/transform_operations.h
+++ b/cc/animation/transform_operations.h
@@ -63,14 +63,6 @@ class CC_EXPORT TransformOperations {
// 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;
@@ -80,6 +72,11 @@ class CC_EXPORT TransformOperations {
// fails (this can happen if either matrix cannot be decomposed).
bool CanBlendWith(const TransformOperations& other) 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;
+
void AppendTranslate(SkMScalar x, SkMScalar y, SkMScalar z);
void AppendRotate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar degrees);
void AppendScale(SkMScalar x, SkMScalar y, SkMScalar z);
@@ -98,11 +95,6 @@ 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_;