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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "base/thread_task_runner_handle.h" | 6 #include "base/thread_task_runner_handle.h" |
7 #include "cc/resources/resource_pool.h" | 7 #include "cc/resources/resource_pool.h" |
8 #include "cc/test/begin_frame_args_test.h" | 8 #include "cc/test/begin_frame_args_test.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ActivateTree(); | 106 ActivateTree(); |
107 SetupPendingTree(pending_pile); | 107 SetupPendingTree(pending_pile); |
108 } | 108 } |
109 | 109 |
110 void SetupPendingTree(scoped_refptr<PicturePileImpl> pile) { | 110 void SetupPendingTree(scoped_refptr<PicturePileImpl> pile) { |
111 host_impl_.CreatePendingTree(); | 111 host_impl_.CreatePendingTree(); |
112 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); | 112 LayerTreeImpl* pending_tree = host_impl_.pending_tree(); |
113 | 113 |
114 // Steal from the recycled tree. | 114 // Steal from the recycled tree. |
115 scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree(); | 115 scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree(); |
116 DCHECK_IMPLIES(old_pending_root, old_pending_root->id() == id_); | 116 DCHECK(!old_pending_root || old_pending_root->id() == id_); |
117 | 117 |
118 scoped_ptr<FakePictureLayerImpl> pending_layer; | 118 scoped_ptr<FakePictureLayerImpl> pending_layer; |
119 if (old_pending_root) { | 119 if (old_pending_root) { |
120 pending_layer.reset( | 120 pending_layer.reset( |
121 static_cast<FakePictureLayerImpl*>(old_pending_root.release())); | 121 static_cast<FakePictureLayerImpl*>(old_pending_root.release())); |
122 pending_layer->SetRasterSourceOnPending(pile, Region()); | 122 pending_layer->SetRasterSourceOnPending(pile, Region()); |
123 } else { | 123 } else { |
124 pending_layer = | 124 pending_layer = |
125 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile); | 125 FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile); |
126 pending_layer->SetDrawsContent(true); | 126 pending_layer->SetDrawsContent(true); |
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 .WillOnce(testing::Invoke([&run_loop]() { run_loop.Quit(); })); | 1512 .WillOnce(testing::Invoke([&run_loop]() { run_loop.Quit(); })); |
1513 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); | 1513 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); |
1514 host_impl_.tile_manager()->SetMoreTilesNeedToBeRasterizedForTesting(); | 1514 host_impl_.tile_manager()->SetMoreTilesNeedToBeRasterizedForTesting(); |
1515 EXPECT_TRUE(host_impl_.tile_manager()->HasScheduledTileTasksForTesting()); | 1515 EXPECT_TRUE(host_impl_.tile_manager()->HasScheduledTileTasksForTesting()); |
1516 run_loop.Run(); | 1516 run_loop.Run(); |
1517 } | 1517 } |
1518 } | 1518 } |
1519 | 1519 |
1520 } // namespace | 1520 } // namespace |
1521 } // namespace cc | 1521 } // namespace cc |
OLD | NEW |