| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 void FakeLayerUpdater::SetRectToInvalidate(const gfx::Rect& rect, | 53 void FakeLayerUpdater::SetRectToInvalidate(const gfx::Rect& rect, |
| 54 FakeTiledLayer* layer) { | 54 FakeTiledLayer* layer) { |
| 55 rect_to_invalidate_ = rect; | 55 rect_to_invalidate_ = rect; |
| 56 layer_ = layer; | 56 layer_ = layer; |
| 57 } | 57 } |
| 58 | 58 |
| 59 scoped_ptr<LayerUpdater::Resource> FakeLayerUpdater::CreateResource( | 59 scoped_ptr<LayerUpdater::Resource> FakeLayerUpdater::CreateResource( |
| 60 PrioritizedResourceManager* manager) { | 60 PrioritizedResourceManager* manager) { |
| 61 return scoped_ptr<LayerUpdater::Resource>( | 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(PrioritizedResourceManager* resource_manager) |
| 71 : TiledLayer(), | 71 : TiledLayer(), |
| (...skipping 85 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 |