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/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 EXPECT_EQ(commit_complete_count_, 2); | 2700 EXPECT_EQ(commit_complete_count_, 2); |
2701 } | 2701 } |
2702 | 2702 |
2703 int commit_count_; | 2703 int commit_count_; |
2704 int commit_abort_count_; | 2704 int commit_abort_count_; |
2705 int commit_complete_count_; | 2705 int commit_complete_count_; |
2706 }; | 2706 }; |
2707 | 2707 |
2708 class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor | 2708 class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor |
2709 : public LayerTreeHostTestAbortedCommitDoesntStall { | 2709 : public LayerTreeHostTestAbortedCommitDoesntStall { |
| 2710 protected: |
2710 void InitializeSettings(LayerTreeSettings* settings) override { | 2711 void InitializeSettings(LayerTreeSettings* settings) override { |
2711 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); | 2712 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); |
2712 settings->using_synchronous_renderer_compositor = true; | 2713 settings->using_synchronous_renderer_compositor = true; |
2713 } | 2714 } |
| 2715 |
| 2716 void ScheduledActionInvalidateOutputSurface() override { |
| 2717 ImplThreadTaskRunner()->PostTask( |
| 2718 FROM_HERE, |
| 2719 base::Bind( |
| 2720 &LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor:: |
| 2721 CallOnDraw, |
| 2722 base::Unretained(this))); |
| 2723 } |
| 2724 |
| 2725 void CallOnDraw() { |
| 2726 // Synchronous compositor does not draw unless told to do so by the output |
| 2727 // surface. |
| 2728 output_surface()->client()->OnDraw(); |
| 2729 } |
2714 }; | 2730 }; |
2715 | 2731 |
2716 MULTI_THREAD_TEST_F( | 2732 MULTI_THREAD_TEST_F( |
2717 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor); | 2733 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor); |
2718 | 2734 |
2719 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync | 2735 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync |
2720 : public LayerTreeHostTestAbortedCommitDoesntStall { | 2736 : public LayerTreeHostTestAbortedCommitDoesntStall { |
2721 void InitializeSettings(LayerTreeSettings* settings) override { | 2737 void InitializeSettings(LayerTreeSettings* settings) override { |
2722 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); | 2738 LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); |
2723 settings->throttle_frame_production = false; | 2739 settings->throttle_frame_production = false; |
(...skipping 3905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6629 | 6645 |
6630 void AfterTest() override {} | 6646 void AfterTest() override {} |
6631 | 6647 |
6632 private: | 6648 private: |
6633 scoped_refptr<Layer> child_; | 6649 scoped_refptr<Layer> child_; |
6634 }; | 6650 }; |
6635 | 6651 |
6636 SINGLE_AND_MULTI_THREAD_TEST_F(LayerPreserveRenderSurfaceFromOutputRequests); | 6652 SINGLE_AND_MULTI_THREAD_TEST_F(LayerPreserveRenderSurfaceFromOutputRequests); |
6637 | 6653 |
6638 } // namespace cc | 6654 } // namespace cc |
OLD | NEW |