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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 draw_properties().render_target = 0; | 107 draw_properties().render_target = 0; |
108 } | 108 } |
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, | |
118 1.f, | |
119 1.f, | |
120 false, // animating_transform_to_screen | |
121 &draw_properties().contents_scale_x, | 117 &draw_properties().contents_scale_x, |
122 &draw_properties().contents_scale_y, | 118 &draw_properties().contents_scale_y, |
123 &draw_properties().content_bounds); | 119 &draw_properties().content_bounds); |
124 } | 120 } |
125 | 121 |
126 void FakeTiledLayer::ResetNumDependentsNeedPushProperties() { | 122 void FakeTiledLayer::ResetNumDependentsNeedPushProperties() { |
127 size_t num = 0; | 123 size_t num = 0; |
128 if (mask_layer()) { | 124 if (mask_layer()) { |
129 if (mask_layer()->needs_push_properties() || | 125 if (mask_layer()->needs_push_properties() || |
130 mask_layer()->descendant_needs_push_properties()) | 126 mask_layer()->descendant_needs_push_properties()) |
(...skipping 17 matching lines...) Expand all Loading... |
148 } | 144 } |
149 | 145 |
150 void FakeTiledLayerWithScaledBounds::SetContentBounds( | 146 void FakeTiledLayerWithScaledBounds::SetContentBounds( |
151 const gfx::Size& content_bounds) { | 147 const gfx::Size& content_bounds) { |
152 forced_content_bounds_ = content_bounds; | 148 forced_content_bounds_ = content_bounds; |
153 draw_properties().content_bounds = forced_content_bounds_; | 149 draw_properties().content_bounds = forced_content_bounds_; |
154 } | 150 } |
155 | 151 |
156 void FakeTiledLayerWithScaledBounds::CalculateContentsScale( | 152 void FakeTiledLayerWithScaledBounds::CalculateContentsScale( |
157 float ideal_contents_scale, | 153 float ideal_contents_scale, |
158 float device_scale_factor, | |
159 float page_scale_factor, | |
160 float maximum_animation_contents_scale, | |
161 bool animating_transform_to_screen, | |
162 float* contents_scale_x, | 154 float* contents_scale_x, |
163 float* contents_scale_y, | 155 float* contents_scale_y, |
164 gfx::Size* content_bounds) { | 156 gfx::Size* content_bounds) { |
165 *contents_scale_x = | 157 *contents_scale_x = |
166 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 158 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
167 *contents_scale_y = | 159 *contents_scale_y = |
168 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 160 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
169 *content_bounds = forced_content_bounds_; | 161 *content_bounds = forced_content_bounds_; |
170 } | 162 } |
171 | 163 |
172 } // namespace cc | 164 } // namespace cc |
OLD | NEW |