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

Issue 2455663003: Add cc::Surface ref counting. (Closed)

Created:
4 years, 1 month ago by kylechar
Modified:
4 years, 1 month ago
CC:
chromium-reviews, cc-bugs_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/0de3732f5b55c4e7ccbaec6487acfe0742a33e2b Cr-Commit-Position: refs/heads/master@{#429594}

Patch Set 1 #

Total comments: 29

Patch Set 2 : Address CL comments. #

Total comments: 1

Patch Set 3 : Start adding Surfaces for all tests. #

Patch Set 4 : Delete remove all refs code, do cleanup and fix tests. #

Patch Set 5 : More cleanup. #

Total comments: 8

Patch Set 6 : Fixes for fsamuel comments. #

Total comments: 13

Patch Set 7 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+457 lines, -38 lines) Patch
M cc/BUILD.gn View 1 2 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/surfaces/surface_id.h View 1 2 3 4 5 6 3 chunks +5 lines, -6 lines 0 comments Download
M cc/surfaces/surface_manager.h View 1 2 3 4 5 6 4 chunks +39 lines, -0 lines 0 comments Download
M cc/surfaces/surface_manager.cc View 1 2 3 4 5 6 7 chunks +119 lines, -32 lines 0 comments Download
A cc/surfaces/surface_manager_ref_unittest.cc View 1 2 3 4 5 1 chunk +293 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (13 generated)
Fady Samuel
I really like this. It's going in a good direction! Thanks for sending me an ...
4 years, 1 month ago (2016-10-27 04:14:49 UTC) #3
kylechar
I've addressed some of the comments with the latest patch. https://codereview.chromium.org/2455663003/diff/1/cc/surfaces/surface_manager.cc File cc/surfaces/surface_manager.cc (right): https://codereview.chromium.org/2455663003/diff/1/cc/surfaces/surface_manager.cc#newcode96 ...
4 years, 1 month ago (2016-10-27 21:14:10 UTC) #4
kylechar
Update to a landable version. I'll send it out for OWNERS tomorrow sometime.
4 years, 1 month ago (2016-11-01 22:02:53 UTC) #6
Fady Samuel
This is amazing so far Kyle! Thank you! https://codereview.chromium.org/2455663003/diff/20001/cc/surfaces/surface_manager.cc File cc/surfaces/surface_manager.cc (right): https://codereview.chromium.org/2455663003/diff/20001/cc/surfaces/surface_manager.cc#newcode151 cc/surfaces/surface_manager.cc:151: if ...
4 years, 1 month ago (2016-11-02 03:10:36 UTC) #7
kylechar
https://codereview.chromium.org/2455663003/diff/80001/cc/surfaces/surface_manager.cc File cc/surfaces/surface_manager.cc (right): https://codereview.chromium.org/2455663003/diff/80001/cc/surfaces/surface_manager.cc#newcode78 cc/surfaces/surface_manager.cc:78: for (uint32_t value : *sequence) { On 2016/11/02 03:10:36, ...
4 years, 1 month ago (2016-11-02 13:58:59 UTC) #8
kylechar
+enne for OWNERS
4 years, 1 month ago (2016-11-02 14:09:54 UTC) #11
vmpstr
https://codereview.chromium.org/2455663003/diff/100001/cc/surfaces/surface_id.h File cc/surfaces/surface_id.h (right): https://codereview.chromium.org/2455663003/diff/100001/cc/surfaces/surface_id.h#newcode26 cc/surfaces/surface_id.h:26: constexpr SurfaceId(const SurfaceId& other) Can this also be = ...
4 years, 1 month ago (2016-11-02 20:28:13 UTC) #13
kylechar
+vmpstr for OWNERS https://codereview.chromium.org/2455663003/diff/100001/cc/surfaces/surface_id.h File cc/surfaces/surface_id.h (right): https://codereview.chromium.org/2455663003/diff/100001/cc/surfaces/surface_id.h#newcode26 cc/surfaces/surface_id.h:26: constexpr SurfaceId(const SurfaceId& other) On 2016/11/02 ...
4 years, 1 month ago (2016-11-02 21:21:20 UTC) #15
vmpstr
lgtm
4 years, 1 month ago (2016-11-02 22:59:50 UTC) #16
Fady Samuel
lgtm
4 years, 1 month ago (2016-11-03 14:49:34 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2455663003/120001
4 years, 1 month ago (2016-11-03 15:21:30 UTC) #23
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 1 month ago (2016-11-03 15:26:25 UTC) #24
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/0de3732f5b55c4e7ccbaec6487acfe0742a33e2b Cr-Commit-Position: refs/heads/master@{#429594}
4 years, 1 month ago (2016-11-03 15:40:59 UTC) #26
enne (OOO)
4 years, 1 month ago (2016-11-10 19:15:30 UTC) #27
Message was sent while issue was closed.
Belated lgtm.  This is great, thanks!

Powered by Google App Engine
This is Rietveld 408576698