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 CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 5 #ifndef CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
6 #define CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 6 #define CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
| 13 #include "cc/output/begin_frame_args.h" |
13 #include "cc/scheduler/begin_frame_source.h" | 14 #include "cc/scheduler/begin_frame_source.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 | 17 |
17 class FakeExternalBeginFrameSource | 18 class FakeExternalBeginFrameSource |
18 : public BeginFrameSource, | 19 : public BeginFrameSource, |
19 public NON_EXPORTED_BASE(base::NonThreadSafe) { | 20 public NON_EXPORTED_BASE(base::NonThreadSafe) { |
20 public: | 21 public: |
21 class Client { | 22 class Client { |
22 public: | 23 public: |
(...skipping 19 matching lines...) Expand all Loading... |
42 | 43 |
43 size_t num_observers() const { return observers_.size(); } | 44 size_t num_observers() const { return observers_.size(); } |
44 | 45 |
45 private: | 46 private: |
46 void PostTestOnBeginFrame(); | 47 void PostTestOnBeginFrame(); |
47 | 48 |
48 const bool tick_automatically_; | 49 const bool tick_automatically_; |
49 const double milliseconds_per_frame_; | 50 const double milliseconds_per_frame_; |
50 Client* client_ = nullptr; | 51 Client* client_ = nullptr; |
51 bool paused_ = false; | 52 bool paused_ = false; |
| 53 uint64_t next_begin_frame_number_ = BeginFrameArgs::kStartingFrameNumber; |
52 std::set<BeginFrameObserver*> observers_; | 54 std::set<BeginFrameObserver*> observers_; |
53 base::CancelableCallback<void(const BeginFrameArgs&)> begin_frame_task_; | 55 base::CancelableCallback<void(const BeginFrameArgs&)> begin_frame_task_; |
54 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; | 56 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; |
55 }; | 57 }; |
56 | 58 |
57 } // namespace cc | 59 } // namespace cc |
58 | 60 |
59 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 61 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |