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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 TiledLayer::SetNeedsDisplayRect(rect); | 92 TiledLayer::SetNeedsDisplayRect(rect); |
93 } | 93 } |
94 | 94 |
95 void FakeTiledLayer::SetTexturePriorities( | 95 void FakeTiledLayer::SetTexturePriorities( |
96 const PriorityCalculator& calculator) { | 96 const PriorityCalculator& calculator) { |
97 // Ensure there is always a target render surface available. If none has been | 97 // Ensure there is always a target render surface available. If none has been |
98 // set (the layer is an orphan for the test), then just set a surface on | 98 // set (the layer is an orphan for the test), then just set a surface on |
99 // itself. | 99 // itself. |
100 bool missing_target_render_surface = !render_target(); | 100 bool missing_target_render_surface = !render_target(); |
101 | 101 |
102 if (missing_target_render_surface) | 102 if (missing_target_render_surface) { |
103 CreateRenderSurface(); | 103 CreateRenderSurface(); |
| 104 draw_properties().render_target = this; |
| 105 } |
104 | 106 |
105 TiledLayer::SetTexturePriorities(calculator); | 107 TiledLayer::SetTexturePriorities(calculator); |
106 | 108 |
107 if (missing_target_render_surface) { | 109 if (missing_target_render_surface) { |
108 ClearRenderSurface(); | 110 ClearRenderSurface(); |
109 draw_properties().render_target = 0; | 111 draw_properties().render_target = 0; |
110 } | 112 } |
111 } | 113 } |
112 | 114 |
113 PrioritizedResourceManager* FakeTiledLayer::ResourceManager() { | 115 PrioritizedResourceManager* FakeTiledLayer::ResourceManager() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 float* contents_scale_y, | 159 float* contents_scale_y, |
158 gfx::Size* content_bounds) { | 160 gfx::Size* content_bounds) { |
159 *contents_scale_x = | 161 *contents_scale_x = |
160 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 162 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
161 *contents_scale_y = | 163 *contents_scale_y = |
162 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 164 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
163 *content_bounds = forced_content_bounds_; | 165 *content_bounds = forced_content_bounds_; |
164 } | 166 } |
165 | 167 |
166 } // namespace cc | 168 } // namespace cc |
OLD | NEW |