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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds( | 82 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds( |
83 PrioritizedResourceManager* resource_manager) | 83 PrioritizedResourceManager* resource_manager) |
84 : FakeTiledLayer(resource_manager) {} | 84 : FakeTiledLayer(resource_manager) {} |
85 | 85 |
86 FakeTiledLayerWithScaledBounds::~FakeTiledLayerWithScaledBounds() {} | 86 FakeTiledLayerWithScaledBounds::~FakeTiledLayerWithScaledBounds() {} |
87 | 87 |
88 FakeTiledLayer::~FakeTiledLayer() {} | 88 FakeTiledLayer::~FakeTiledLayer() {} |
89 | 89 |
90 void FakeTiledLayer::SetNeedsDisplayRect(const gfx::RectF& rect) { | 90 void FakeTiledLayer::SetNeedsDisplayRect(const gfx::Rect& rect) { |
91 last_needs_display_rect_ = rect; | 91 last_needs_display_rect_ = rect; |
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(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 float* contents_scale_y, | 157 float* contents_scale_y, |
158 gfx::Size* content_bounds) { | 158 gfx::Size* content_bounds) { |
159 *contents_scale_x = | 159 *contents_scale_x = |
160 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 160 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
161 *contents_scale_y = | 161 *contents_scale_y = |
162 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 162 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
163 *content_bounds = forced_content_bounds_; | 163 *content_bounds = forced_content_bounds_; |
164 } | 164 } |
165 | 165 |
166 } // namespace cc | 166 } // namespace cc |
OLD | NEW |