OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |