| 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 default_scheduler_settings; |
| 1793 scheduler_settings.using_synchronous_renderer_compositor = true; | 1793 StateMachine state(default_scheduler_settings); |
| 1794 StateMachine state(scheduler_settings); | |
| 1795 SET_UP_STATE(state) | 1794 SET_UP_STATE(state) |
| 1795 state.SetResourcelessSoftareDraw(true); |
| 1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); | 1796 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); |
| 1797 | 1797 |
| 1798 state.SetVisible(false); | 1798 state.SetVisible(false); |
| 1799 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); |
| 1800 |
| 1801 state.SetResourcelessSoftareDraw(false); |
| 1802 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); |
| 1803 |
| 1804 state.SetResourcelessSoftareDraw(true); |
| 1805 EXPECT_FALSE(state.PendingDrawsShouldBeAborted()); |
| 1806 |
| 1807 state.SetVisible(false); |
| 1799 state.DidLoseOutputSurface(); | 1808 state.DidLoseOutputSurface(); |
| 1800 | 1809 |
| 1801 state.SetCanDraw(false); | 1810 state.SetCanDraw(false); |
| 1802 state.WillBeginOutputSurfaceCreation(); | 1811 state.WillBeginOutputSurfaceCreation(); |
| 1803 state.DidCreateAndInitializeOutputSurface(); | 1812 state.DidCreateAndInitializeOutputSurface(); |
| 1804 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); | 1813 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); |
| 1805 | 1814 |
| 1806 state.SetCanDraw(true); | 1815 state.SetCanDraw(true); |
| 1807 state.DidLoseOutputSurface(); | 1816 state.DidLoseOutputSurface(); |
| 1808 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); | 1817 EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); | 2104 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); |
| 2096 bool commit_has_no_updates = true; | 2105 bool commit_has_no_updates = true; |
| 2097 state.WillCommit(commit_has_no_updates); | 2106 state.WillCommit(commit_has_no_updates); |
| 2098 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); | 2107 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); |
| 2099 state.OnBeginImplFrame(); | 2108 state.OnBeginImplFrame(); |
| 2100 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); | 2109 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); |
| 2101 } | 2110 } |
| 2102 | 2111 |
| 2103 } // namespace | 2112 } // namespace |
| 2104 } // namespace cc | 2113 } // namespace cc |
| OLD | NEW |