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

Unified Diff: cc/surfaces/surface_display_output_surface.cc

Issue 1673783004: Hook up BeginFrameSource to SurfaceFactoryClient via SurfaceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now with unittests Created 4 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/surface_display_output_surface.cc
diff --git a/cc/surfaces/surface_display_output_surface.cc b/cc/surfaces/surface_display_output_surface.cc
index 53d781fb102335e0feecf05c93b5bc935e291473..c91a140509776181b7c64c0dd612330bd9ef8a03 100644
--- a/cc/surfaces/surface_display_output_surface.cc
+++ b/cc/surfaces/surface_display_output_surface.cc
@@ -30,6 +30,9 @@ SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface(
// Display and SurfaceDisplayOutputSurface share a GL context, so sync
// points aren't needed when passing resources between them.
capabilities_.delegated_sync_points_required = false;
+
+ factory_.manager()->RegisterSurfaceFactoryClient(allocator_->id_namespace(),
+ this);
}
SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() {
@@ -84,6 +87,13 @@ void SurfaceDisplayOutputSurface::ForceReclaimResources() {
SurfaceFactory::DrawCallback());
}
+void SurfaceDisplayOutputSurface::DetachFromClient() {
+ // Unregister the SurfaceFactoryClient here instead of the dtor so that only
+ // one client is alive for this namespace at any given time.
+ factory_.manager()->RegisterSurfaceFactoryClient(allocator_->id_namespace(),
+ nullptr);
+}
+
void SurfaceDisplayOutputSurface::ReturnResources(
const ReturnedResourceArray& resources) {
CompositorFrameAck ack;
@@ -93,7 +103,6 @@ void SurfaceDisplayOutputSurface::ReturnResources(
}
void SurfaceDisplayOutputSurface::SetBeginFrameSource(
- SurfaceId surface_id,
BeginFrameSource* begin_frame_source) {
// TODO(tansell): Hook this up.
}

Powered by Google App Engine
This is Rietveld 408576698