Chromium Code Reviews| 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 8471bbd15c6b186b1c4678f6f64a7246ab41fd18..1fc4a337085af619693fdd0d54696f8cd858e51f 100644 |
| --- a/cc/surfaces/compositor_frame_sink_support.h |
| +++ b/cc/surfaces/compositor_frame_sink_support.h |
| @@ -26,12 +26,16 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| public SurfaceFactoryClient, |
| public BeginFrameObserver { |
| public: |
| - CompositorFrameSinkSupport( |
| - CompositorFrameSinkSupportClient* client, |
| - SurfaceManager* surface_manager, |
| - const FrameSinkId& frame_sink_id, |
| - std::unique_ptr<Display> display, |
| - std::unique_ptr<BeginFrameSource> display_begin_frame_source); |
| + // |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 needs_sync_points = true, |
|
danakj
2017/02/06 16:42:58
Why do these have default values instead of writin
Alex Z.
2017/02/07 17:22:00
Done.
|
| + bool for_direct_compositor_frame_sink = false); |
| ~CompositorFrameSinkSupport() override; |
| @@ -46,8 +50,9 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| 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_.get(); } |
| + Display* display() { return display_; } |
| private: |
| void DidReceiveCompositorFrameAck(); |
| @@ -74,14 +79,8 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| CompositorFrameSinkSupportClient* const client_; |
| SurfaceManager* const surface_manager_; |
| - |
| const FrameSinkId frame_sink_id_; |
| - |
| - // 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_; |
| + Display* const display_; |
| SurfaceFactory surface_factory_; |
| // Counts the number of CompositorFrames that have been submitted and have not |
| @@ -101,6 +100,10 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| // 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(). |
| + bool for_direct_compositor_frame_sink_; |
|
danakj
2017/02/06 16:42:58
const?
Alex Z.
2017/02/07 17:22:00
Done.
|
| + |
| // The set of BeginFrame children of this CompositorFrameSink. |
| std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_; |