[go: nahoru, domu]

Add cc::Surface references.

Start framework for tracking reference in cc::SurfaceManager. This will
replace the SurfaceSequence dependency tracking.

The general concept is parent surface references a child surface it is
embedding. When the parent surface no longer needs the child surface, it
removes the reference. We can GC all surfaces with 0 references.

1. Add helper methods to add or remove a reference from a SurfaceId to
   another SurfaceId. Add maps to track references in both directions.
2. Add check in SurfaceManager::GarbageCollectSurfaces() if references
   are zero. If both references and sequences are zero we can garbage
   collect the surface. This will allow references and sequences to both
   work until sequences can be replaced.
3. Add unit tests that check references works correctly.

The surface reference code is unused outside tests at this point. It's
designed so that dependency tracking and references can be used together
while code is converted.

The next CL will start replacing surface dependencies with surface
references in mus-ws.

BUG=659227
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2455663003
Cr-Commit-Position: refs/heads/master@{#429594}
5 files changed