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

Unified Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2683583005: Move display_ From CompositorFrameSinkSupport To GpuDisplayCompositorFrameSink (Closed)
Patch Set: rebase Created 3 years, 10 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
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..3a766706b7282717f00d78a6be505d0a9985d995 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 has_display);
~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,8 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
// The set of BeginFrame children of this CompositorFrameSink.
std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
+ const bool has_display_;
+
base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);

Powered by Google App Engine
This is Rietveld 408576698