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

Unified Diff: cc/surfaces/surface_manager.h

Issue 2736053004: SurfaceIds must be reusable as soon as their surfaces are marked destroyed (Closed)
Patch Set: Make deregister private Created 3 years, 9 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/surface_factory.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_manager.h
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
index e4b6f17c5f6efd6e22edeca7795c5dfe9db6748d..c0c8e76324f00e8bec7c4980b559d9f7f2e29060 100644
--- a/cc/surfaces/surface_manager.h
+++ b/cc/surfaces/surface_manager.h
@@ -36,6 +36,7 @@ namespace cc {
class BeginFrameSource;
class CompositorFrame;
class Surface;
+class SurfaceFactory;
class SurfaceFactoryClient;
namespace test {
@@ -65,11 +66,12 @@ class CC_SURFACES_EXPORT SurfaceManager {
void RequestSurfaceResolution(Surface* pending_surface);
- void RegisterSurface(Surface* surface);
- void DeregisterSurface(const SurfaceId& surface_id);
+ std::unique_ptr<Surface> CreateSurface(
+ base::WeakPtr<SurfaceFactory> surface_factory,
+ const LocalSurfaceId& local_surface_id);
// Destroy the Surface once a set of sequence numbers has been satisfied.
- void Destroy(std::unique_ptr<Surface> surface);
+ void DestroySurface(std::unique_ptr<Surface> surface);
Surface* GetSurfaceForId(const SurfaceId& surface_id);
@@ -216,6 +218,10 @@ class CC_SURFACES_EXPORT SurfaceManager {
// |surface_id| that were added before |surface_id| will also be removed.
void RemoveTemporaryReference(const SurfaceId& surface_id, bool remove_range);
+ // Called when a surface is destroyed and it needs to be removed from the
+ // surface map.
+ void UnregisterSurface(const SurfaceId& surface_id);
+
#if DCHECK_IS_ON()
// Recursively prints surface references starting at |surface_id| to |str|.
void SurfaceReferencesToStringImpl(const SurfaceId& surface_id,
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698