New issue
Advanced search Search tips
Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature


Sign in to add a comment
link

Issue 731727: AnimationWorklet - Use a dedicated backing thread

Reported by majidvp@chromium.org, Jun 9 2017 Project Member

Issue description

At the moment animation worklets are running on the compositor thread [1]. We should move to having a dedicated "Animation Thread" for animation worklet tasks. 

At the moment, this involves the following changes:
 - AnimationWorklet should create its own backing thread
 - Introduce a new CompositorAnimator implementation that posts tasks 
   to animation thread upon mutation.
 - Use this new CompositorAnimator to worklet rAF

Note that currently we don't use the MutatbleStateProvider with
animation worklet so the only state that needs to be passed
across thread is just the monotonic time of the frame.

[1] https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.cpp?type=cs&sq=package:chromium&l=51
 

Comment 1 by majidvp@chromium.org, Jun 9 2017

Blocking: 430155
Labels: Hotlist-ThreadedRendering

Comment 2 by majidvp@chromium.org, Jun 9 2017

Cc: smcgruer@chromium.org ikilpatrick@chromium.org
 Issue 666032  has been merged into this issue.

Comment 3 by majidvp@chromium.org, Jun 26 2017

FWIW, I think AudioWorklet creates its own backing thread so first part of this task should be similar. See for example: https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/modules/webaudio/AudioWorkletThread.h

Comment 4 by nhiroki@chromium.org, Sep 8 2017

Status: Started (was: Assigned)

Comment 5 by nhiroki@chromium.org, Sep 8 2017

Blocking: 714873

Comment 6 by flackr@chromium.org, Dec 2 2017

Blocking: 791280

Comment 7 by petermayo@chromium.org, Feb 2 2018

Labels: -OS-Android

Comment 8 by bugdroid1@chromium.org, Mar 19 2018

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d13bc9cfaa290602169197d0a2cf82fee1f016d7

commit d13bc9cfaa290602169197d0a2cf82fee1f016d7
Author: Peter Mayo <petermayo@chromium.org>
Date: Mon Mar 19 21:44:07 2018

[animation-worklet] Move work to a separate backing thread

This version introduces the backing thread.
It uses a completion event to do the animation synchronously; this
lines up with the division of tasks outlined in the task issues.
The mutation update is sent synchronously.
In moving some classes (CompositorMutator based) to a compositor managed
lifetime they change to refcounting to match the thread behavior.

Bug:  731727 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia774e53b5bf34e0cef5d7f0dd9d02fc3b27f4b20
Reviewed-on: https://chromium-review.googlesource.com/630857
Commit-Queue: Peter Mayo <petermayo@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544171}
[add] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/cc/animation/worklet_animation_player_unittest.cc
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/cc/test/mock_layer_tree_mutator.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/exported/WebViewImpl.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/frame/WebViewFrameWidget.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/frame/WebViewFrameWidget.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/core/workers/WorkletThreadHolder.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletGlobalScope.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletProxyClientImpl.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletProxyClientImpl.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThread.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThread.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThreadTest.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/platform/graphics/CompositorAnimator.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/platform/graphics/CompositorMutator.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.h
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/platform/graphics/CompositorMutatorImpl.cpp
[modify] https://crrev.com/d13bc9cfaa290602169197d0a2cf82fee1f016d7/third_party/WebKit/Source/platform/graphics/CompositorMutatorImpl.h

Comment 9 by petermayo@chromium.org, Apr 12 2018

Owner: ----
Status: Fixed (was: Started)

Comment 10 by smcgruer@chromium.org, Apr 12 2018

Owner: petermayo@chromium.org

Sign in to add a comment