| Index: cc/surfaces/compositor_frame_sink_support.cc
|
| diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
|
| index 9f07940c2019c962bd700f0cd6789c496e7999e0..e101968de381950dccf983941c17a2f68b1a6658 100644
|
| --- a/cc/surfaces/compositor_frame_sink_support.cc
|
| +++ b/cc/surfaces/compositor_frame_sink_support.cc
|
| @@ -22,19 +22,28 @@ CompositorFrameSinkSupport::CompositorFrameSinkSupport(
|
| CompositorFrameSinkSupportClient* client,
|
| SurfaceManager* surface_manager,
|
| const FrameSinkId& frame_sink_id,
|
| - bool submits_to_display_compositor)
|
| + bool submits_to_display_compositor,
|
| + bool handles_frame_sink_id_invalidation,
|
| + bool needs_sync_points)
|
| : client_(client),
|
| surface_manager_(surface_manager),
|
| frame_sink_id_(frame_sink_id),
|
| surface_factory_(frame_sink_id_, surface_manager_, this),
|
| reference_tracker_(frame_sink_id),
|
| submits_to_display_compositor_(submits_to_display_compositor),
|
| + handles_frame_sink_id_invalidation_(handles_frame_sink_id_invalidation),
|
| weak_factory_(this) {
|
| - surface_manager_->RegisterFrameSinkId(frame_sink_id_);
|
| + surface_factory_.set_needs_sync_points(needs_sync_points);
|
| + if (handles_frame_sink_id_invalidation_)
|
| + surface_manager_->RegisterFrameSinkId(frame_sink_id_);
|
| surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
|
| }
|
|
|
| CompositorFrameSinkSupport::~CompositorFrameSinkSupport() {
|
| + // Unregister |this| as a BeginFrameObserver so that the BeginFrameSource does
|
| + // not call into |this| after it's deleted.
|
| + SetNeedsBeginFrame(false);
|
| +
|
| // For display root surfaces, the surface is no longer going to be visible
|
| // so make it unreachable from the top-level root.
|
| if (surface_manager_->using_surface_references() &&
|
| @@ -52,7 +61,8 @@ CompositorFrameSinkSupport::~CompositorFrameSinkSupport() {
|
| // |surface_factory_|'s resources early on.
|
| surface_factory_.EvictSurface();
|
| surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
|
| - surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
|
| + if (handles_frame_sink_id_invalidation_)
|
| + surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
|
| }
|
|
|
| void CompositorFrameSinkSupport::EvictFrame() {
|
|
|