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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2612083002: DirectCompositorFrameSink Uses CompositorFrameSinkSupport (Closed)
Patch Set: Addressed nits Created 3 years, 11 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.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index 95222ed1defc2354e69faf20ac12300a4b439b61..1abb755b6aaad3ab58742dde26a772129b2a8aa6 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -17,17 +17,17 @@ CompositorFrameSinkSupport::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* display,
+ bool needs_sync_points)
: client_(client),
surface_manager_(surface_manager),
frame_sink_id_(frame_sink_id),
- display_begin_frame_source_(std::move(display_begin_frame_source)),
- display_(std::move(display)),
+ display_(display),
surface_factory_(frame_sink_id_, surface_manager_, this),
weak_factory_(this) {
surface_manager_->RegisterFrameSinkId(frame_sink_id_);
surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
+ surface_factory_.set_needs_sync_points(needs_sync_points);
if (display_) {
display_->Initialize(this, surface_manager_);
@@ -62,14 +62,14 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
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_) {
danakj 2017/01/31 19:25:01 why this reordering?
Alex Z. 2017/01/31 20:34:18 The reordering was to fix this crash in the state_
danakj 2017/01/31 20:41:38 That crash is from CompositorFrameSinkSupport::Sub
Alex Z. 2017/01/31 21:09:30 I don't know. I did the reordering because SetLoca
danakj 2017/01/31 21:49:40 Er, well, I don't think that's a very good motivat
Alex Z. 2017/02/02 00:17:32 Like we've discussed on slack, CompositorFrameSin
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,
@@ -88,6 +88,7 @@ void CompositorFrameSinkSupport::DidReceiveCompositorFrameAck() {
if (!client_)
return;
+
danakj 2017/01/31 19:25:01 random whitespace?
Alex Z. 2017/01/31 20:34:18 Done.
client_->DidReceiveCompositorFrameAck();
if (!surface_returned_resources_.empty()) {
client_->ReclaimResources(surface_returned_resources_);
@@ -112,6 +113,10 @@ void CompositorFrameSinkSupport::RemoveChildFrameSink(
child_frame_sinks_.erase(it);
}
+void CompositorFrameSinkSupport::ForceReclaimResources() {
+ surface_factory_.ClearSurface();
+}
+
void CompositorFrameSinkSupport::DisplayOutputSurfaceLost() {}
void CompositorFrameSinkSupport::DisplayWillDrawAndSwap(

Powered by Google App Engine
This is Rietveld 408576698