| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 FakeTiledLayerImpl::FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id) | 64 FakeTiledLayerImpl::FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id) |
| 65 : TiledLayerImpl(tree_impl, id) {} | 65 : TiledLayerImpl(tree_impl, id) {} |
| 66 | 66 |
| 67 FakeTiledLayerImpl::~FakeTiledLayerImpl() {} | 67 FakeTiledLayerImpl::~FakeTiledLayerImpl() {} |
| 68 | 68 |
| 69 FakeTiledLayer::FakeTiledLayer(PrioritizedResourceManager* resource_manager) | 69 FakeTiledLayer::FakeTiledLayer(PrioritizedResourceManager* resource_manager) |
| 70 : TiledLayer(), | 70 : TiledLayer(), |
| 71 fake_updater_(make_scoped_refptr(new FakeLayerUpdater)), | 71 fake_updater_(make_scoped_refptr(new FakeLayerUpdater)), |
| 72 resource_manager_(resource_manager) { | 72 resource_manager_(resource_manager) { |
| 73 SetTileSize(tile_size()); | 73 SetTileSize(tile_size()); |
| 74 SetTextureFormat(GL_RGBA); | 74 SetTextureFormat(ResourceProvider::RGBA_8888); |
| 75 SetBorderTexelOption(LayerTilingData::NO_BORDER_TEXELS); | 75 SetBorderTexelOption(LayerTilingData::NO_BORDER_TEXELS); |
| 76 // So that we don't get false positives if any of these | 76 // So that we don't get false positives if any of these |
| 77 // tests expect to return false from DrawsContent() for other reasons. | 77 // tests expect to return false from DrawsContent() for other reasons. |
| 78 SetIsDrawable(true); | 78 SetIsDrawable(true); |
| 79 } | 79 } |
| 80 | 80 |
| 81 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds( | 81 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds( |
| 82 PrioritizedResourceManager* resource_manager) | 82 PrioritizedResourceManager* resource_manager) |
| 83 : FakeTiledLayer(resource_manager) {} | 83 : FakeTiledLayer(resource_manager) {} |
| 84 | 84 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 float* contents_scale_y, | 162 float* contents_scale_y, |
| 163 gfx::Size* content_bounds) { | 163 gfx::Size* content_bounds) { |
| 164 *contents_scale_x = | 164 *contents_scale_x = |
| 165 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); | 165 static_cast<float>(forced_content_bounds_.width()) / bounds().width(); |
| 166 *contents_scale_y = | 166 *contents_scale_y = |
| 167 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); | 167 static_cast<float>(forced_content_bounds_.height()) / bounds().height(); |
| 168 *content_bounds = forced_content_bounds_; | 168 *content_bounds = forced_content_bounds_; |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace cc | 171 } // namespace cc |
| OLD | NEW |