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

Side by Side Diff: cc/trees/layer_tree_host_common.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: scaledownstillcheckssize 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 if (!layer_is_animating_scale) { 1087 if (!layer_is_animating_scale) {
1088 gfx::Vector2dF layer_transform_scales = 1088 gfx::Vector2dF layer_transform_scales =
1089 MathUtil::ComputeTransform2dScaleComponents(layer->transform(), 0.f); 1089 MathUtil::ComputeTransform2dScaleComponents(layer->transform(), 0.f);
1090 *combined_maximum_animation_contents_scale = 1090 *combined_maximum_animation_contents_scale =
1091 ancestor_maximum_animation_contents_scale * 1091 ancestor_maximum_animation_contents_scale *
1092 std::max(layer_transform_scales.x(), layer_transform_scales.y()); 1092 std::max(layer_transform_scales.x(), layer_transform_scales.y());
1093 return; 1093 return;
1094 } 1094 }
1095 1095
1096 float layer_maximum_animated_scale = 0.f; 1096 float layer_maximum_animated_scale = 0.f;
1097 if (!layer->layer_animation_controller()->MaximumScale( 1097 if (!layer->layer_animation_controller()->MaximumTargetScale(
1098 &layer_maximum_animated_scale)) { 1098 &layer_maximum_animated_scale)) {
1099 *combined_maximum_animation_contents_scale = 0.f; 1099 *combined_maximum_animation_contents_scale = 0.f;
1100 return; 1100 return;
1101 } 1101 }
1102 gfx::Vector2dF ancestor_transform_scales = 1102 gfx::Vector2dF ancestor_transform_scales =
1103 MathUtil::ComputeTransform2dScaleComponents(ancestor_transform, 0.f); 1103 MathUtil::ComputeTransform2dScaleComponents(ancestor_transform, 0.f);
1104 *combined_maximum_animation_contents_scale = 1104 *combined_maximum_animation_contents_scale =
1105 layer_maximum_animated_scale * 1105 layer_maximum_animated_scale *
1106 std::max(ancestor_transform_scales.x(), ancestor_transform_scales.y()); 1106 std::max(ancestor_transform_scales.x(), ancestor_transform_scales.y());
1107 } 1107 }
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 inputs->current_render_surface_layer_list_id); 2437 inputs->current_render_surface_layer_list_id);
2438 2438
2439 // The dummy layer list should not have been used. 2439 // The dummy layer list should not have been used.
2440 DCHECK_EQ(0u, dummy_layer_list.size()); 2440 DCHECK_EQ(0u, dummy_layer_list.size());
2441 // A root layer render_surface should always exist after 2441 // A root layer render_surface should always exist after
2442 // CalculateDrawProperties. 2442 // CalculateDrawProperties.
2443 DCHECK(inputs->root_layer->render_surface()); 2443 DCHECK(inputs->root_layer->render_surface());
2444 } 2444 }
2445 2445
2446 } // namespace cc 2446 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698