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

Side by Side Diff: cc/test/tiled_layer_test_common.cc

Issue 226283004: Rasterize at maximum scale for scale animations on CPU-rasterized layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/tiled_layer_test_common.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test/tiled_layer_test_common.h" 5 #include "cc/test/tiled_layer_test_common.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 FakeLayerUpdater::Resource::Resource(FakeLayerUpdater* layer, 9 FakeLayerUpdater::Resource::Resource(FakeLayerUpdater* layer,
10 scoped_ptr<PrioritizedResource> texture) 10 scoped_ptr<PrioritizedResource> texture)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 PrioritizedResourceManager* FakeTiledLayer::ResourceManager() { 111 PrioritizedResourceManager* FakeTiledLayer::ResourceManager() {
112 return resource_manager_; 112 return resource_manager_;
113 } 113 }
114 114
115 void FakeTiledLayer::UpdateContentsScale(float ideal_contents_scale) { 115 void FakeTiledLayer::UpdateContentsScale(float ideal_contents_scale) {
116 CalculateContentsScale(ideal_contents_scale, 116 CalculateContentsScale(ideal_contents_scale,
117 1.f, 117 1.f,
118 1.f, 118 1.f,
119 1.f,
119 false, // animating_transform_to_screen 120 false, // animating_transform_to_screen
120 &draw_properties().contents_scale_x, 121 &draw_properties().contents_scale_x,
121 &draw_properties().contents_scale_y, 122 &draw_properties().contents_scale_y,
122 &draw_properties().content_bounds); 123 &draw_properties().content_bounds);
123 } 124 }
124 125
125 void FakeTiledLayer::ResetNumDependentsNeedPushProperties() { 126 void FakeTiledLayer::ResetNumDependentsNeedPushProperties() {
126 size_t num = 0; 127 size_t num = 0;
127 if (mask_layer()) { 128 if (mask_layer()) {
128 if (mask_layer()->needs_push_properties() || 129 if (mask_layer()->needs_push_properties() ||
(...skipping 20 matching lines...) Expand all
149 void FakeTiledLayerWithScaledBounds::SetContentBounds( 150 void FakeTiledLayerWithScaledBounds::SetContentBounds(
150 const gfx::Size& content_bounds) { 151 const gfx::Size& content_bounds) {
151 forced_content_bounds_ = content_bounds; 152 forced_content_bounds_ = content_bounds;
152 draw_properties().content_bounds = forced_content_bounds_; 153 draw_properties().content_bounds = forced_content_bounds_;
153 } 154 }
154 155
155 void FakeTiledLayerWithScaledBounds::CalculateContentsScale( 156 void FakeTiledLayerWithScaledBounds::CalculateContentsScale(
156 float ideal_contents_scale, 157 float ideal_contents_scale,
157 float device_scale_factor, 158 float device_scale_factor,
158 float page_scale_factor, 159 float page_scale_factor,
160 float maximum_animation_contents_scale,
159 bool animating_transform_to_screen, 161 bool animating_transform_to_screen,
160 float* contents_scale_x, 162 float* contents_scale_x,
161 float* contents_scale_y, 163 float* contents_scale_y,
162 gfx::Size* content_bounds) { 164 gfx::Size* content_bounds) {
163 *contents_scale_x = 165 *contents_scale_x =
164 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); 166 static_cast<float>(forced_content_bounds_.width()) / bounds().width();
165 *contents_scale_y = 167 *contents_scale_y =
166 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); 168 static_cast<float>(forced_content_bounds_.height()) / bounds().height();
167 *content_bounds = forced_content_bounds_; 169 *content_bounds = forced_content_bounds_;
168 } 170 }
169 171
170 } // namespace cc 172 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/tiled_layer_test_common.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698