Commit fbb23ab0 authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

Animation worklet to always use compositor task queue

Split off from https://crrev.com/c/1751324

We want to prioritize loading and compositing task queues during early
load. For correct functioning of web tests we also need to prioritize
main thread animation worklet tasks. In general it makes sense for all
animation tasks to be posted to a compositor task queue regardless of
which thread they are on.

Bug: 971191
Change-Id: I9d26e1d8a54a3bb24a96781968890c277f795011
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762244Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689375}
parent 6758a087
......@@ -17,6 +17,7 @@
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
namespace blink {
......@@ -68,9 +69,12 @@ AnimationWorkletMutatorDispatcherImpl::AnimationWorkletMutatorDispatcherImpl(
bool main_thread_task_runner)
: client_(nullptr), outputs_(OutputVectorRef::Create()) {
// By default web tests run without threaded compositing. See
// https://crbug.com/770028 For these situations we run on the Main thread.
// https://crbug.com/770028. If threaded compositing is disabled or
// |main_thread_task_runner| is true we run on the main thread's compositor
// task runner otherwise we run tasks on the compositor thread's default
// task runner.
host_queue_ = main_thread_task_runner || !Thread::CompositorThread()
? Thread::MainThread()->GetTaskRunner()
? Thread::MainThread()->Scheduler()->CompositorTaskRunner()
: Thread::CompositorThread()->GetTaskRunner();
tick_clock_ = std::make_unique<base::DefaultTickClock>();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment