OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
| 6 #define CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/scheduler/begin_frame_source.h" |
| 10 |
| 11 namespace cc { |
| 12 |
| 13 class FakeExternalBeginFrameSource |
| 14 : public BeginFrameSourceMixIn, |
| 15 public NON_EXPORTED_BASE(base::NonThreadSafe) { |
| 16 public: |
| 17 explicit FakeExternalBeginFrameSource(double refresh_rate); |
| 18 virtual ~FakeExternalBeginFrameSource(); |
| 19 |
| 20 bool is_ready() const { return is_ready_; } |
| 21 |
| 22 // BeginFrameSource implementation. |
| 23 void SetClientReady() override; |
| 24 |
| 25 // BeginFrameSourceMixIn overrides. |
| 26 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
| 27 |
| 28 void TestOnBeginFrame(); |
| 29 |
| 30 private: |
| 31 double milliseconds_per_frame_; |
| 32 bool is_ready_; |
| 33 base::WeakPtrFactory<FakeExternalBeginFrameSource> weak_ptr_factory_; |
| 34 }; |
| 35 |
| 36 } // namespace cc |
| 37 |
| 38 #endif // CC_TEST_FAKE_EXTERNAL_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |