OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 active_layer_->AddTiling(0.5f); | 127 active_layer_->AddTiling(0.5f); |
128 for (size_t i = 0; i < active_layer_->tilings()->num_tilings(); ++i) | 128 for (size_t i = 0; i < active_layer_->tilings()->num_tilings(); ++i) |
129 active_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting(); | 129 active_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting(); |
130 pending_layer_->set_invalidation(invalidation); | 130 pending_layer_->set_invalidation(invalidation); |
131 for (size_t i = 0; i < pending_layer_->tilings()->num_tilings(); ++i) | 131 for (size_t i = 0; i < pending_layer_->tilings()->num_tilings(); ++i) |
132 pending_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting(); | 132 pending_layer_->tilings()->tiling_at(i)->CreateAllTilesForTesting(); |
133 } | 133 } |
134 | 134 |
135 void SetupPendingTree(scoped_refptr<RasterSource> raster_source) { | 135 void SetupPendingTree(scoped_refptr<RasterSource> raster_source) { |
136 host_impl_.CreatePendingTree(); | 136 host_impl_.CreatePendingTree(); |
137 host_impl_.pending_tree()->SetPageScaleFactorAndLimits(1.f, 0.25f, 100.f); | 137 host_impl_.pending_tree()->PushPageScaleFromMainThread(1.f, 0.25f, 100.f); |
138 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); | 138 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); |
139 | 139 |
140 // Steal from the recycled tree. | 140 // Steal from the recycled tree. |
141 scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree(); | 141 scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree(); |
142 DCHECK_IMPLIES(old_pending_root, old_pending_root->id() == id_); | 142 DCHECK_IMPLIES(old_pending_root, old_pending_root->id() == id_); |
143 | 143 |
144 scoped_ptr<FakePictureLayerImpl> pending_layer; | 144 scoped_ptr<FakePictureLayerImpl> pending_layer; |
145 if (old_pending_root) { | 145 if (old_pending_root) { |
146 pending_layer.reset( | 146 pending_layer.reset( |
147 static_cast<FakePictureLayerImpl*>(old_pending_root.release())); | 147 static_cast<FakePictureLayerImpl*>(old_pending_root.release())); |
(...skipping 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4760 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4760 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
4761 EXPECT_EQ(result.width(), 448); | 4761 EXPECT_EQ(result.width(), 448); |
4762 EXPECT_EQ(result.height(), 448); | 4762 EXPECT_EQ(result.height(), 448); |
4763 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4763 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
4764 EXPECT_EQ(result.width(), 512); | 4764 EXPECT_EQ(result.width(), 512); |
4765 EXPECT_EQ(result.height(), 500 + 2); | 4765 EXPECT_EQ(result.height(), 500 + 2); |
4766 } | 4766 } |
4767 | 4767 |
4768 } // namespace | 4768 } // namespace |
4769 } // namespace cc | 4769 } // namespace cc |
OLD | NEW |