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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 kCompletedMainFrame, | 1604 kCompletedMainFrame, |
1605 kCompletedImplFrame, | 1605 kCompletedImplFrame, |
1606 }; | 1606 }; |
1607 | 1607 |
1608 LayerTreeHostTestCompositeImmediatelyStateTransitions() | 1608 LayerTreeHostTestCompositeImmediatelyStateTransitions() |
1609 : current_state_(kInvalid), current_begin_frame_args_() {} | 1609 : current_state_(kInvalid), current_begin_frame_args_() {} |
1610 | 1610 |
1611 void InitializeSettings(LayerTreeSettings* settings) override { | 1611 void InitializeSettings(LayerTreeSettings* settings) override { |
1612 settings->single_thread_proxy_scheduler = false; | 1612 settings->single_thread_proxy_scheduler = false; |
1613 settings->use_zero_copy = true; | 1613 settings->use_zero_copy = true; |
1614 settings->use_one_copy = false; | |
1615 } | 1614 } |
1616 | 1615 |
1617 void BeginTest() override { | 1616 void BeginTest() override { |
1618 current_state_ = kStartedTest; | 1617 current_state_ = kStartedTest; |
1619 PostCompositeImmediatelyToMainThread(); | 1618 PostCompositeImmediatelyToMainThread(); |
1620 } | 1619 } |
1621 | 1620 |
1622 void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, | 1621 void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, |
1623 const BeginFrameArgs& args) override { | 1622 const BeginFrameArgs& args) override { |
1624 EXPECT_EQ(current_state_, kStartedTest); | 1623 EXPECT_EQ(current_state_, kStartedTest); |
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3599 scoped_refptr<FakePictureLayer> root_layer_; | 3598 scoped_refptr<FakePictureLayer> root_layer_; |
3600 }; | 3599 }; |
3601 | 3600 |
3602 MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport); | 3601 MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport); |
3603 | 3602 |
3604 class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { | 3603 class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { |
3605 protected: | 3604 protected: |
3606 void InitializeSettings(LayerTreeSettings* settings) override { | 3605 void InitializeSettings(LayerTreeSettings* settings) override { |
3607 // Testing async uploads. | 3606 // Testing async uploads. |
3608 settings->use_zero_copy = false; | 3607 settings->use_zero_copy = false; |
3609 settings->use_one_copy = false; | |
3610 } | 3608 } |
3611 | 3609 |
3612 scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { | 3610 scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { |
3613 scoped_refptr<TestContextProvider> context_provider = | 3611 scoped_refptr<TestContextProvider> context_provider = |
3614 TestContextProvider::Create(); | 3612 TestContextProvider::Create(); |
3615 context_provider->SetMaxTransferBufferUsageBytes(512 * 512); | 3613 context_provider->SetMaxTransferBufferUsageBytes(512 * 512); |
3616 if (delegating_renderer()) | 3614 if (delegating_renderer()) |
3617 return FakeOutputSurface::CreateDelegating3d(context_provider); | 3615 return FakeOutputSurface::CreateDelegating3d(context_provider); |
3618 else | 3616 else |
3619 return FakeOutputSurface::Create3d(context_provider); | 3617 return FakeOutputSurface::Create3d(context_provider); |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4634 | 4632 |
4635 // Do a synchronous composite and assert that the swap promise succeeds. | 4633 // Do a synchronous composite and assert that the swap promise succeeds. |
4636 class LayerTreeHostTestSynchronousCompositeSwapPromise | 4634 class LayerTreeHostTestSynchronousCompositeSwapPromise |
4637 : public LayerTreeHostTest { | 4635 : public LayerTreeHostTest { |
4638 public: | 4636 public: |
4639 LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {} | 4637 LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {} |
4640 | 4638 |
4641 void InitializeSettings(LayerTreeSettings* settings) override { | 4639 void InitializeSettings(LayerTreeSettings* settings) override { |
4642 settings->single_thread_proxy_scheduler = false; | 4640 settings->single_thread_proxy_scheduler = false; |
4643 settings->use_zero_copy = true; | 4641 settings->use_zero_copy = true; |
4644 settings->use_one_copy = false; | |
4645 } | 4642 } |
4646 | 4643 |
4647 void BeginTest() override { | 4644 void BeginTest() override { |
4648 // Successful composite. | 4645 // Successful composite. |
4649 scoped_ptr<SwapPromise> swap_promise0( | 4646 scoped_ptr<SwapPromise> swap_promise0( |
4650 new TestSwapPromise(&swap_promise_result_[0])); | 4647 new TestSwapPromise(&swap_promise_result_[0])); |
4651 layer_tree_host()->QueueSwapPromise(swap_promise0.Pass()); | 4648 layer_tree_host()->QueueSwapPromise(swap_promise0.Pass()); |
4652 layer_tree_host()->Composite(base::TimeTicks::Now()); | 4649 layer_tree_host()->Composite(base::TimeTicks::Now()); |
4653 | 4650 |
4654 // Fail to swap (no damage). | 4651 // Fail to swap (no damage). |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4939 }; | 4936 }; |
4940 | 4937 |
4941 // This test does pinching on the impl side which is not supported in single | 4938 // This test does pinching on the impl side which is not supported in single |
4942 // thread. | 4939 // thread. |
4943 MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEnds); | 4940 MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEnds); |
4944 | 4941 |
4945 class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy | 4942 class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy |
4946 : public LayerTreeHostTestCrispUpAfterPinchEnds { | 4943 : public LayerTreeHostTestCrispUpAfterPinchEnds { |
4947 protected: | 4944 protected: |
4948 void InitializeSettings(LayerTreeSettings* settings) override { | 4945 void InitializeSettings(LayerTreeSettings* settings) override { |
4949 settings->use_one_copy = true; | |
4950 } | 4946 } |
4951 | 4947 |
4952 scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { | 4948 scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { |
4953 scoped_ptr<TestWebGraphicsContext3D> context3d = | 4949 scoped_ptr<TestWebGraphicsContext3D> context3d = |
4954 TestWebGraphicsContext3D::Create(); | 4950 TestWebGraphicsContext3D::Create(); |
4955 context3d->set_support_image(true); | 4951 context3d->set_support_image(true); |
4956 context3d->set_support_sync_query(true); | 4952 context3d->set_support_sync_query(true); |
4957 #if defined(OS_MACOSX) | 4953 #if defined(OS_MACOSX) |
4958 context3d->set_support_texture_rectangle(true); | 4954 context3d->set_support_texture_rectangle(true); |
4959 #endif | 4955 #endif |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6036 void AfterTest() override {} | 6032 void AfterTest() override {} |
6037 | 6033 |
6038 std::vector<int> affected_by_page_scale_; | 6034 std::vector<int> affected_by_page_scale_; |
6039 std::vector<int> not_affected_by_page_scale_; | 6035 std::vector<int> not_affected_by_page_scale_; |
6040 }; | 6036 }; |
6041 | 6037 |
6042 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeTestPageScaleFlags); | 6038 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeTestPageScaleFlags); |
6043 | 6039 |
6044 } // namespace | 6040 } // namespace |
6045 } // namespace cc | 6041 } // namespace cc |
OLD | NEW |