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 ef8d2bf7b5f02aa281a563e7c330b8930c5a482e..1435fd78a6f3c5c0c519f63437ae64674b96f23c 100644 |
| --- a/cc/surfaces/compositor_frame_sink_support.h |
| +++ b/cc/surfaces/compositor_frame_sink_support.h |
| @@ -12,8 +12,6 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "cc/output/compositor_frame.h" |
| #include "cc/scheduler/begin_frame_source.h" |
| -#include "cc/surfaces/display.h" |
| -#include "cc/surfaces/display_client.h" |
| #include "cc/surfaces/referenced_surface_tracker.h" |
| #include "cc/surfaces/surface_factory.h" |
| #include "cc/surfaces/surface_factory_client.h" |
| @@ -23,24 +21,18 @@ |
| namespace cc { |
| class CompositorFrameSinkSupportClient; |
| -class Display; |
| class SurfaceManager; |
| class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| - : public NON_EXPORTED_BASE(DisplayClient), |
| - public SurfaceFactoryClient, |
| + : 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); |
| + bool needs_sync_points, |
| + bool submits_to_display_compositor); |
| ~CompositorFrameSinkSupport() override; |
| @@ -57,8 +49,6 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| void RemoveChildFrameSink(const FrameSinkId& child_frame_sink_id); |
| void ForceReclaimResources(); |
| - Display* display() { return display_; } |
| - |
| private: |
| // Update surface references with SurfaceManager for current CompositorFrame |
| // that has |local_surface_id|. UpdateReferences() must be called on |
| @@ -72,12 +62,6 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| void DidReceiveCompositorFrameAck(); |
| - // DisplayClient implementation. |
| - void DisplayOutputSurfaceLost() override; |
| - void DisplayWillDrawAndSwap(bool will_draw_and_swap, |
| - const RenderPassList& render_passes) override; |
| - void DisplayDidDrawAndSwap() override; |
| - |
| // SurfaceFactoryClient implementation. |
| void ReturnResources(const ReturnedResourceArray& resources) override; |
| void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; |
| @@ -95,7 +79,6 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| SurfaceManager* const surface_manager_; |
| const FrameSinkId frame_sink_id_; |
| - Display* const display_; |
| SurfaceFactory surface_factory_; |
| // Counts the number of CompositorFrames that have been submitted and have not |
| @@ -134,6 +117,13 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport |
| // The set of BeginFrame children of this CompositorFrameSink. |
| std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_; |
| + // |has_display_| is true if the CompositorFrameSinkSupport submits |
|
Fady Samuel
2017/02/08 21:37:46
This comment is stale.
Alex Z.
2017/02/08 21:41:43
Done.
|
| + // CompositorFrames to a DisplayCompositor. It is false if |
| + // CompositorFrameSinkSupport submits CompositorFrames to an offscreen |
| + // texture/bitmap. (e.g. OffscreenCanvasCompositorFrameSink and |
| + // GpuOffscreenCompositorFrameSink) |
| + const bool submits_to_display_compositor_; |
| + |
| base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); |