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