Chromium Code Reviews| Index: cc/surfaces/display_scheduler.h |
| diff --git a/cc/surfaces/display_scheduler.h b/cc/surfaces/display_scheduler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ed657b1606a75eef8cf190ef926b4b4a87561e27 |
| --- /dev/null |
| +++ b/cc/surfaces/display_scheduler.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_SURFACES_DISPLAY_SCHEDULER_H_ |
| +#define CC_SURFACES_DISPLAY_SCHEDULER_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/single_thread_task_runner.h" |
| +#include "cc/base/rolling_time_delta_history.h" |
| +#include "cc/scheduler/begin_frame_source.h" |
| +#include "cc/surfaces/display.h" |
| +#include "cc/surfaces/surfaces_export.h" |
| + |
| +namespace cc { |
| + |
|
mithro-old
2015/03/11 04:19:25
If we writing a new scheduler, I think we should t
|
| +class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserver { |
|
mithro-old
2015/03/11 04:19:25
You should probably inherit from BeginFrameObserve
|
| + public: |
| + DisplayScheduler(OutputSurface* output_surface, |
| + Display* display, |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| + ~DisplayScheduler() override; |
| + |
| + void DisplayDamaged(); |
| + void DidSwapBuffers(); |
| + void DidSwapBuffersComplete(); |
| + void CommitVSyncParameters(base::TimeTicks timebase, |
| + base::TimeDelta interval); |
| + void OutputSurfaceLost(); |
| + |
| + // BeginFrameObserverImplementation. |
| + void OnBeginFrame(const BeginFrameArgs& args) override; |
| + const BeginFrameArgs LastUsedBeginFrameArgs() const override; |
| + void AsValueInto(base::debug::TracedValue* dict) const override; |
| + |
| + private: |
| + void Draw(); |
| + |
| + OutputSurface* output_surface_; |
| + Display* display_; |
| + scoped_ptr<SyntheticBeginFrameSource> begin_frame_source_; |
|
mithro-old
2015/03/11 04:19:25
Why are we hard coding this to a SyntheticBFS rath
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| + |
| + RollingTimeDeltaHistory draw_duration_history_; |
| + BeginFrameArgs current_begin_frame_args_; |
| + |
| + bool output_surface_lost_; |
| + bool need_draw_; |
| + int pending_frames_; |
| + |
| + base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ |