| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_COMPOSITOR_TEST_DRAW_WAITER_H_ | 5 #ifndef UI_COMPOSITOR_TEST_DRAW_WAITER_H_ |
| 6 #define UI_COMPOSITOR_TEST_DRAW_WAITER_H_ | 6 #define UI_COMPOSITOR_TEST_DRAW_WAITER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Waits for a commit instead of a draw. | 28 // Waits for a commit instead of a draw. |
| 29 static void WaitForCommit(Compositor* compositor); | 29 static void WaitForCommit(Compositor* compositor); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 enum WaitEvent { | 32 enum WaitEvent { |
| 33 WAIT_FOR_COMMIT, | 33 WAIT_FOR_COMMIT, |
| 34 WAIT_FOR_COMPOSITING_STARTED, | 34 WAIT_FOR_COMPOSITING_STARTED, |
| 35 }; | 35 }; |
| 36 DrawWaiterForTest(WaitEvent wait_event); | 36 DrawWaiterForTest(WaitEvent wait_event); |
| 37 ~DrawWaiterForTest(); | 37 ~DrawWaiterForTest() override; |
| 38 | 38 |
| 39 void WaitImpl(Compositor* compositor); | 39 void WaitImpl(Compositor* compositor); |
| 40 | 40 |
| 41 // CompositorObserver implementation. | 41 // CompositorObserver implementation. |
| 42 void OnCompositingDidCommit(Compositor* compositor) override; | 42 void OnCompositingDidCommit(Compositor* compositor) override; |
| 43 void OnCompositingStarted(Compositor* compositor, | 43 void OnCompositingStarted(Compositor* compositor, |
| 44 base::TimeTicks start_time) override; | 44 base::TimeTicks start_time) override; |
| 45 void OnCompositingLockStateChanged(Compositor* compositor) override; | 45 void OnCompositingLockStateChanged(Compositor* compositor) override; |
| 46 void OnCompositingShuttingDown(Compositor* compositor) override; | 46 void OnCompositingShuttingDown(Compositor* compositor) override; |
| 47 | 47 |
| 48 std::unique_ptr<base::RunLoop> wait_run_loop_; | 48 std::unique_ptr<base::RunLoop> wait_run_loop_; |
| 49 | 49 |
| 50 WaitEvent wait_event_; | 50 WaitEvent wait_event_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(DrawWaiterForTest); | 52 DISALLOW_COPY_AND_ASSIGN(DrawWaiterForTest); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace ui | 55 } // namespace ui |
| 56 | 56 |
| 57 #endif // UI_COMPOSITOR_TEST_DRAW_WAITER_H_ | 57 #endif // UI_COMPOSITOR_TEST_DRAW_WAITER_H_ |
| OLD | NEW |