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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorFactory.cpp

Issue 1616653002: CC Animation: Move files from cc_blink to Source/platform/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Fix copyrights and years. Created 4 years, 10 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/platform/graphics/CompositorFactory.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorFactory.cpp b/third_party/WebKit/Source/platform/graphics/CompositorFactory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8695aeac3d3cc893b1df1aca3649b2232bf82461
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/CompositorFactory.cpp
@@ -0,0 +1,96 @@
+// Copyright 2016 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.
+
+#include "platform/graphics/CompositorFactory.h"
+
+#include "platform/animation/CompositorAnimation.h"
+#include "platform/animation/CompositorAnimationPlayer.h"
+#include "platform/animation/CompositorAnimationTimeline.h"
+#include "platform/animation/CompositorFilterAnimationCurve.h"
+#include "platform/animation/CompositorFloatAnimationCurve.h"
+#include "platform/animation/CompositorTransformAnimationCurve.h"
+#include "platform/animation/CompositorTransformOperations.h"
+#include "platform/graphics/CompositorFilterOperations.h"
+
+namespace blink {
+
+class CompositorFactoryImpl : public CompositorFactory {
+public:
+ CompositorFilterAnimationCurve* createFilterAnimationCurve() override
+ {
+ return new CompositorFilterAnimationCurve();
+ }
+
+ CompositorFloatAnimationCurve* createFloatAnimationCurve() override
+ {
+ return new CompositorFloatAnimationCurve();
+ }
+
+ CompositorScrollOffsetAnimationCurve* createScrollOffsetAnimationCurve(
+ FloatPoint targetValue,
+ CompositorAnimationCurve::TimingFunctionType timingFunctionType,
+ CompositorScrollOffsetAnimationCurve::ScrollDurationBehavior durationBehavior)
+ {
+ return new CompositorScrollOffsetAnimationCurve(targetValue, timingFunctionType,
+ durationBehavior);
+ }
+
+ CompositorTransformAnimationCurve* createTransformAnimationCurve() override
+ {
+ return new CompositorTransformAnimationCurve();
+ }
+
+ CompositorTransformOperations* createTransformOperations() override
+ {
+ return new CompositorTransformOperations();
+ }
+
+ CompositorFilterOperations* createFilterOperations() override
+ {
+ return new CompositorFilterOperations();
+ }
+
+ CompositorAnimation* createAnimation(const blink::CompositorAnimationCurve& curve, blink::CompositorAnimation::TargetProperty target, int groupId, int animationId) override
+ {
+ return new CompositorAnimation(curve, target, animationId, groupId);
+ }
+
+ CompositorAnimationPlayer* createAnimationPlayer()
+ {
+ return new CompositorAnimationPlayer();
+ }
+
+ CompositorAnimationTimeline* createAnimationTimeline()
+ {
+ return new CompositorAnimationTimeline();
+ }
+};
+
+static CompositorFactory* s_factory = 0;
+
+void CompositorFactory::initializeDefault()
+{
+ delete s_factory;
+ s_factory = new CompositorFactoryImpl();
+}
+
+void CompositorFactory::initializeForTesting(PassOwnPtr<CompositorFactory> factory)
+{
+ delete s_factory;
+ s_factory = factory.leakPtr();
+}
+
+void CompositorFactory::shutdown()
+{
+ delete s_factory;
+ s_factory = nullptr;
+}
+
+CompositorFactory& CompositorFactory::current()
+{
+ ASSERT(s_factory);
+ return *s_factory;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698