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

Side by Side 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 5 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/display_client.h ('k') | cc/surfaces/display_scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/scheduler/begin_frame_source.h"
12 #include "cc/surfaces/display.h"
13 #include "cc/surfaces/surfaces_export.h"
14
15 namespace cc {
16
17 class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserver {
18 public:
19 DisplayScheduler(OutputSurface* output_surface,
20 Display* display,
21 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
22 ~DisplayScheduler() override;
23
24 void DisplayDamaged();
25 void DidSwapBuffers();
26 void DidSwapBuffersComplete();
27 void CommitVSyncParameters(base::TimeTicks timebase,
28 base::TimeDelta interval);
29 void OutputSurfaceLost();
30
31 // BeginFrameObserverImplementation.
32 void OnBeginFrame(const BeginFrameArgs& args) override;
33 const BeginFrameArgs LastUsedBeginFrameArgs() const override;
34 void AsValueInto(base::trace_event::TracedValue* dict) const override;
35
36 private:
37 void Draw();
38
39 OutputSurface* output_surface_;
40 Display* display_;
41 scoped_ptr<SyntheticBeginFrameSource> begin_frame_source_;
42 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
43
44 BeginFrameArgs current_begin_frame_args_;
45
46 bool output_surface_lost_;
47 bool need_draw_;
48 int pending_frames_;
49
50 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_;
51
52 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler);
53 };
54
55 } // namespace cc
56
57 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/surfaces/display_client.h ('k') | cc/surfaces/display_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698