| 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/debug/trace_event.h" |
| 7 #include "cc/scheduler/scheduler.h" | 8 #include "cc/scheduler/scheduler.h" |
| 8 #include "cc/test/begin_frame_args_test.h" | 9 #include "cc/test/begin_frame_args_test.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 #define EXPECT_ACTION_UPDATE_STATE(action) \ | 12 #define EXPECT_ACTION_UPDATE_STATE(action) \ |
| 12 EXPECT_EQ(action, state.NextAction()) << *state.AsValue(); \ | 13 EXPECT_EQ(action, state.NextAction()) << state.AsValue()->ToString(); \ |
| 13 if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \ | 14 if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \ |
| 14 action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \ | 15 action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \ |
| 15 EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \ | 16 EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \ |
| 16 state.begin_impl_frame_state()) \ | 17 state.begin_impl_frame_state()) \ |
| 17 << *state.AsValue(); \ | 18 << state.AsValue()->ToString(); \ |
| 18 } \ | 19 } \ |
| 19 state.UpdateState(action); \ | 20 state.UpdateState(action); \ |
| 20 if (action == SchedulerStateMachine::ACTION_NONE) { \ | 21 if (action == SchedulerStateMachine::ACTION_NONE) { \ |
| 21 if (state.begin_impl_frame_state() == \ | 22 if (state.begin_impl_frame_state() == \ |
| 22 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING) \ | 23 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING) \ |
| 23 state.OnBeginImplFrameDeadlinePending(); \ | 24 state.OnBeginImplFrameDeadlinePending(); \ |
| 24 if (state.begin_impl_frame_state() == \ | 25 if (state.begin_impl_frame_state() == \ |
| 25 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) \ | 26 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) \ |
| 26 state.OnBeginImplFrameIdle(); \ | 27 state.OnBeginImplFrameIdle(); \ |
| 27 } | 28 } |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 state.SetNeedsAnimate(); | 1900 state.SetNeedsAnimate(); |
| 1900 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); | 1901 EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE); |
| 1901 | 1902 |
| 1902 state.OnBeginImplFrameDeadline(); | 1903 state.OnBeginImplFrameDeadline(); |
| 1903 EXPECT_ACTION_UPDATE_STATE( | 1904 EXPECT_ACTION_UPDATE_STATE( |
| 1904 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); | 1905 SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE); |
| 1905 } | 1906 } |
| 1906 | 1907 |
| 1907 } // namespace | 1908 } // namespace |
| 1908 } // namespace cc | 1909 } // namespace cc |
| OLD | NEW |