| 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 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 state.SetNeedsBeginMainFrame(); | 1894 state.SetNeedsBeginMainFrame(); |
| 1895 state.OnBeginImplFrame(); | 1895 state.OnBeginImplFrame(); |
| 1896 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE); | 1896 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE); |
| 1897 EXPECT_ACTION_UPDATE_STATE( | 1897 EXPECT_ACTION_UPDATE_STATE( |
| 1898 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); | 1898 SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); |
| 1899 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1899 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
| 1900 | 1900 |
| 1901 // Verify the deadline is not triggered early until we enter | 1901 // Verify the deadline is not triggered early until we enter |
| 1902 // prefer impl latency mode. | 1902 // prefer impl latency mode. |
| 1903 EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineImmediately()); | 1903 EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineImmediately()); |
| 1904 state.SetImplLatencyTakesPriority(true); | 1904 state.SetSmoothnessMode(SMOOTHNESS_TAKES_PRIORITY, |
| 1905 SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER); |
| 1905 EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineImmediately()); | 1906 EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineImmediately()); |
| 1906 | 1907 |
| 1907 // Trigger the deadline. | 1908 // Trigger the deadline. |
| 1908 state.OnBeginImplFrameDeadline(); | 1909 state.OnBeginImplFrameDeadline(); |
| 1909 EXPECT_ACTION_UPDATE_STATE( | 1910 EXPECT_ACTION_UPDATE_STATE( |
| 1910 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); | 1911 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); |
| 1911 state.DidSwapBuffers(); | 1912 state.DidSwapBuffers(); |
| 1912 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1913 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
| 1913 state.DidSwapBuffersComplete(); | 1914 state.DidSwapBuffersComplete(); |
| 1914 | 1915 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); | 2130 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); |
| 2130 bool commit_has_no_updates = true; | 2131 bool commit_has_no_updates = true; |
| 2131 state.WillCommit(commit_has_no_updates); | 2132 state.WillCommit(commit_has_no_updates); |
| 2132 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); | 2133 EXPECT_TRUE(state.ProactiveBeginFrameWanted()); |
| 2133 state.OnBeginImplFrame(); | 2134 state.OnBeginImplFrame(); |
| 2134 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); | 2135 EXPECT_FALSE(state.ProactiveBeginFrameWanted()); |
| 2135 } | 2136 } |
| 2136 | 2137 |
| 2137 } // namespace | 2138 } // namespace |
| 2138 } // namespace cc | 2139 } // namespace cc |
| OLD | NEW |