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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "cc/test/fake_content_layer_client.h" | 7 #include "cc/test/fake_content_layer_client.h" |
8 #include "cc/test/fake_picture_layer.h" | 8 #include "cc/test/fake_picture_layer.h" |
9 #include "cc/test/fake_picture_layer_impl.h" | 9 #include "cc/test/fake_picture_layer_impl.h" |
10 #include "cc/test/layer_tree_test.h" | 10 #include "cc/test/layer_tree_test.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Active while there are pending and active twins again. | 69 // Active while there are pending and active twins again. |
70 layer_tree_host()->SetNeedsCommit(); | 70 layer_tree_host()->SetNeedsCommit(); |
71 break; | 71 break; |
72 case 5: | 72 case 5: |
73 EndTest(); | 73 EndTest(); |
74 break; | 74 break; |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { | 78 void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { |
79 LayerImpl* active_root_impl = impl->active_tree()->root_layer(); | 79 LayerImpl* active_root_impl = impl->active_tree()->root_layer_for_testing(); |
80 int picture_id = impl->active_tree()->source_frame_number() < 2 | 80 int picture_id = impl->active_tree()->source_frame_number() < 2 |
81 ? picture_id1_ | 81 ? picture_id1_ |
82 : picture_id2_; | 82 : picture_id2_; |
83 | 83 |
84 if (!impl->pending_tree()->LayerById(picture_id)) { | 84 if (!impl->pending_tree()->LayerById(picture_id)) { |
85 EXPECT_EQ(2, activates_); | 85 EXPECT_EQ(2, activates_); |
86 return; | 86 return; |
87 } | 87 } |
88 | 88 |
89 FakePictureLayerImpl* pending_picture_impl = | 89 FakePictureLayerImpl* pending_picture_impl = |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 } | 283 } |
284 | 284 |
285 void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { | 285 void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { |
286 LayerImpl* child = impl->sync_tree()->LayerById(picture_->id()); | 286 LayerImpl* child = impl->sync_tree()->LayerById(picture_->id()); |
287 FakePictureLayerImpl* picture_impl = | 287 FakePictureLayerImpl* picture_impl = |
288 static_cast<FakePictureLayerImpl*>(child); | 288 static_cast<FakePictureLayerImpl*>(child); |
289 PictureLayerTiling* tiling = picture_impl->HighResTiling(); | 289 PictureLayerTiling* tiling = picture_impl->HighResTiling(); |
290 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); | 290 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); |
291 | 291 |
292 if (!impl->active_tree()->root_layer()) { | 292 if (!impl->active_tree()->root_layer_for_testing()) { |
293 // If active tree doesn't have the layer, then pending tree should have | 293 // If active tree doesn't have the layer, then pending tree should have |
294 // all needed tiles. | 294 // all needed tiles. |
295 EXPECT_TRUE(tiling->TileAt(0, 0)); | 295 EXPECT_TRUE(tiling->TileAt(0, 0)); |
296 } else { | 296 } else { |
297 // Since there was no invalidation, the pending tree shouldn't have any | 297 // Since there was no invalidation, the pending tree shouldn't have any |
298 // tiles. | 298 // tiles. |
299 EXPECT_FALSE(tiling->TileAt(0, 0)); | 299 EXPECT_FALSE(tiling->TileAt(0, 0)); |
300 } | 300 } |
301 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); | 301 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); |
302 | 302 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 int last_frame_drawn_; | 563 int last_frame_drawn_; |
564 bool ready_to_draw_; | 564 bool ready_to_draw_; |
565 }; | 565 }; |
566 | 566 |
567 // Multi-thread only because in single thread you can't pinch zoom on the | 567 // Multi-thread only because in single thread you can't pinch zoom on the |
568 // compositor thread. | 568 // compositor thread. |
569 MULTI_THREAD_TEST_F(LayerTreeHostPictureTestRSLLMembershipWithScale); | 569 MULTI_THREAD_TEST_F(LayerTreeHostPictureTestRSLLMembershipWithScale); |
570 | 570 |
571 } // namespace | 571 } // namespace |
572 } // namespace cc | 572 } // namespace cc |
OLD | NEW |