Chromium Code Reviews| 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_SURFACES_DISPLAY_SCHEDULER_H_ | |
| 6 #define CC_SURFACES_DISPLAY_SCHEDULER_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/single_thread_task_runner.h" | |
| 11 #include "cc/base/rolling_time_delta_history.h" | |
| 12 #include "cc/scheduler/begin_frame_source.h" | |
| 13 #include "cc/surfaces/display.h" | |
| 14 #include "cc/surfaces/surfaces_export.h" | |
| 15 | |
| 16 namespace cc { | |
| 17 | |
|
mithro-old
2015/03/11 04:19:25
If we writing a new scheduler, I think we should t
| |
| 18 class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserver { | |
|
mithro-old
2015/03/11 04:19:25
You should probably inherit from BeginFrameObserve
| |
| 19 public: | |
| 20 DisplayScheduler(OutputSurface* output_surface, | |
| 21 Display* display, | |
| 22 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | |
| 23 ~DisplayScheduler() override; | |
| 24 | |
| 25 void DisplayDamaged(); | |
| 26 void DidSwapBuffers(); | |
| 27 void DidSwapBuffersComplete(); | |
| 28 void CommitVSyncParameters(base::TimeTicks timebase, | |
| 29 base::TimeDelta interval); | |
| 30 void OutputSurfaceLost(); | |
| 31 | |
| 32 // BeginFrameObserverImplementation. | |
| 33 void OnBeginFrame(const BeginFrameArgs& args) override; | |
| 34 const BeginFrameArgs LastUsedBeginFrameArgs() const override; | |
| 35 void AsValueInto(base::debug::TracedValue* dict) const override; | |
| 36 | |
| 37 private: | |
| 38 void Draw(); | |
| 39 | |
| 40 OutputSurface* output_surface_; | |
| 41 Display* display_; | |
| 42 scoped_ptr<SyntheticBeginFrameSource> begin_frame_source_; | |
|
mithro-old
2015/03/11 04:19:25
Why are we hard coding this to a SyntheticBFS rath
| |
| 43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 44 | |
| 45 RollingTimeDeltaHistory draw_duration_history_; | |
| 46 BeginFrameArgs current_begin_frame_args_; | |
| 47 | |
| 48 bool output_surface_lost_; | |
| 49 bool need_draw_; | |
| 50 int pending_frames_; | |
| 51 | |
| 52 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; | |
| 53 | |
| 54 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); | |
| 55 }; | |
| 56 | |
| 57 } // namespace cc | |
| 58 | |
| 59 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ | |
| OLD | NEW |