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

Side by Side Diff: cc/surfaces/display_scheduler.h

Issue 1136123009: Remove "mixin" from BeginFrameSource/Observer base classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments Created 5 years, 6 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/scheduler/scheduler_unittest.cc ('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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_SURFACES_DISPLAY_SCHEDULER_H_ 5 #ifndef CC_SURFACES_DISPLAY_SCHEDULER_H_
6 #define CC_SURFACES_DISPLAY_SCHEDULER_H_ 6 #define CC_SURFACES_DISPLAY_SCHEDULER_H_
7 7
8 #include "base/cancelable_callback.h" 8 #include "base/cancelable_callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "cc/scheduler/begin_frame_source.h" 12 #include "cc/scheduler/begin_frame_source.h"
13 #include "cc/surfaces/surface_id.h" 13 #include "cc/surfaces/surface_id.h"
14 #include "cc/surfaces/surfaces_export.h" 14 #include "cc/surfaces/surfaces_export.h"
15 15
16 namespace cc { 16 namespace cc {
17 17
18 class OutputSurface; 18 class OutputSurface;
19 class BeginFrameSource; 19 class BeginFrameSource;
20 20
21 // TODO(brianderson): Reconcile with SurfacesScheduler crbug.com/476676 21 // TODO(brianderson): Reconcile with SurfacesScheduler crbug.com/476676
22 class CC_SURFACES_EXPORT DisplaySchedulerClient { 22 class CC_SURFACES_EXPORT DisplaySchedulerClient {
23 public: 23 public:
24 virtual ~DisplaySchedulerClient() {} 24 virtual ~DisplaySchedulerClient() {}
25 25
26 virtual bool DrawAndSwap() = 0; 26 virtual bool DrawAndSwap() = 0;
27 }; 27 };
28 28
29 class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverMixIn { 29 class CC_SURFACES_EXPORT DisplayScheduler : public BeginFrameObserverBase {
30 public: 30 public:
31 DisplayScheduler(DisplaySchedulerClient* client, 31 DisplayScheduler(DisplaySchedulerClient* client,
32 BeginFrameSource* begin_frame_source, 32 BeginFrameSource* begin_frame_source,
33 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 33 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
34 int max_pending_swaps); 34 int max_pending_swaps);
35 ~DisplayScheduler() override; 35 ~DisplayScheduler() override;
36 36
37 void SetRootSurfaceResourcesLocked(bool locked); 37 void SetRootSurfaceResourcesLocked(bool locked);
38 void ForceImmediateSwapIfPossible(); 38 void ForceImmediateSwapIfPossible();
39 virtual void EntireDisplayDamaged(SurfaceId root_surface_id); 39 virtual void EntireDisplayDamaged(SurfaceId root_surface_id);
40 virtual void SurfaceDamaged(SurfaceId surface_id); 40 virtual void SurfaceDamaged(SurfaceId surface_id);
41 41
42 virtual void DidSwapBuffers(); 42 virtual void DidSwapBuffers();
43 void DidSwapBuffersComplete(); 43 void DidSwapBuffersComplete();
44 44
45 void OutputSurfaceLost(); 45 void OutputSurfaceLost();
46 46
47 // BeginFrameObserverMixIn implementation 47 // BeginFrameObserverBase implementation
48 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; 48 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override;
49 49
50 protected: 50 protected:
51 base::TimeTicks DesiredBeginFrameDeadlineTime(); 51 base::TimeTicks DesiredBeginFrameDeadlineTime();
52 virtual void ScheduleBeginFrameDeadline(); 52 virtual void ScheduleBeginFrameDeadline();
53 void AttemptDrawAndSwap(); 53 void AttemptDrawAndSwap();
54 void OnBeginFrameDeadline(); 54 void OnBeginFrameDeadline();
55 void DrawAndSwap(); 55 void DrawAndSwap();
56 56
57 DisplaySchedulerClient* client_; 57 DisplaySchedulerClient* client_;
58 BeginFrameSource* begin_frame_source_; 58 BeginFrameSource* begin_frame_source_;
(...skipping 25 matching lines...) Expand all
84 84
85 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; 85 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_;
86 86
87 private: 87 private:
88 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); 88 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler);
89 }; 89 };
90 90
91 } // namespace cc 91 } // namespace cc
92 92
93 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ 93 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler_unittest.cc ('k') | cc/surfaces/display_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698