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

Unified Diff: services/ui/surfaces/display_compositor.h

Issue 2541683004: Add/remove surface references via MojoCompositorFrameSink. (Closed)
Patch Set: Cleanup. Created 4 years 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: services/ui/surfaces/display_compositor.h
diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/display_compositor.h
index 3b29d71f08d21d450b421e4e73457b1b356f0bb0..97c89f7379cece91f22b53cdbecc5bd2b0aee223 100644
--- a/services/ui/surfaces/display_compositor.h
+++ b/services/ui/surfaces/display_compositor.h
@@ -60,22 +60,17 @@ class DisplayCompositor : public cc::SurfaceObserver,
cc::mojom::DisplayCompositorClientPtr client);
~DisplayCompositor() override;
- // cc::mojom::DisplayCompositor implementation:
- void CreateCompositorFrameSink(
- const cc::FrameSinkId& frame_sink_id,
- gpu::SurfaceHandle surface_handle,
- cc::mojom::MojoCompositorFrameSinkRequest request,
- cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
- cc::mojom::MojoCompositorFrameSinkClientPtr client) override;
- void AddRootSurfaceReference(const cc::SurfaceId& child_id) override;
- void AddSurfaceReference(const cc::SurfaceId& parent_id,
- const cc::SurfaceId& child_id) override;
- void RemoveRootSurfaceReference(const cc::SurfaceId& child_id) override;
- void RemoveSurfaceReference(const cc::SurfaceId& parent_id,
- const cc::SurfaceId& child_id) override;
-
cc::SurfaceManager* manager() { return &manager_; }
+ // Adds surface references. For each reference added, this will remove the
+ // temporary reference to the child surface if one exists.
+ void AddSurfaceReferences(
+ const std::vector<cc::SurfaceReference>& references);
+
+ // Removes surface references.
+ void RemoveSurfaceReferences(
+ const std::vector<cc::SurfaceReference>& references);
+
// We must avoid destroying a GpuCompositorFrameSink until both the display
// compositor host and the client drop their connection to avoid getting into
// a state where surfaces references are inconsistent.
@@ -86,9 +81,20 @@ class DisplayCompositor : public cc::SurfaceObserver,
const cc::FrameSinkId& frame_sink_id,
bool destroy_compositor_frame_sink);
+ // cc::mojom::DisplayCompositor implementation:
+ void CreateCompositorFrameSink(
+ const cc::FrameSinkId& frame_sink_id,
+ gpu::SurfaceHandle surface_handle,
+ cc::mojom::MojoCompositorFrameSinkRequest request,
+ cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
+ cc::mojom::MojoCompositorFrameSinkClientPtr client) override;
+
private:
friend class test::DisplayCompositorTest;
+ void AddSurfaceReference(const cc::SurfaceReference& ref);
+ void RemoveSurfaceReference(const cc::SurfaceReference& ref);
+
std::unique_ptr<cc::Display> CreateDisplay(
const cc::FrameSinkId& frame_sink_id,
gpu::SurfaceHandle surface_handle);
« no previous file with comments | « content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698