Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 642983003: cc: Make PictureLayerImpl use a better choice for animated raster scale. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: animationscale: onemorerename Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/transform_operations_unittest.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index c294a330635797c82f7186c4768a87962738ba23..c77f610dad4d6efe631cc2b33d5a310b7858ce85 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1170,22 +1170,25 @@ void PictureLayerImpl::RecalculateRasterScales() {
if (draw_properties().screen_space_transform_is_animating &&
!ShouldAdjustRasterScaleDuringScaleAnimations()) {
bool can_raster_at_maximum_scale = false;
- if (draw_properties().maximum_animation_contents_scale > 0.f) {
- gfx::Size bounds_at_maximum_scale = gfx::ToCeiledSize(gfx::ScaleSize(
- bounds(), draw_properties().maximum_animation_contents_scale));
- if (bounds_at_maximum_scale.GetArea() <=
- layer_tree_impl()->device_viewport_size().GetArea())
+ float maximum_scale = draw_properties().maximum_animation_contents_scale;
+ if (maximum_scale) {
+ if (maximum_scale < raster_contents_scale_) {
can_raster_at_maximum_scale = true;
+ } else {
+ gfx::Size bounds_at_maximum_scale =
+ gfx::ToCeiledSize(gfx::ScaleSize(bounds(), maximum_scale));
+ if (bounds_at_maximum_scale.GetArea() <=
+ layer_tree_impl()->device_viewport_size().GetArea())
+ can_raster_at_maximum_scale = true;
+ }
}
- if (can_raster_at_maximum_scale) {
- raster_contents_scale_ =
- std::max(raster_contents_scale_,
- draw_properties().maximum_animation_contents_scale);
- } else {
- raster_contents_scale_ =
- std::max(raster_contents_scale_,
- 1.f * ideal_page_scale_ * ideal_device_scale_);
- }
+ // Use the computed scales for the raster scale directly, do not try to use
+ // the ideal scale here. The current ideal scale may be way too large in the
+ // case of an animation with scale, and will be constantly changing.
+ if (can_raster_at_maximum_scale)
+ raster_contents_scale_ = maximum_scale;
vmpstr 2014/10/10 00:50:49 If I understand this correctly, maximum_scale is a
danakj 2014/10/10 01:00:19 We'd raster new content at the very small scale ye
+ else
+ raster_contents_scale_ = 1.f * ideal_page_scale_ * ideal_device_scale_;
}
// If this layer would create zero or one tiles at this content scale,
« no previous file with comments | « cc/animation/transform_operations_unittest.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698