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

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

Issue 2880023002: cc::SurfaceDependencyTracker should not crash when a Display goes away (Closed)
Patch Set: Fix LayerTreeHostImpl unit tests Created 3 years, 7 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/frame_sink_manager.cc ('k') | cc/surfaces/primary_begin_frame_source.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_PRIMARY_BEGIN_FRAME_SOURCE_H_
6 #define CC_SURFACES_PRIMARY_BEGIN_FRAME_SOURCE_H_
7
8 #include "cc/scheduler/begin_frame_source.h"
9
10 namespace cc {
11
12 // PrimaryBeginFrameSource echos the first BeginFrameSource in the system.
13 // If the first source goes away then it will echo the new first
14 // BeginFrameSource.
15 class PrimaryBeginFrameSource : public BeginFrameSource,
16 public BeginFrameObserver,
17 public ExternalBeginFrameSourceClient {
18 public:
19 PrimaryBeginFrameSource();
20 ~PrimaryBeginFrameSource() override;
21
22 void OnBeginFrameSourceAdded(BeginFrameSource* begin_frame_source);
23 void OnBeginFrameSourceRemoved(BeginFrameSource* begin_frame_source);
24
25 // BeginFrameObserver implementation.
26 void OnBeginFrame(const BeginFrameArgs& args) override;
27 const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
28 void OnBeginFrameSourcePausedChanged(bool paused) override;
29
30 // BeginFrameSource implementation.
31 void DidFinishFrame(BeginFrameObserver* obs,
32 const BeginFrameAck& ack) override;
33 void AddObserver(BeginFrameObserver* obs) override;
34 void RemoveObserver(BeginFrameObserver* obs) override;
35 bool IsThrottled() const override;
36
37 // ExternalBeginFrameSourceClient implementation.
38 void OnNeedsBeginFrames(bool needs_begin_frames) override;
39
40 private:
41 ExternalBeginFrameSource begin_frame_source_;
42 BeginFrameSource* current_begin_frame_source_ = nullptr;
43
44 // The last begin frame args generated by the begin frame source.
45 BeginFrameArgs last_begin_frame_args_;
46
47 bool needs_begin_frames_ = false;
48
49 base::flat_set<BeginFrameSource*> sources_;
50
51 DISALLOW_COPY_AND_ASSIGN(PrimaryBeginFrameSource);
52 };
53
54 } // namespace cc
55
56 #endif // CC_SURFACES_PRIMARY_BEGIN_FRAME_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/frame_sink_manager.cc ('k') | cc/surfaces/primary_begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698