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

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

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really revert task runner changes Created 4 years, 8 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
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/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "cc/output/renderer_settings.h"
13 #include "cc/scheduler/begin_frame_source.h" 14 #include "cc/scheduler/begin_frame_source.h"
14 #include "cc/surfaces/surface_id.h" 15 #include "cc/surfaces/surface_id.h"
15 #include "cc/surfaces/surfaces_export.h" 16 #include "cc/surfaces/surfaces_export.h"
16 17
17 namespace cc { 18 namespace cc {
18 19
19 class OutputSurface; 20 class OutputSurface;
20 class BeginFrameSource; 21 class BeginFrameSource;
21 22
22 class CC_SURFACES_EXPORT DisplaySchedulerClient { 23 class CC_SURFACES_EXPORT DisplaySchedulerClient {
(...skipping 19 matching lines...) Expand all
42 43
43 virtual void DidSwapBuffers(); 44 virtual void DidSwapBuffers();
44 void DidSwapBuffersComplete(); 45 void DidSwapBuffersComplete();
45 46
46 void OutputSurfaceLost(); 47 void OutputSurfaceLost();
47 48
48 // BeginFrameObserverBase implementation 49 // BeginFrameObserverBase implementation
49 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; 50 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override;
50 void OnBeginFrameSourcePausedChanged(bool paused) override; 51 void OnBeginFrameSourcePausedChanged(bool paused) override;
51 52
52 BeginFrameSource* begin_frame_source_for_children() {
53 return begin_frame_source_for_children_.get();
54 }
55
56 protected: 53 protected:
57 base::TimeTicks DesiredBeginFrameDeadlineTime(); 54 base::TimeTicks DesiredBeginFrameDeadlineTime();
58 virtual void ScheduleBeginFrameDeadline(); 55 virtual void ScheduleBeginFrameDeadline();
59 void AttemptDrawAndSwap(); 56 void AttemptDrawAndSwap();
60 void OnBeginFrameDeadline(); 57 void OnBeginFrameDeadline();
61 void DrawAndSwap(); 58 void DrawAndSwap();
62 59
63 DisplaySchedulerClient* client_; 60 DisplaySchedulerClient* client_;
64 BeginFrameSource* begin_frame_source_; 61 BeginFrameSource* begin_frame_source_;
65 base::SingleThreadTaskRunner* task_runner_; 62 base::SingleThreadTaskRunner* task_runner_;
66 63
67 BeginFrameArgs current_begin_frame_args_; 64 BeginFrameArgs current_begin_frame_args_;
68 base::Closure begin_frame_deadline_closure_; 65 base::Closure begin_frame_deadline_closure_;
69 base::CancelableClosure begin_frame_deadline_task_; 66 base::CancelableClosure begin_frame_deadline_task_;
70 base::TimeTicks begin_frame_deadline_task_time_; 67 base::TimeTicks begin_frame_deadline_task_time_;
71 68
72 // TODO(tansell): Set this to something useful.
73 scoped_ptr<BeginFrameSource> begin_frame_source_for_children_;
74
75 bool output_surface_lost_; 69 bool output_surface_lost_;
76 bool root_surface_resources_locked_; 70 bool root_surface_resources_locked_;
77 71
78 bool inside_begin_frame_deadline_interval_; 72 bool inside_begin_frame_deadline_interval_;
79 bool needs_draw_; 73 bool needs_draw_;
80 bool expecting_root_surface_damage_because_of_resize_; 74 bool expecting_root_surface_damage_because_of_resize_;
81 bool all_active_child_surfaces_ready_to_draw_; 75 bool all_active_child_surfaces_ready_to_draw_;
82 76
83 int pending_swaps_; 77 int pending_swaps_;
84 int max_pending_swaps_; 78 int max_pending_swaps_;
(...skipping 10 matching lines...) Expand all
95 89
96 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; 90 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_;
97 91
98 private: 92 private:
99 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); 93 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler);
100 }; 94 };
101 95
102 } // namespace cc 96 } // namespace cc
103 97
104 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ 98 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698