OLD | NEW |
---|---|
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // BeginFrameObserverBase implementation | 47 // BeginFrameObserverBase implementation |
48 bool OnBeginFrameDerivedImpl(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 std::set<SurfaceId>& CurrentActiveChildSurfaceIDs(); | |
58 void UpdateFutureActiveChildSurfaceIDs(SurfaceId surface_id); | |
59 void ClearActiveSurfaces(); | |
60 void UpdateActiveSurfaces(); | |
61 | |
57 DisplaySchedulerClient* client_; | 62 DisplaySchedulerClient* client_; |
58 BeginFrameSource* begin_frame_source_; | 63 BeginFrameSource* begin_frame_source_; |
59 base::SingleThreadTaskRunner* task_runner_; | 64 base::SingleThreadTaskRunner* task_runner_; |
60 | 65 |
61 BeginFrameArgs current_begin_frame_args_; | 66 BeginFrameArgs current_begin_frame_args_; |
62 base::Closure begin_frame_deadline_closure_; | 67 base::Closure begin_frame_deadline_closure_; |
63 base::CancelableClosure begin_frame_deadline_task_; | 68 base::CancelableClosure begin_frame_deadline_task_; |
64 base::TimeTicks begin_frame_deadline_task_time_; | 69 base::TimeTicks begin_frame_deadline_task_time_; |
65 | 70 |
66 bool output_surface_lost_; | 71 bool output_surface_lost_; |
67 bool root_surface_resources_locked_; | 72 bool root_surface_resources_locked_; |
68 | 73 |
69 bool inside_begin_frame_deadline_interval_; | 74 bool inside_begin_frame_deadline_interval_; |
70 bool needs_draw_; | 75 bool needs_draw_; |
71 bool entire_display_damaged_; | 76 bool entire_display_damaged_; |
72 bool all_active_child_surfaces_ready_to_draw_; | 77 bool all_active_child_surfaces_ready_to_draw_; |
73 | 78 |
74 int pending_swaps_; | 79 int pending_swaps_; |
75 int max_pending_swaps_; | 80 int max_pending_swaps_; |
76 | 81 |
77 SurfaceId root_surface_id_; | 82 SurfaceId root_surface_id_; |
78 bool root_surface_damaged_; | 83 bool root_surface_damaged_; |
79 bool expect_damage_from_root_surface_; | 84 bool root_surface_active_; |
80 | 85 |
86 static const int kActiveChildSurfaceIdsSize = 3; | |
sunnyps
2015/07/23 21:10:38
nit: kNumFramesSurfaceIsActive?
brianderson
2015/07/23 22:21:49
Done.
| |
81 std::set<SurfaceId> child_surface_ids_damaged_; | 87 std::set<SurfaceId> child_surface_ids_damaged_; |
82 std::set<SurfaceId> child_surface_ids_damaged_prev_; | 88 std::set<SurfaceId> active_child_surface_ids_[kActiveChildSurfaceIdsSize]; |
83 std::vector<SurfaceId> child_surface_ids_to_expect_damage_from_; | 89 int current_active_child_surface_ids_index_; |
84 | 90 |
85 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; | 91 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; |
86 | 92 |
87 private: | 93 private: |
88 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); | 94 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); |
89 }; | 95 }; |
90 | 96 |
91 } // namespace cc | 97 } // namespace cc |
92 | 98 |
93 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ | 99 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ |
OLD | NEW |