| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "cc/layers/heads_up_display_layer.h" | 9 #include "cc/layers/heads_up_display_layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 if (num_commits_ > 1) | 748 if (num_commits_ > 1) |
| 749 return; | 749 return; |
| 750 ++num_commits_; | 750 ++num_commits_; |
| 751 if (!lose_after_evict_) { | 751 if (!lose_after_evict_) { |
| 752 LoseContext(); | 752 LoseContext(); |
| 753 lost_context_ = true; | 753 lost_context_ = true; |
| 754 } | 754 } |
| 755 } | 755 } |
| 756 | 756 |
| 757 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { | 757 void DrawLayersOnThread(LayerTreeHostImpl* impl) override { |
| 758 FakePictureLayerImpl* picture_impl = | 758 FakePictureLayerImpl* picture_impl = static_cast<FakePictureLayerImpl*>( |
| 759 static_cast<FakePictureLayerImpl*>(impl->active_tree()->root_layer()); | 759 impl->active_tree()->root_layer_for_testing()); |
| 760 EXPECT_TRUE(picture_impl->HighResTiling() | 760 EXPECT_TRUE(picture_impl->HighResTiling() |
| 761 ->TileAt(0, 0) | 761 ->TileAt(0, 0) |
| 762 ->draw_info() | 762 ->draw_info() |
| 763 .IsReadyToDraw()); | 763 .IsReadyToDraw()); |
| 764 | 764 |
| 765 impl_host_ = impl; | 765 impl_host_ = impl; |
| 766 if (lost_context_) | 766 if (lost_context_) |
| 767 EndTest(); | 767 EndTest(); |
| 768 } | 768 } |
| 769 | 769 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 848 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 849 | 849 |
| 850 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { | 850 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { |
| 851 LayerTreeHostContextTest::DidActivateTreeOnThread(host_impl); | 851 LayerTreeHostContextTest::DidActivateTreeOnThread(host_impl); |
| 852 | 852 |
| 853 FakePictureLayerImpl* root_picture = NULL; | 853 FakePictureLayerImpl* root_picture = NULL; |
| 854 FakePictureLayerImpl* child_picture = NULL; | 854 FakePictureLayerImpl* child_picture = NULL; |
| 855 FakePictureLayerImpl* grandchild_picture = NULL; | 855 FakePictureLayerImpl* grandchild_picture = NULL; |
| 856 | 856 |
| 857 root_picture = static_cast<FakePictureLayerImpl*>( | 857 root_picture = static_cast<FakePictureLayerImpl*>( |
| 858 host_impl->active_tree()->root_layer()); | 858 host_impl->active_tree()->root_layer_for_testing()); |
| 859 child_picture = static_cast<FakePictureLayerImpl*>( | 859 child_picture = static_cast<FakePictureLayerImpl*>( |
| 860 host_impl->active_tree()->LayerById(child_->id())); | 860 host_impl->active_tree()->LayerById(child_->id())); |
| 861 grandchild_picture = static_cast<FakePictureLayerImpl*>( | 861 grandchild_picture = static_cast<FakePictureLayerImpl*>( |
| 862 host_impl->active_tree()->LayerById(grandchild_->id())); | 862 host_impl->active_tree()->LayerById(grandchild_->id())); |
| 863 | 863 |
| 864 ++num_commits_; | 864 ++num_commits_; |
| 865 switch (num_commits_) { | 865 switch (num_commits_) { |
| 866 case 1: | 866 case 1: |
| 867 EXPECT_EQ(0u, root_picture->release_resources_count()); | 867 EXPECT_EQ(0u, root_picture->release_resources_count()); |
| 868 EXPECT_EQ(0u, child_picture->release_resources_count()); | 868 EXPECT_EQ(0u, child_picture->release_resources_count()); |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 void AfterTest() override {} | 1603 void AfterTest() override {} |
| 1604 | 1604 |
| 1605 bool deferred_; | 1605 bool deferred_; |
| 1606 }; | 1606 }; |
| 1607 | 1607 |
| 1608 SINGLE_AND_MULTI_THREAD_TEST_F( | 1608 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1609 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1609 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
| 1610 | 1610 |
| 1611 } // namespace | 1611 } // namespace |
| 1612 } // namespace cc | 1612 } // namespace cc |
| OLD | NEW |