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

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

Issue 1304063014: cc: Plumbing for BeginFrameSource based on Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix webview Created 5 years, 2 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.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"
(...skipping 30 matching lines...) Expand all
41 virtual void SurfaceDamaged(SurfaceId surface_id); 41 virtual void SurfaceDamaged(SurfaceId surface_id);
42 42
43 virtual void DidSwapBuffers(); 43 virtual void DidSwapBuffers();
44 void DidSwapBuffersComplete(); 44 void DidSwapBuffersComplete();
45 45
46 void OutputSurfaceLost(); 46 void OutputSurfaceLost();
47 47
48 // BeginFrameObserverBase implementation 48 // BeginFrameObserverBase implementation
49 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; 49 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override;
50 50
51 BeginFrameSource* begin_frame_source_for_children() {
52 return begin_frame_source_for_children_.get();
53 }
54
51 protected: 55 protected:
52 base::TimeTicks DesiredBeginFrameDeadlineTime(); 56 base::TimeTicks DesiredBeginFrameDeadlineTime();
53 virtual void ScheduleBeginFrameDeadline(); 57 virtual void ScheduleBeginFrameDeadline();
54 void AttemptDrawAndSwap(); 58 void AttemptDrawAndSwap();
55 void OnBeginFrameDeadline(); 59 void OnBeginFrameDeadline();
56 void DrawAndSwap(); 60 void DrawAndSwap();
57 61
58 DisplaySchedulerClient* client_; 62 DisplaySchedulerClient* client_;
59 BeginFrameSource* begin_frame_source_; 63 BeginFrameSource* begin_frame_source_;
60 base::SingleThreadTaskRunner* task_runner_; 64 base::SingleThreadTaskRunner* task_runner_;
61 65
62 BeginFrameArgs current_begin_frame_args_; 66 BeginFrameArgs current_begin_frame_args_;
63 base::Closure begin_frame_deadline_closure_; 67 base::Closure begin_frame_deadline_closure_;
64 base::CancelableClosure begin_frame_deadline_task_; 68 base::CancelableClosure begin_frame_deadline_task_;
65 base::TimeTicks begin_frame_deadline_task_time_; 69 base::TimeTicks begin_frame_deadline_task_time_;
66 70
71 // TODO(tansell): Set this to something useful.
72 scoped_ptr<BeginFrameSource> begin_frame_source_for_children_;
73
67 bool output_surface_lost_; 74 bool output_surface_lost_;
68 bool root_surface_resources_locked_; 75 bool root_surface_resources_locked_;
69 76
70 bool inside_begin_frame_deadline_interval_; 77 bool inside_begin_frame_deadline_interval_;
71 bool needs_draw_; 78 bool needs_draw_;
72 bool expecting_root_surface_damage_because_of_resize_; 79 bool expecting_root_surface_damage_because_of_resize_;
73 bool all_active_child_surfaces_ready_to_draw_; 80 bool all_active_child_surfaces_ready_to_draw_;
74 81
75 int pending_swaps_; 82 int pending_swaps_;
76 int max_pending_swaps_; 83 int max_pending_swaps_;
77 84
78 SurfaceId root_surface_id_; 85 SurfaceId root_surface_id_;
79 bool root_surface_damaged_; 86 bool root_surface_damaged_;
80 bool expect_damage_from_root_surface_; 87 bool expect_damage_from_root_surface_;
81 88
82 std::set<SurfaceId> child_surface_ids_damaged_; 89 std::set<SurfaceId> child_surface_ids_damaged_;
83 std::set<SurfaceId> child_surface_ids_damaged_prev_; 90 std::set<SurfaceId> child_surface_ids_damaged_prev_;
84 std::vector<SurfaceId> child_surface_ids_to_expect_damage_from_; 91 std::vector<SurfaceId> child_surface_ids_to_expect_damage_from_;
85 92
86 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; 93 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_;
87 94
88 private: 95 private:
89 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); 96 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler);
90 }; 97 };
91 98
92 } // namespace cc 99 } // namespace cc
93 100
94 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ 101 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/surfaces/display_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698