Index: cc/surfaces/compositor_frame_sink_support.h |
diff --git a/cc/surfaces/compositor_frame_sink_support.h b/cc/surfaces/compositor_frame_sink_support.h |
index eb63791e0aba5f6bcb32987af8544922aaf781d4..8471bbd15c6b186b1c4678f6f64a7246ab41fd18 100644 |
--- a/cc/surfaces/compositor_frame_sink_support.h |
+++ b/cc/surfaces/compositor_frame_sink_support.h |
@@ -26,16 +26,12 @@ |
public SurfaceFactoryClient, |
public BeginFrameObserver { |
public: |
- // |display| is nullptr if the CompositorFrameSinkSupport submits |
- // CompositorFrames to a offscreen texutre/bitmap instead of a |
- // DisplayCompositor. e.g. OffscreenCanvasCompositorFrameSink and |
- // GpuOffscreenCompositorFrameSink. |
- CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client, |
- SurfaceManager* surface_manager, |
- const FrameSinkId& frame_sink_id, |
- Display* display, |
- bool handles_frame_sink_id_invalidation, |
- bool needs_sync_points); |
+ CompositorFrameSinkSupport( |
+ CompositorFrameSinkSupportClient* client, |
+ SurfaceManager* surface_manager, |
+ const FrameSinkId& frame_sink_id, |
+ std::unique_ptr<Display> display, |
+ std::unique_ptr<BeginFrameSource> display_begin_frame_source); |
~CompositorFrameSinkSupport() override; |
@@ -50,9 +46,8 @@ |
void Satisfy(const SurfaceSequence& sequence); |
void AddChildFrameSink(const FrameSinkId& child_frame_sink_id); |
void RemoveChildFrameSink(const FrameSinkId& child_frame_sink_id); |
- void ForceReclaimResources(); |
- Display* display() { return display_; } |
+ Display* display() { return display_.get(); } |
private: |
void DidReceiveCompositorFrameAck(); |
@@ -79,8 +74,14 @@ |
CompositorFrameSinkSupportClient* const client_; |
SurfaceManager* const surface_manager_; |
+ |
const FrameSinkId frame_sink_id_; |
- Display* const display_; |
+ |
+ // GpuCompositorFrameSink holds a Display and its BeginFrameSource if it |
+ // created with non-null gpu::SurfaceHandle. In the window server, the display |
+ // root window's CompositorFrameSink will have a valid gpu::SurfaceHandle. |
+ std::unique_ptr<BeginFrameSource> display_begin_frame_source_; |
+ std::unique_ptr<Display> display_; |
SurfaceFactory surface_factory_; |
// Counts the number of CompositorFrames that have been submitted and have not |
@@ -100,18 +101,6 @@ |
// Whether or not a frame observer has been added. |
bool added_frame_observer_ = false; |
- // TODO(staraz): Remove this flag once ui::Compositor no longer needs |
- // RegisterFrameSinkId(). |
- // A SurfaceSequence's validity is bound to the lifetime of the parent |
- // FrameSink that created it. We track the lifetime of FrameSink's through |
- // RegisterFrameSinkId and InvalidateFrameSink. During startup and GPU |
- // restart, a SurfaceSequence created by the top most layer compositor may be |
- // used prior to the creation of the associated CompositorFrameSinkSupport. |
- // CompositorFrameSinkSupport is created asynchronously when a new GPU channel |
- // is established. Once we switch to SurfaceReferences, this ordering concern |
- // goes away and we can remove this bool. |
- const bool handles_frame_sink_id_invalidation_; |
- |
// The set of BeginFrame children of this CompositorFrameSink. |
std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_; |