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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2682023004: Revert of DirectCompositorFrameSink Uses CompositorFrameSinkSupport (Closed)
Patch Set: 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
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | cc/surfaces/direct_compositor_frame_sink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 95d7f096966c445dec3a96bb8e45f8375c2aba94..95222ed1defc2354e69faf20ac12300a4b439b61 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -17,31 +17,25 @@
CompositorFrameSinkSupportClient* client,
SurfaceManager* surface_manager,
const FrameSinkId& frame_sink_id,
- Display* display,
- bool handles_frame_sink_id_invalidation,
- bool needs_sync_points)
+ std::unique_ptr<Display> display,
+ std::unique_ptr<BeginFrameSource> display_begin_frame_source)
: client_(client),
surface_manager_(surface_manager),
frame_sink_id_(frame_sink_id),
- display_(display),
+ display_begin_frame_source_(std::move(display_begin_frame_source)),
+ display_(std::move(display)),
surface_factory_(frame_sink_id_, surface_manager_, this),
- handles_frame_sink_id_invalidation_(handles_frame_sink_id_invalidation),
weak_factory_(this) {
- if (handles_frame_sink_id_invalidation_)
- surface_manager_->RegisterFrameSinkId(frame_sink_id_);
+ surface_manager_->RegisterFrameSinkId(frame_sink_id_);
+ surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
- surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
- surface_factory_.set_needs_sync_points(needs_sync_points);
-
- if (display_)
+ if (display_) {
display_->Initialize(this, surface_manager_);
+ display_->SetVisible(true);
+ }
}
CompositorFrameSinkSupport::~CompositorFrameSinkSupport() {
- // Unregister |this| as a BeginFrameObserver so that the BeginFrameSource does
- // not call into |this| after it's deleted.
- SetNeedsBeginFrame(false);
-
for (auto& child_frame_sink_id : child_frame_sinks_) {
DCHECK(child_frame_sink_id.is_valid());
surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_,
@@ -52,8 +46,7 @@
// |surface_factory_|'s resources early on.
surface_factory_.EvictSurface();
surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
- if (handles_frame_sink_id_invalidation_)
- surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
+ surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
}
void CompositorFrameSinkSupport::EvictFrame() {
@@ -69,14 +62,14 @@
const LocalSurfaceId& local_surface_id,
CompositorFrame frame) {
++ack_pending_count_;
+ surface_factory_.SubmitCompositorFrame(
+ local_surface_id, std::move(frame),
+ base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck,
+ weak_factory_.GetWeakPtr()));
if (display_) {
display_->SetLocalSurfaceId(local_surface_id,
frame.metadata.device_scale_factor);
}
- surface_factory_.SubmitCompositorFrame(
- local_surface_id, std::move(frame),
- base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck,
- weak_factory_.GetWeakPtr()));
}
void CompositorFrameSinkSupport::Require(const LocalSurfaceId& local_surface_id,
@@ -117,10 +110,6 @@
surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_,
child_frame_sink_id);
child_frame_sinks_.erase(it);
-}
-
-void CompositorFrameSinkSupport::ForceReclaimResources() {
- surface_factory_.ClearSurface();
}
void CompositorFrameSinkSupport::DisplayOutputSurfaceLost() {}
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | cc/surfaces/direct_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698