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

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

Issue 1251693002: cc: Consider Surface active if frame received recently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on resize logging patch Created 5 years, 5 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 | « no previous file | 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 protected: 51 protected:
52 base::TimeTicks DesiredBeginFrameDeadlineTime(); 52 base::TimeTicks DesiredBeginFrameDeadlineTime();
53 virtual void ScheduleBeginFrameDeadline(); 53 virtual void ScheduleBeginFrameDeadline();
54 void AttemptDrawAndSwap(); 54 void AttemptDrawAndSwap();
55 void OnBeginFrameDeadline(); 55 void OnBeginFrameDeadline();
56 void DrawAndSwap(); 56 void DrawAndSwap();
57 void UpdateActiveSurfaces();
57 58
58 DisplaySchedulerClient* client_; 59 DisplaySchedulerClient* client_;
59 BeginFrameSource* begin_frame_source_; 60 BeginFrameSource* begin_frame_source_;
60 base::SingleThreadTaskRunner* task_runner_; 61 base::SingleThreadTaskRunner* task_runner_;
61 62
62 BeginFrameArgs current_begin_frame_args_; 63 BeginFrameArgs current_begin_frame_args_;
63 base::Closure begin_frame_deadline_closure_; 64 base::Closure begin_frame_deadline_closure_;
64 base::CancelableClosure begin_frame_deadline_task_; 65 base::CancelableClosure begin_frame_deadline_task_;
65 base::TimeTicks begin_frame_deadline_task_time_; 66 base::TimeTicks begin_frame_deadline_task_time_;
66 67
67 bool output_surface_lost_; 68 bool output_surface_lost_;
68 bool root_surface_resources_locked_; 69 bool root_surface_resources_locked_;
69 70
70 bool inside_begin_frame_deadline_interval_; 71 bool inside_begin_frame_deadline_interval_;
71 bool needs_draw_; 72 bool needs_draw_;
72 bool expecting_root_surface_damage_because_of_resize_; 73 bool child_surfaces_ready_to_draw_;
73 bool all_active_child_surfaces_ready_to_draw_;
74 74
75 int pending_swaps_; 75 int pending_swaps_;
76 int max_pending_swaps_; 76 int max_pending_swaps_;
77 77
78 SurfaceId root_surface_id_; 78 SurfaceId root_surface_id_;
79 bool root_surface_damaged_; 79 bool root_surface_damaged_;
80 bool expect_damage_from_root_surface_; 80 bool root_surface_active_;
81 bool expecting_root_surface_damage_because_of_resize_;
81 82
83 // We currently use a heuristic that considers a child surface
84 // active if it has submitted a frame anytime within the last 3
85 // vsyncs.
86 static const int kNumFramesSurfaceIsActive = 3;
82 std::set<SurfaceId> child_surface_ids_damaged_; 87 std::set<SurfaceId> child_surface_ids_damaged_;
83 std::set<SurfaceId> child_surface_ids_damaged_prev_; 88 std::set<SurfaceId> active_child_surface_ids_[kNumFramesSurfaceIsActive];
84 std::vector<SurfaceId> child_surface_ids_to_expect_damage_from_; 89 int active_child_surface_ids_index_;
85 90
86 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_; 91 base::WeakPtrFactory<DisplayScheduler> weak_ptr_factory_;
87 92
88 private: 93 private:
89 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler); 94 DISALLOW_COPY_AND_ASSIGN(DisplayScheduler);
90 }; 95 };
91 96
92 } // namespace cc 97 } // namespace cc
93 98
94 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_ 99 #endif // CC_SURFACES_DISPLAY_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/display_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698