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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 ~FakeExternalBeginFrameSource() override; | 28 ~FakeExternalBeginFrameSource() override; |
29 | 29 |
30 void SetClient(Client* client) { client_ = client; } | 30 void SetClient(Client* client) { client_ = client; } |
31 void SetPaused(bool paused); | 31 void SetPaused(bool paused); |
32 | 32 |
33 // BeginFrameSource implementation. | 33 // BeginFrameSource implementation. |
34 void AddObserver(BeginFrameObserver* obs) override; | 34 void AddObserver(BeginFrameObserver* obs) override; |
35 void RemoveObserver(BeginFrameObserver* obs) override; | 35 void RemoveObserver(BeginFrameObserver* obs) override; |
36 void DidFinishFrame(BeginFrameObserver* obs, | 36 void DidFinishFrame(BeginFrameObserver* obs, |
37 size_t remaining_frames) override {} | 37 size_t remaining_frames) override {} |
| 38 bool IsThrottled() const override; |
38 | 39 |
39 void TestOnBeginFrame(const BeginFrameArgs& args); | 40 void TestOnBeginFrame(const BeginFrameArgs& args); |
40 | 41 |
41 size_t num_observers() const { return observers_.size(); } | 42 size_t num_observers() const { return observers_.size(); } |
42 | 43 |
43 private: | 44 private: |
44 void PostTestOnBeginFrame(); | 45 void PostTestOnBeginFrame(); |
45 | 46 |
46 const bool tick_automatically_; | 47 const bool tick_automatically_; |
47 const double milliseconds_per_frame_; | 48 const double milliseconds_per_frame_; |
48 Client* client_ = nullptr; | 49 Client* client_ = nullptr; |
49 bool paused_ = false; | 50 bool paused_ = false; |
50 std::set<BeginFrameObserver*> observers_; | 51 std::set<BeginFrameObserver*> observers_; |
51 base::CancelableCallback<void(const BeginFrameArgs&)> begin_frame_task_; | 52 base::CancelableCallback<void(const BeginFrameArgs&)> begin_frame_task_; |
52 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; | 53 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; |
53 }; | 54 }; |
54 | 55 |
55 } // namespace cc | 56 } // namespace cc |
56 | 57 |
57 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ | 58 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |