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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 PrioritizedResourceManager* manager) { | 60 PrioritizedResourceManager* manager) { |
61 return make_scoped_ptr( | 61 return make_scoped_ptr( |
62 new Resource(this, PrioritizedResource::Create(manager))); | 62 new Resource(this, PrioritizedResource::Create(manager))); |
63 } | 63 } |
64 | 64 |
65 FakeTiledLayerImpl::FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id) | 65 FakeTiledLayerImpl::FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id) |
66 : TiledLayerImpl(tree_impl, id) {} | 66 : TiledLayerImpl(tree_impl, id) {} |
67 | 67 |
68 FakeTiledLayerImpl::~FakeTiledLayerImpl() {} | 68 FakeTiledLayerImpl::~FakeTiledLayerImpl() {} |
69 | 69 |
70 FakeTiledLayer::FakeTiledLayer(PrioritizedResourceManager* resource_manager) | 70 FakeTiledLayer::FakeTiledLayer(const LayerSettings& settings, |
71 : TiledLayer(), | 71 PrioritizedResourceManager* resource_manager) |
| 72 : TiledLayer(settings), |
72 fake_updater_(make_scoped_refptr(new FakeLayerUpdater)), | 73 fake_updater_(make_scoped_refptr(new FakeLayerUpdater)), |
73 resource_manager_(resource_manager) { | 74 resource_manager_(resource_manager) { |
74 SetTileSize(tile_size()); | 75 SetTileSize(tile_size()); |
75 SetTextureFormat(RGBA_8888); | 76 SetTextureFormat(RGBA_8888); |
76 SetBorderTexelOption(LayerTilingData::NO_BORDER_TEXELS); | 77 SetBorderTexelOption(LayerTilingData::NO_BORDER_TEXELS); |
77 // So that we don't get false positives if any of these | 78 // So that we don't get false positives if any of these |
78 // tests expect to return false from DrawsContent() for other reasons. | 79 // tests expect to return false from DrawsContent() for other reasons. |
79 SetIsDrawable(true); | 80 SetIsDrawable(true); |
80 } | 81 } |
81 | 82 |
82 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds( | 83 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds( |
| 84 const LayerSettings& settings, |
83 PrioritizedResourceManager* resource_manager) | 85 PrioritizedResourceManager* resource_manager) |
84 : FakeTiledLayer(resource_manager) {} | 86 : FakeTiledLayer(settings, resource_manager) { |
| 87 } |
85 | 88 |
86 FakeTiledLayerWithScaledBounds::~FakeTiledLayerWithScaledBounds() {} | 89 FakeTiledLayerWithScaledBounds::~FakeTiledLayerWithScaledBounds() {} |
87 | 90 |
88 FakeTiledLayer::~FakeTiledLayer() {} | 91 FakeTiledLayer::~FakeTiledLayer() {} |
89 | 92 |
90 void FakeTiledLayer::SetNeedsDisplayRect(const gfx::Rect& rect) { | 93 void FakeTiledLayer::SetNeedsDisplayRect(const gfx::Rect& rect) { |
91 last_needs_display_rect_ = rect; | 94 last_needs_display_rect_ = rect; |
92 TiledLayer::SetNeedsDisplayRect(rect); | 95 TiledLayer::SetNeedsDisplayRect(rect); |
93 } | 96 } |
94 | 97 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 float* contents_scale_y, | 162 float* contents_scale_y, |
160 gfx::Size* content_bounds) { | 163 gfx::Size* content_bounds) { |
161 *contents_scale_x = | 164 *contents_scale_x = |
162 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 165 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
163 *contents_scale_y = | 166 *contents_scale_y = |
164 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 167 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
165 *content_bounds = forced_content_bounds_; | 168 *content_bounds = forced_content_bounds_; |
166 } | 169 } |
167 | 170 |
168 } // namespace cc | 171 } // namespace cc |
OLD | NEW |