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

Unified Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2807653003: Move Work From CompositorFrameSinkSupport() To Init() (Closed)
Patch Set: Add CompositorFrameSinkSupport::Create Created 3 years, 8 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
« no previous file with comments | « ash/laser/laser_pointer_view.cc ('k') | cc/surfaces/compositor_frame_sink_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d3d3cbbe5b470862e052206cebf4de6303a0feb0..f876a4f8c06f6f233c07b2be6e1c56abc9262f10 100644
--- a/cc/surfaces/compositor_frame_sink_support.h
+++ b/cc/surfaces/compositor_frame_sink_support.h
@@ -28,19 +28,20 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
: public SurfaceFactoryClient,
public BeginFrameObserver {
public:
- CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client,
- SurfaceManager* surface_manager,
- const FrameSinkId& frame_sink_id,
- bool is_root,
- bool handles_frame_sink_id_invalidation,
- bool needs_sync_points);
+ static std::unique_ptr<CompositorFrameSinkSupport> Create(
+ CompositorFrameSinkSupportClient* client,
+ SurfaceManager* surface_manager,
+ const FrameSinkId& frame_sink_id,
+ bool is_root,
+ bool handles_frame_sink_id_invalidation,
+ bool needs_sync_points);
~CompositorFrameSinkSupport() override;
const FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
Surface* current_surface_for_testing() {
- return surface_factory_.current_surface_for_testing();
+ return surface_factory_->current_surface_for_testing();
}
const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const {
@@ -66,6 +67,14 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
void ForceReclaimResources();
void ClaimTemporaryReference(const SurfaceId& surface_id);
+ protected:
+ CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client,
+ const FrameSinkId& frame_sink_id,
+ bool is_root,
+ bool handles_frame_sink_id_invalidation);
+
+ void Init(SurfaceManager* surface_manager, bool needs_sync_points);
+
private:
// Update surface references with SurfaceManager for current CompositorFrame
// that has |local_surface_id|. UpdateReferences() must be called on
@@ -88,11 +97,11 @@ class CC_SURFACES_EXPORT CompositorFrameSinkSupport
CompositorFrameSinkSupportClient* const client_;
- SurfaceManager* const surface_manager_;
+ SurfaceManager* surface_manager_ = nullptr;
const FrameSinkId frame_sink_id_;
- SurfaceFactory surface_factory_;
+ std::unique_ptr<SurfaceFactory> surface_factory_;
// Counts the number of CompositorFrames that have been submitted and have not
// yet received an ACK.
int ack_pending_count_ = 0;
« no previous file with comments | « ash/laser/laser_pointer_view.cc ('k') | cc/surfaces/compositor_frame_sink_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698