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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 host_impl_.CreatePendingTree(); | 225 host_impl_.CreatePendingTree(); |
226 host_impl_.pending_tree()->PushPageScaleFromMainThread(1.f, 0.00001f, | 226 host_impl_.pending_tree()->PushPageScaleFromMainThread(1.f, 0.00001f, |
227 100000.f); | 227 100000.f); |
228 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); | 228 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); |
229 pending_tree->SetDeviceScaleFactor( | 229 pending_tree->SetDeviceScaleFactor( |
230 host_impl_.active_tree()->device_scale_factor()); | 230 host_impl_.active_tree()->device_scale_factor()); |
231 | 231 |
232 // Steal from the recycled tree if possible. | 232 // Steal from the recycled tree if possible. |
233 scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree(); | 233 scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree(); |
234 scoped_ptr<FakePictureLayerImpl> pending_layer; | 234 scoped_ptr<FakePictureLayerImpl> pending_layer; |
235 DCHECK(!pending_root || pending_root->id() == root_id_); | 235 DCHECK_IMPLIES(pending_root, pending_root->id() == root_id_); |
236 if (!pending_root) { | 236 if (!pending_root) { |
237 pending_root = LayerImpl::Create(pending_tree, root_id_); | 237 pending_root = LayerImpl::Create(pending_tree, root_id_); |
238 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); | 238 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); |
239 if (!tile_size.IsEmpty()) | 239 if (!tile_size.IsEmpty()) |
240 pending_layer->set_fixed_tile_size(tile_size); | 240 pending_layer->set_fixed_tile_size(tile_size); |
241 pending_layer->SetDrawsContent(true); | 241 pending_layer->SetDrawsContent(true); |
242 } else { | 242 } else { |
243 pending_layer.reset(static_cast<FakePictureLayerImpl*>( | 243 pending_layer.reset(static_cast<FakePictureLayerImpl*>( |
244 pending_root->RemoveChild(pending_root->children()[0]).release())); | 244 pending_root->RemoveChild(pending_root->children()[0]).release())); |
245 if (!tile_size.IsEmpty()) | 245 if (!tile_size.IsEmpty()) |
(...skipping 4780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5026 // New low res tiling. | 5026 // New low res tiling. |
5027 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 5027 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
5028 | 5028 |
5029 // This tiling will be high res now, it won't contain low res content since it | 5029 // This tiling will be high res now, it won't contain low res content since it |
5030 // was all destroyed. | 5030 // was all destroyed. |
5031 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 5031 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
5032 } | 5032 } |
5033 | 5033 |
5034 } // namespace | 5034 } // namespace |
5035 } // namespace cc | 5035 } // namespace cc |
OLD | NEW |