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

Unified Diff: third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp

Issue 2894233002: [animation-worklet] invoke animate callback on mutation signal (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp b/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
index f5095fe81c02fa0c11e849b15e3f8c2276a00fb8..15004ad94602c4c5568f8ef34012950a6eea92e4 100644
--- a/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
+++ b/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
@@ -21,12 +21,30 @@ DEFINE_TRACE(AnimationWorkletProxyClientImpl) {
CompositorAnimator::Trace(visitor);
}
+void AnimationWorkletProxyClientImpl::SetGlobalScope(
+ WorkletGlobalScope* scope) {
+ DCHECK(!IsMainThread());
+ DCHECK(scope);
+ global_scope_ = static_cast<AnimationWorkletGlobalScope*>(scope);
+ mutator_->RegisterCompositorAnimator(this);
+}
+
+void AnimationWorkletProxyClientImpl::Dispose() {
+ // At worklet scope termination break the reference cycle between
+ // CompositorMutatorImpl and AnimationProxyClientImpl and also the cycle
+ // between AnimationWorkletGlobalScope and AnimationWorkletProxyClientImpl.
+ mutator_->UnregisterCompositorAnimator(this);
+ global_scope_ = nullptr;
+}
+
bool AnimationWorkletProxyClientImpl::Mutate(
double monotonic_time_now,
CompositorMutableStateProvider* provider) {
DCHECK(!IsMainThread());
// TODO(majidvp): actually call JS |animate| callbacks.
+ if (global_scope_)
+ global_scope_->Mutate();
// Always request another rAF for now.
return true;
}
« no previous file with comments | « third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698