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

Issue 2676373004: Implement service-side surface synchronization (Closed)

Created:
3 years, 10 months ago by Fady Samuel
Modified:
3 years, 10 months ago
CC:
Aaron Boodman, abarth-chromium, cc-bugs_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement service-side surface synchronization This CL introduces the notion of a pending and active CompositorFrame along with surface dependency tracking and resolution. An active CompositorFrame is a frame that is a candidate for display. A CompositorFrame is active if all its surface dependencies are active, or the display compositor explicitly activated it after some set deadline. A pending CompositorFrame is a frame that has unresolved dependencies: it refers to surface IDs that either do not yet exist in the display compositor or don't have an active frame. Surface::QueueFrame determines whether a frame refers to valid surface IDs or not. If a CompositorFrame has unresolved dependencies then it's marked as pending and the SurfaceDependencyTracker is asked to track the resolution of its dependencies. SurfaceDependencyTracker will call back into the Surface to report when a dependency has been activated. For the time being (until SurfaceReference work is complete), the first CompositorFrame submitted with unresolved dependencies will trigger a global deadline. The deadline will be cleared if all dependencies are resolved within the alloted time window. If dependencies are not resolved before the deadline, then SurfaceDependencyTracker will forcibly activate currently pending frames. BUG=672962 TBR=reveman@chromium.org for trivial exo change. TBR=tsepez@chromium.org for minor ipc change. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2676373004 Cr-Commit-Position: refs/heads/master@{#449182} Committed: https://chromium.googlesource.com/chromium/src/+/cb618a172eafc9c9d902ff7257a8e72d8bb764d7

Patch Set 1 #

Patch Set 2 : Rename some things #

Patch Set 3 : GetEligibleFrame => GetActiveFrame, HasFrame => HasActiveFrame #

Patch Set 4 : Add a bunch of comments. TODO: Cleanup unit tests #

Patch Set 5 : DisplayCompositorLockManager => SurfaceDependencyTracker. Added More Comments #

Total comments: 66

Patch Set 6 : respect_deadline => can_activate_without_dependencies #

Patch Set 7 : Cleanup SurfaceManager #

Patch Set 8 : Fix debug build of Chrome #

Patch Set 9 : Addressed Vlad's comments #

Patch Set 10 : Fix exo #

Patch Set 11 : Fix Windows build and some broken unit tests #

Patch Set 12 : Revert SurfaceIdAllocator change for real #

Patch Set 13 : Rebase #

Patch Set 14 : Use base::flat_set #

Total comments: 34

Patch Set 15 : Addressed Vlad and Rob's comments #

Patch Set 16 : Add a missing comment #

Total comments: 1

Patch Set 17 : Better unit test name #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+1046 lines, -84 lines) Patch
M cc/ipc/compositor_frame_metadata.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/compositor_frame_metadata_struct_traits.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M cc/ipc/compositor_frame_metadata_struct_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M cc/output/compositor_frame_metadata.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M cc/surfaces/BUILD.gn View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M cc/surfaces/display.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M cc/surfaces/local_surface_id.h View 1 chunk +1 line, -0 lines 0 comments Download
A cc/surfaces/pending_frame_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +41 lines, -0 lines 0 comments Download
M cc/surfaces/surface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +35 lines, -4 lines 1 comment Download
M cc/surfaces/surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +188 lines, -53 lines 2 comments Download
M cc/surfaces/surface_aggregator.cc View 1 2 4 chunks +8 lines, -8 lines 0 comments Download
M cc/surfaces/surface_aggregator_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
A cc/surfaces/surface_dependency_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +93 lines, -0 lines 1 comment Download
A cc/surfaces/surface_dependency_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +180 lines, -0 lines 3 comments Download
M cc/surfaces/surface_factory.h View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -2 lines 0 comments Download
M cc/surfaces/surface_factory.cc View 1 2 3 4 5 6 7 8 2 chunks +27 lines, -6 lines 0 comments Download
M cc/surfaces/surface_factory_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/surfaces/surface_hittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M cc/surfaces/surface_manager.h View 1 2 3 4 3 chunks +11 lines, -0 lines 0 comments Download
M cc/surfaces/surface_manager.cc View 1 2 3 4 5 6 7 2 chunks +22 lines, -3 lines 0 comments Download
M cc/surfaces/surface_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +404 lines, -0 lines 0 comments Download
M components/exo/surface_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 67 (53 generated)
Fady Samuel
+danakj@ for review +rjkroege@ FYI [happy to get comments too :-)]
3 years, 10 months ago (2017-02-07 17:19:46 UTC) #7
Fady Samuel
+kylechar@ FYI
3 years, 10 months ago (2017-02-07 17:21:54 UTC) #9
danakj
=> vmpstr
3 years, 10 months ago (2017-02-07 19:44:04 UTC) #11
vmpstr
sorry, missed a few patchsets, so some comments might not apply? https://codereview.chromium.org/2676373004/diff/80001/cc/ipc/compositor_frame_metadata.mojom File cc/ipc/compositor_frame_metadata.mojom (right): ...
3 years, 10 months ago (2017-02-07 22:46:20 UTC) #22
Fady Samuel
Thank you for the thorough comments, Vlad! PTAL! https://codereview.chromium.org/2676373004/diff/80001/cc/ipc/compositor_frame_metadata.mojom File cc/ipc/compositor_frame_metadata.mojom (right): https://codereview.chromium.org/2676373004/diff/80001/cc/ipc/compositor_frame_metadata.mojom#newcode33 cc/ipc/compositor_frame_metadata.mojom:33: bool ...
3 years, 10 months ago (2017-02-08 00:52:50 UTC) #26
vmpstr
https://codereview.chromium.org/2676373004/diff/250001/cc/output/compositor_frame_metadata.h File cc/output/compositor_frame_metadata.h (right): https://codereview.chromium.org/2676373004/diff/250001/cc/output/compositor_frame_metadata.h#newcode83 cc/output/compositor_frame_metadata.h:83: bool can_activate_without_dependencies = true; Based on the comment, I ...
3 years, 10 months ago (2017-02-08 19:25:40 UTC) #44
rjkroege
https://codereview.chromium.org/2676373004/diff/250001/cc/output/compositor_frame_metadata.h File cc/output/compositor_frame_metadata.h (right): https://codereview.chromium.org/2676373004/diff/250001/cc/output/compositor_frame_metadata.h#newcode83 cc/output/compositor_frame_metadata.h:83: bool can_activate_without_dependencies = true; how about activation_can_ignore_missing_dependencies https://codereview.chromium.org/2676373004/diff/250001/cc/surfaces/pending_frame_observer.h File ...
3 years, 10 months ago (2017-02-08 21:52:30 UTC) #45
Fady Samuel
PTAL Vlad! :D https://codereview.chromium.org/2676373004/diff/250001/cc/output/compositor_frame_metadata.h File cc/output/compositor_frame_metadata.h (right): https://codereview.chromium.org/2676373004/diff/250001/cc/output/compositor_frame_metadata.h#newcode83 cc/output/compositor_frame_metadata.h:83: bool can_activate_without_dependencies = true; On 2017/02/08 ...
3 years, 10 months ago (2017-02-08 23:39:58 UTC) #46
vmpstr
lgtm https://codereview.chromium.org/2676373004/diff/280001/cc/surfaces/surface_unittest.cc File cc/surfaces/surface_unittest.cc (right): https://codereview.chromium.org/2676373004/diff/280001/cc/surfaces/surface_unittest.cc#newcode48 cc/surfaces/surface_unittest.cc:48: TEST(SurfaceTest, DisplayCompositorLocking1) { nit: DisplayCompositorLockingOneBlockedOnTwo
3 years, 10 months ago (2017-02-08 23:47:46 UTC) #49
Fady Samuel
+tsepez@ for cc/ipc +reveman@ for exo (TBR'ing).
3 years, 10 months ago (2017-02-09 00:06:01 UTC) #53
reveman
components/exo lgtm
3 years, 10 months ago (2017-02-09 00:41:10 UTC) #58
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/2676373004/300001
3 years, 10 months ago (2017-02-09 01:31:30 UTC) #63
commit-bot: I haz the power
Committed patchset #17 (id:300001) as https://chromium.googlesource.com/chromium/src/+/cb618a172eafc9c9d902ff7257a8e72d8bb764d7
3 years, 10 months ago (2017-02-09 01:39:17 UTC) #66
kylechar
3 years, 10 months ago (2017-02-09 15:50:32 UTC) #67
Message was sent while issue was closed.
Didn't notice it was submitted before looking it over. Here are a couple of
comment/include issues I noticed if you're modifying the files again in a
subsequent CL.

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface.cc
File cc/surfaces/surface.cc (right):

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface.cc...
cc/surfaces/surface.cc:15: #include "cc/surfaces/pending_frame_observer.h"
Duplicate include.

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface.cc...
cc/surfaces/surface.cc:196: base::flat_set<SurfaceId> new_blocking_surfaces;
Why mix SurfaceDependencies and base::flat_set<SurfaceId>?

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface.h
File cc/surfaces/surface.h (right):

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface.h#...
cc/surfaces/surface.h:115: void ActivatePendingFrame();
What does ActivePendingFrame() do exactly? Can you leave a comment.

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface_de...
File cc/surfaces/surface_dependency_tracker.cc (right):

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface_de...
cc/surfaces/surface_dependency_tracker.cc:1: // Copyright 2016 The Chromium
Authors. All rights reserved.
2017

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface_de...
cc/surfaces/surface_dependency_tracker.cc:7: #include "cc/surfaces/surface.h"
Duplicate include.

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface_de...
cc/surfaces/surface_dependency_tracker.cc:15: }
}  // namespace

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface_de...
File cc/surfaces/surface_dependency_tracker.h (right):

https://codereview.chromium.org/2676373004/diff/300001/cc/surfaces/surface_de...
cc/surfaces/surface_dependency_tracker.h:8: #include
"cc/scheduler/begin_frame_source.h"
#include "base/macros.h"

Powered by Google App Engine
This is Rietveld 408576698