Chromium Code Reviews| 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/scheduler/scheduler_state_machine.h" | 5 #include "cc/scheduler/scheduler_state_machine.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "cc/scheduler/scheduler.h" | 8 #include "cc/scheduler/scheduler.h" |
| 9 #include "cc/test/begin_frame_args_test.h" | 9 #include "cc/test/begin_frame_args_test.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1781 | 1781 |
| 1782 state.SetCanDraw(false); | 1782 state.SetCanDraw(false); |
| 1783 state.SetVisible(false); | 1783 state.SetVisible(false); |
| 1784 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); | 1784 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); |
| 1785 | 1785 |
| 1786 state.SetCanDraw(true); | 1786 state.SetCanDraw(true); |
| 1787 state.SetVisible(true); | 1787 state.SetVisible(true); |
| 1788 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); | 1788 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 TEST(SchedulerStateMachineTest, ForceDrawForSynchronousCompositor) { | 1791 TEST(SchedulerStateMachineTest, ForceDrawForResourcelessSoftwareDraw) { |
| 1792 SchedulerSettings scheduler_settings; | 1792 SchedulerSettings scheduler_settings; |
| 1793 scheduler_settings.using_synchronous_renderer_compositor = true; | |
| 1794 StateMachine state(scheduler_settings); | 1793 StateMachine state(scheduler_settings); |
| 1794 state.SetResourcelessSoftareDraw(true); | |
|
brianderson
2015/10/21 22:43:04
Since this is a dynamic setting now, can you updat
boliu
2015/10/21 23:04:44
Done.
| |
| 1795 SET_UP_STATE(state) | 1795 SET_UP_STATE(state) |
| 1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); | 1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); |
| 1797 | 1797 |
| 1798 state.SetVisible(false); | 1798 state.SetVisible(false); |
| 1799 state.DidLoseOutputSurface(); | 1799 state.DidLoseOutputSurface(); |
| 1800 | 1800 |
| 1801 state.SetCanDraw(false); | 1801 state.SetCanDraw(false); |
| 1802 state.WillBeginOutputSurfaceCreation(); | 1802 state.WillBeginOutputSurfaceCreation(); |
| 1803 state.DidCreateAndInitializeOutputSurface(); | 1803 state.DidCreateAndInitializeOutputSurface(); |
| 1804 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); | 1804 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2095 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); | 2095 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); |
| 2096 bool commit_has_no_updates = true; | 2096 bool commit_has_no_updates = true; |
| 2097 state.WillCommit(commit_has_no_updates); | 2097 state.WillCommit(commit_has_no_updates); |
| 2098 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); | 2098 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); |
| 2099 state.OnBeginImplFrame(); | 2099 state.OnBeginImplFrame(); |
| 2100 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); | 2100 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); |
| 2101 } | 2101 } |
| 2102 | 2102 |
| 2103 } // namespace | 2103 } // namespace |
| 2104 } // namespace cc | 2104 } // namespace cc |
| OLD | NEW |