Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 CONTENT_BROWSER_COMPOSITOR_GPU_VSYNC_BEGIN_FRAME_SOURCE_H_ | |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_VSYNC_BEGIN_FRAME_SOURCE_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "base/time/time.h" | |
| 10 #include "cc/scheduler/begin_frame_source.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 // This class is used to control VSync production on GPU side. | |
| 15 class GpuVSyncControl { | |
|
stanisc
2017/01/24 21:23:25
Should this be moved to the same header file with
enne (OOO)
2017/01/24 21:32:07
Yeah, that seems reasonable.
| |
| 16 public: | |
| 17 virtual void SetNeedsVSync(bool needs_vsync) = 0; | |
| 18 }; | |
| 19 | |
| 20 // This is a type of ExternalBeginFrameSource where VSync signals are | |
| 21 // generated externally on GPU side. | |
| 22 class GpuVSyncBeginFrameSource : public cc::ExternalBeginFrameSource, | |
|
stanisc
2017/01/24 21:23:25
Since this class is so simple now should it be mov
enne (OOO)
2017/01/24 21:32:07
I don't feel strongly. I think it's fine to leave
| |
| 23 cc::ExternalBeginFrameSourceClient { | |
| 24 public: | |
| 25 explicit GpuVSyncBeginFrameSource(GpuVSyncControl* vsync_control); | |
| 26 ~GpuVSyncBeginFrameSource() override; | |
| 27 | |
| 28 // cc::ExternalBeginFrameSourceClient implementation. | |
| 29 void OnNeedsBeginFrames(bool needs_begin_frames) override; | |
| 30 | |
| 31 void OnVSync(base::TimeTicks timestamp, base::TimeDelta interval); | |
| 32 | |
| 33 private: | |
| 34 GpuVSyncControl* const vsync_control_; | |
| 35 bool needs_begin_frames_; | |
| 36 uint64_t next_sequence_number_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(GpuVSyncBeginFrameSource); | |
| 39 }; | |
| 40 | |
| 41 } // namespace content | |
| 42 | |
| 43 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_VSYNC_BEGIN_FRAME_SOURCE_H_ | |
| OLD | NEW |