Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2474)

Unified Diff: cc/surfaces/display_scheduler.h

Issue 720333005: Add DisplayScheduler to enable BeginFrame-based scheduling of surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698