diff options
author | danakj <danakj@chromium.org> | 2014-10-10 12:35:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-10 19:35:19 +0000 |
commit | e488f71403f5a3a9bd43629b4b9fbb7b9d3d6ff7 (patch) | |
tree | 72586c4ded7f4c8bccc5f7d98a3422e4c7414c84 /cc/test/animation_test_common.cc | |
parent | 571b18256a44c782c1ac0c12bcaf13a73c0c497c (diff) | |
download | chromium_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/test/animation_test_common.cc')
-rw-r--r-- | cc/test/animation_test_common.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc index 9966b34..7c1b3f6 100644 --- a/cc/test/animation_test_common.cc +++ b/cc/test/animation_test_common.cc @@ -169,7 +169,8 @@ bool FakeTransformTransition::AffectsScale() const { return false; } bool FakeTransformTransition::IsTranslation() const { return true; } -bool FakeTransformTransition::MaximumScale(float* max_scale) const { +bool FakeTransformTransition::MaximumTargetScale(bool forward_direction, + float* max_scale) const { *max_scale = 1.f; return true; } |