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

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

Issue 2489003002: Convert mustash use surface references. (Closed)
Patch Set: More fixes for comments. Created 4 years, 1 month 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 | « no previous file | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_compositor.h
diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/display_compositor.h
index 18ad01a7ff3a613e08a28f35f8e0443b913701c5..94fa3f8f9078af8a30e79f4a207b5b48c3b70649 100644
--- a/services/ui/surfaces/display_compositor.h
+++ b/services/ui/surfaces/display_compositor.h
@@ -10,6 +10,9 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "cc/ipc/display_compositor.mojom.h"
+#include "cc/surfaces/frame_sink_id.h"
+#include "cc/surfaces/local_frame_id.h"
+#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_manager.h"
#include "cc/surfaces/surface_observer.h"
@@ -33,10 +36,12 @@ class DisplayCompositor : public cc::SurfaceObserver,
explicit DisplayCompositor(cc::mojom::DisplayCompositorClientPtr client);
// TODO(fsamuel): These methods should be behind a mojo interface.
- void AddSurfaceReference(const cc::SurfaceId& surface_id,
- const cc::SurfaceSequence& surface_sequence);
- void ReturnSurfaceReferences(const cc::FrameSinkId& frame_sink_id,
- const std::vector<uint32_t>& sequences);
+ void AddRootSurfaceReference(const cc::SurfaceId& child_id);
+ void AddSurfaceReference(const cc::SurfaceId& parent_id,
+ const cc::SurfaceId& child_id);
+ void RemoveRootSurfaceReference(const cc::SurfaceId& child_id);
+ void RemoveSurfaceReference(const cc::SurfaceId& parent_id,
+ const cc::SurfaceId& child_id);
cc::SurfaceManager* manager() { return &manager_; }
@@ -54,6 +59,16 @@ class DisplayCompositor : public cc::SurfaceObserver,
cc::mojom::DisplayCompositorClientPtr client_;
cc::SurfaceManager manager_;
+ // SurfaceIds that have temporary references from top level root so they
+ // aren't GC'd before DisplayCompositorClient can add a real reference. This
+ // is basically a collection of surface ids, for example:
+ // cc::SurfaceId surface_id(key, value[index]);
+ // The LocalFrameIds are stored in the order the surfaces are created in.
+ std::unordered_map<cc::FrameSinkId,
+ std::vector<cc::LocalFrameId>,
+ cc::FrameSinkIdHash>
+ temp_references_;
+
DISALLOW_COPY_AND_ASSIGN(DisplayCompositor);
};
« no previous file with comments | « no previous file | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698