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 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 kCompletedCommit, | 2357 kCompletedCommit, |
2358 kCompletedMainFrame, | 2358 kCompletedMainFrame, |
2359 kCompletedImplFrame, | 2359 kCompletedImplFrame, |
2360 }; | 2360 }; |
2361 | 2361 |
2362 LayerTreeHostTestCompositeImmediatelyStateTransitions() | 2362 LayerTreeHostTestCompositeImmediatelyStateTransitions() |
2363 : current_state_(kInvalid), current_begin_frame_args_() {} | 2363 : current_state_(kInvalid), current_begin_frame_args_() {} |
2364 | 2364 |
2365 void InitializeSettings(LayerTreeSettings* settings) override { | 2365 void InitializeSettings(LayerTreeSettings* settings) override { |
2366 settings->single_thread_proxy_scheduler = false; | 2366 settings->single_thread_proxy_scheduler = false; |
| 2367 settings->use_zero_copy = true; |
2367 } | 2368 } |
2368 | 2369 |
2369 void BeginTest() override { | 2370 void BeginTest() override { |
2370 current_state_ = kStartedTest; | 2371 current_state_ = kStartedTest; |
2371 PostCompositeImmediatelyToMainThread(); | 2372 PostCompositeImmediatelyToMainThread(); |
2372 } | 2373 } |
2373 | 2374 |
2374 void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, | 2375 void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, |
2375 const BeginFrameArgs& args) override { | 2376 const BeginFrameArgs& args) override { |
2376 EXPECT_EQ(current_state_, kStartedTest); | 2377 EXPECT_EQ(current_state_, kStartedTest); |
(...skipping 3467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5844 MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible); | 5845 MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible); |
5845 | 5846 |
5846 // Do a synchronous composite and assert that the swap promise succeeds. | 5847 // Do a synchronous composite and assert that the swap promise succeeds. |
5847 class LayerTreeHostTestSynchronousCompositeSwapPromise | 5848 class LayerTreeHostTestSynchronousCompositeSwapPromise |
5848 : public LayerTreeHostTest { | 5849 : public LayerTreeHostTest { |
5849 public: | 5850 public: |
5850 LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {} | 5851 LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {} |
5851 | 5852 |
5852 void InitializeSettings(LayerTreeSettings* settings) override { | 5853 void InitializeSettings(LayerTreeSettings* settings) override { |
5853 settings->single_thread_proxy_scheduler = false; | 5854 settings->single_thread_proxy_scheduler = false; |
| 5855 settings->use_zero_copy = true; |
5854 } | 5856 } |
5855 | 5857 |
5856 void BeginTest() override { | 5858 void BeginTest() override { |
5857 // Successful composite. | 5859 // Successful composite. |
5858 scoped_ptr<SwapPromise> swap_promise0( | 5860 scoped_ptr<SwapPromise> swap_promise0( |
5859 new TestSwapPromise(&swap_promise_result_[0])); | 5861 new TestSwapPromise(&swap_promise_result_[0])); |
5860 layer_tree_host()->QueueSwapPromise(swap_promise0.Pass()); | 5862 layer_tree_host()->QueueSwapPromise(swap_promise0.Pass()); |
5861 layer_tree_host()->Composite(gfx::FrameTime::Now()); | 5863 layer_tree_host()->Composite(gfx::FrameTime::Now()); |
5862 | 5864 |
5863 // Fail to swap (no damage). | 5865 // Fail to swap (no damage). |
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7256 void AfterTest() override {} | 7258 void AfterTest() override {} |
7257 | 7259 |
7258 scoped_refptr<FakePictureLayer> content_child_layer_; | 7260 scoped_refptr<FakePictureLayer> content_child_layer_; |
7259 FakeContentLayerClient client_; | 7261 FakeContentLayerClient client_; |
7260 }; | 7262 }; |
7261 | 7263 |
7262 SINGLE_AND_MULTI_THREAD_TEST_F( | 7264 SINGLE_AND_MULTI_THREAD_TEST_F( |
7263 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); | 7265 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); |
7264 | 7266 |
7265 } // namespace cc | 7267 } // namespace cc |
OLD | NEW |