DescriptionMake OffscreenCanvas animation in sync with its placeholder canvas's parent frame rate
This CL makes OffscreenCanvasFrameDispatcherImpl::OnBeginFrame get fired when
the OffscreenCanvas's corresponding placeholder canvas's parent frame is
starting a new frame. In this way, we make sure that OffscreenCanvas animation
matches the frame rate of display, which is part of the spec requirement in
OffscreenCanvas
(https://wiki.whatwg.org/wiki/OffscreenCanvas.requestAnimationFrame).
Implementation in this CL can be broadly seen as two parts:
1. Registration of OffscreenCanvas's frame sink id to the FrameSinkHierarchy of
its parent frame's frame sink id. The parent frame sink id is obtained by
plumbing into WebLayerTreeView from HTMLCanvasElement; it is then sent to
OffscreenCanvasSurfaceImpl and cached there. When
OffscreenCanvasCompositorFrameSink is created (together with the support_), we
then register this parent-child hierarchy to SurfaceManager.
2. OffscreenCanvas signals that it needs BeginFrame when users invoke commit().
This allows OffscreenCanvas.beginFrame() to be triggered to either resolve an
existing promise and doCommit on the last overdraw compositorFrame sent by the
user in the same frame window. When a promise is resolved, OffscreenCanvas
signals that it no longer needs BeginFrame, so as to avoid overhead from its
parent frame.
BUG=674744
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/2644653003
Cr-Commit-Position: refs/heads/master@{#446898}
Committed: https://chromium.googlesource.com/chromium/src/+/d0df339711fb34c94decb02ac90e0d9fddc1e8d1
Patch Set 1 #Patch Set 2 : safeguard #
Total comments: 33
Patch Set 3 : fix based on fsamuel's feedback #
Total comments: 17
Patch Set 4 : fix based on both reviewers #
Total comments: 8
Patch Set 5 : edit based on feedback #Patch Set 6 : new test #
Total comments: 4
Patch Set 7 : No Mojo for frameless canvas #
Total comments: 1
Patch Set 8 : no new pixel test #Patch Set 9 : rebase #
Total comments: 7
Patch Set 10 : fix unit test compilation error #Patch Set 11 : change based on decheng feedback #Patch Set 12 : remove nullity check #Patch Set 13 : rebase #Patch Set 14 : rebase again #Messages
Total messages: 58 (34 generated)
|