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

Unified Diff: third_party/WebKit/Source/core/animation/WorkletAnimationController.h

Issue 2869183002: Initial implementation of WorkletAnimation (Closed)
Patch Set: Add more DCHECKs Created 3 years, 3 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
Index: third_party/WebKit/Source/core/animation/WorkletAnimationController.h
diff --git a/third_party/WebKit/Source/core/animation/WorkletAnimationController.h b/third_party/WebKit/Source/core/animation/WorkletAnimationController.h
new file mode 100644
index 0000000000000000000000000000000000000000..a086838f401d737135676360c81eee3afc23f2a9
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/WorkletAnimationController.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WorkletAnimationController_h
+#define WorkletAnimationController_h
+
+#include "core/CoreExport.h"
+#include "platform/heap/GarbageCollected.h"
+#include "platform/heap/HeapAllocator.h"
+#include "platform/heap/Visitor.h"
+
+namespace blink {
+
+class WorkletAnimationBase;
+
+// Handles AnimationWorklet animations on the main-thread.
+//
+// The WorkletAnimationController is responsible for owning WorkletAnimation
+// instances are long as they are relevant to the animation system. It is also
+// responsible for starting valid WorkletAnimations on the compositor side and
+// updating WorkletAnimations with updated results from their underpinning
+// AnimationWorklet animator instance.
+//
+// For more details on AnimationWorklet, see the spec:
+// https://wicg.github.io/animation-worklet
+class CORE_EXPORT WorkletAnimationController
+ : public GarbageCollectedFinalized<WorkletAnimationController> {
+ public:
+ WorkletAnimationController();
+ virtual ~WorkletAnimationController();
+
+ void AttachAnimation(WorkletAnimationBase&);
+ void DetachAnimation(WorkletAnimationBase&);
+
+ void Update();
+
+ DECLARE_TRACE();
+
+ private:
+ HeapHashSet<Member<WorkletAnimationBase>> pending_animations_;
+ HeapHashSet<Member<WorkletAnimationBase>> compositor_animations_;
+};
+
+} // namespace blink
+
+#endif // WorkletAnimationController_h

Powered by Google App Engine
This is Rietveld 408576698