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

Unified Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2612083002: DirectCompositorFrameSink Uses CompositorFrameSinkSupport (Closed)
Patch Set: Address comments and revert changes in Android 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 8471bbd15c6b186b1c4678f6f64a7246ab41fd18..7b201fabecc64e9943e7bca17e948e529c41a1d8 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 handles_frame_sink_id_invalidation,
+ bool needs_sync_points);
~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().
Fady Samuel 2017/02/07 17:33:55 This needs to be far more explicit. How about this
Alex Z. 2017/02/07 17:40:52 Done.
+ const bool handles_frame_sink_id_invalidation_;
+
// The set of BeginFrame children of this CompositorFrameSink.
std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
« no previous file with comments | « no previous file | cc/surfaces/compositor_frame_sink_support.cc » ('j') | cc/surfaces/direct_compositor_frame_sink.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698