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

Unified Diff: cc/surfaces/frame_sink_manager.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/BUILD.gn ('k') | cc/surfaces/frame_sink_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/frame_sink_manager.h
diff --git a/cc/surfaces/frame_sink_manager.h b/cc/surfaces/frame_sink_manager.h
index 0d54a8e3d8f002356887f22bc78f6e512d041401..11c0f97668dcc0e59d6ae5d0124299be4f3b8377 100644
--- a/cc/surfaces/frame_sink_manager.h
+++ b/cc/surfaces/frame_sink_manager.h
@@ -14,6 +14,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "cc/surfaces/frame_sink_id.h"
+#include "cc/surfaces/primary_begin_frame_source.h"
#include "cc/surfaces/surfaces_export.h"
namespace cc {
@@ -57,6 +58,10 @@ class CC_SURFACES_EXPORT FrameSinkManager {
const FrameSinkId& frame_sink_id);
void UnregisterBeginFrameSource(BeginFrameSource* source);
+ // Returns a stable BeginFrameSource that forwards BeginFrames from the first
+ // available BeginFrameSource.
+ BeginFrameSource* GetPrimaryBeginFrameSource();
+
// Register a relationship between two framesinks. This relationship means
// that surfaces from the child framesik will be displayed in the parent.
// Children are allowed to use any begin frame source that their parent can
@@ -99,7 +104,7 @@ class CC_SURFACES_EXPORT FrameSinkManager {
~FrameSinkSourceMapping();
bool has_children() const { return !children.empty(); }
// The currently assigned begin frame source for this client.
- BeginFrameSource* source;
+ BeginFrameSource* source = nullptr;
// This represents a dag of parent -> children mapping.
std::vector<FrameSinkId> children;
};
@@ -110,11 +115,13 @@ class CC_SURFACES_EXPORT FrameSinkManager {
std::unordered_map<FrameSinkId, FrameSinkSourceMapping, FrameSinkIdHash>
frame_sink_source_map_;
- // Set of which sources are registered to which frmesinks. Any child
+ // Set of BeginFrameSource along with associated FrameSinkIds. Any child
// that is implicitly using this framesink must be reachable by the
// parent in the dag.
std::unordered_map<BeginFrameSource*, FrameSinkId> registered_sources_;
+ PrimaryBeginFrameSource primary_source_;
+
DISALLOW_COPY_AND_ASSIGN(FrameSinkManager);
};
« no previous file with comments | « cc/surfaces/BUILD.gn ('k') | cc/surfaces/frame_sink_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698