| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 4794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4805 std::vector<BeginFrameArgs> impl_frame_args_; | 4805 std::vector<BeginFrameArgs> impl_frame_args_; |
| 4806 int will_begin_impl_frame_count_; | 4806 int will_begin_impl_frame_count_; |
| 4807 }; | 4807 }; |
| 4808 | 4808 |
| 4809 // TODO(mithro): Re-enable the multi-threaded version of this test | 4809 // TODO(mithro): Re-enable the multi-threaded version of this test |
| 4810 // http://crbug.com/537621 | 4810 // http://crbug.com/537621 |
| 4811 // SINGLE_AND_MULTI_THREAD_TEST_F( | 4811 // SINGLE_AND_MULTI_THREAD_TEST_F( |
| 4812 // LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime); | 4812 // LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime); |
| 4813 SINGLE_THREAD_TEST_F(LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime); | 4813 SINGLE_THREAD_TEST_F(LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime); |
| 4814 | 4814 |
| 4815 class LayerTreeHostTestSendBeginFramesToChildren : public LayerTreeHostTest { | |
| 4816 public: | |
| 4817 LayerTreeHostTestSendBeginFramesToChildren() | |
| 4818 : begin_frame_sent_to_children_(false) { | |
| 4819 } | |
| 4820 | |
| 4821 void BeginTest() override { | |
| 4822 // Kick off the test with a commit. | |
| 4823 PostSetNeedsCommitToMainThread(); | |
| 4824 } | |
| 4825 | |
| 4826 void SendBeginFramesToChildren(const BeginFrameArgs& args) override { | |
| 4827 begin_frame_sent_to_children_ = true; | |
| 4828 EndTest(); | |
| 4829 } | |
| 4830 | |
| 4831 void DidBeginMainFrame() override { | |
| 4832 // Children requested BeginFrames. | |
| 4833 layer_tree_host()->SetChildrenNeedBeginFrames(true); | |
| 4834 } | |
| 4835 | |
| 4836 void AfterTest() override { | |
| 4837 // Ensure that BeginFrame message is sent to children during parent | |
| 4838 // scheduler handles its BeginFrame. | |
| 4839 EXPECT_TRUE(begin_frame_sent_to_children_); | |
| 4840 } | |
| 4841 | |
| 4842 private: | |
| 4843 bool begin_frame_sent_to_children_; | |
| 4844 }; | |
| 4845 | |
| 4846 SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildren); | |
| 4847 | |
| 4848 class LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS | |
| 4849 : public LayerTreeHostTest { | |
| 4850 public: | |
| 4851 LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS() | |
| 4852 : begin_frame_sent_to_children_(false) { | |
| 4853 } | |
| 4854 | |
| 4855 void InitializeSettings(LayerTreeSettings* settings) override { | |
| 4856 settings->use_external_begin_frame_source = true; | |
| 4857 } | |
| 4858 | |
| 4859 void BeginTest() override { | |
| 4860 // Kick off the test with a commit. | |
| 4861 PostSetNeedsCommitToMainThread(); | |
| 4862 } | |
| 4863 | |
| 4864 void SendBeginFramesToChildren(const BeginFrameArgs& args) override { | |
| 4865 begin_frame_sent_to_children_ = true; | |
| 4866 EndTest(); | |
| 4867 } | |
| 4868 | |
| 4869 void DidBeginMainFrame() override { | |
| 4870 // Children requested BeginFrames. | |
| 4871 layer_tree_host()->SetChildrenNeedBeginFrames(true); | |
| 4872 } | |
| 4873 | |
| 4874 void AfterTest() override { | |
| 4875 // Ensure that BeginFrame message is sent to children during parent | |
| 4876 // scheduler handles its BeginFrame. | |
| 4877 EXPECT_TRUE(begin_frame_sent_to_children_); | |
| 4878 } | |
| 4879 | |
| 4880 private: | |
| 4881 bool begin_frame_sent_to_children_; | |
| 4882 }; | |
| 4883 | |
| 4884 SINGLE_THREAD_TEST_F(LayerTreeHostTestSendBeginFramesToChildrenWithExternalBFS); | |
| 4885 | |
| 4886 class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { | 4815 class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { |
| 4887 public: | 4816 public: |
| 4888 LayerTreeHostTestActivateOnInvisible() | 4817 LayerTreeHostTestActivateOnInvisible() |
| 4889 : activation_count_(0), visible_(true) {} | 4818 : activation_count_(0), visible_(true) {} |
| 4890 | 4819 |
| 4891 void BeginTest() override { | 4820 void BeginTest() override { |
| 4892 // Kick off the test with a commit. | 4821 // Kick off the test with a commit. |
| 4893 PostSetNeedsCommitToMainThread(); | 4822 PostSetNeedsCommitToMainThread(); |
| 4894 } | 4823 } |
| 4895 | 4824 |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6467 EndTest(); | 6396 EndTest(); |
| 6468 } | 6397 } |
| 6469 | 6398 |
| 6470 void AfterTest() override {} | 6399 void AfterTest() override {} |
| 6471 }; | 6400 }; |
| 6472 | 6401 |
| 6473 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6402 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6474 | 6403 |
| 6475 } // namespace | 6404 } // namespace |
| 6476 } // namespace cc | 6405 } // namespace cc |
| OLD | NEW |