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

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

Issue 2887453002: SurfaceDependencyTracker: Only observe BeginFrames if a deadline is needed (Closed)
Patch Set: Fixed an incorrect DCHECK Created 3 years, 6 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/BUILD.gn ('k') | cc/surfaces/surface_dependency_deadline.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_SURFACES_SURFACE_DEPENDENCY_DEADLINE_H_
6 #define CC_SURFACES_SURFACE_DEPENDENCY_DEADLINE_H_
7
8 #include "cc/scheduler/begin_frame_source.h"
9
10 namespace cc {
11
12 class SurfaceDependencyTracker;
13
14 class SurfaceDependencyDeadline : public BeginFrameObserver {
15 public:
16 SurfaceDependencyDeadline(SurfaceDependencyTracker* dependency_tracker,
17 BeginFrameSource* begin_frame_source);
18 ~SurfaceDependencyDeadline() override;
19
20 void Set(uint32_t number_of_frames_to_deadline);
21 void Cancel();
22
23 bool has_deadline() const {
24 return number_of_frames_to_deadline_.has_value();
25 }
26
27 // BeginFrameObserver implementation.
28 void OnBeginFrame(const BeginFrameArgs& args) override;
29 const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
30 void OnBeginFrameSourcePausedChanged(bool paused) override;
31
32 private:
33 SurfaceDependencyTracker* const dependency_tracker_;
34 BeginFrameSource* begin_frame_source_ = nullptr;
35 base::Optional<uint32_t> number_of_frames_to_deadline_;
36
37 BeginFrameArgs last_begin_frame_args_;
38
39 DISALLOW_COPY_AND_ASSIGN(SurfaceDependencyDeadline);
40 };
41
42 } // namespace cc
43
44 #endif // CC_SURFACES_SURFACE_DEPENDENCY_DEADLINE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/BUILD.gn ('k') | cc/surfaces/surface_dependency_deadline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698