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

Unified Diff: third_party/WebKit/Source/platform/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: Created 4 years, 11 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/CompositorFactory.cpp
diff --git a/third_party/WebKit/Source/platform/CompositorFactory.cpp b/third_party/WebKit/Source/platform/CompositorFactory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..126ad3ece34c6ffc468dc7543cda25e6184d449b
--- /dev/null
+++ b/third_party/WebKit/Source/platform/CompositorFactory.cpp
@@ -0,0 +1,76 @@
+// 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/CompositorFactory.h"
+
+#include "platform/animation/WebFilterAnimationCurve.h"
+#include "platform/animation/WebFilterOperations.h"
+#include "platform/animation/WebFloatAnimationCurve.h"
+#include "platform/animation/WebTransformAnimationCurve.h"
+#include "platform/animation/WebTransformOperations.h"
+
+namespace blink {
+
+class CompositorFactoryImpl : public CompositorFactory {
+public:
+ WebFilterAnimationCurve* createFilterAnimationCurve() override
+ {
+ return new WebFilterAnimationCurve();
+ }
+
+ WebFloatAnimationCurve* createFloatAnimationCurve() override
+ {
+ return new WebFloatAnimationCurve();
+ }
+
+ WebScrollOffsetAnimationCurve* createScrollOffsetAnimationCurve(
+ WebFloatPoint targetValue,
+ WebCompositorAnimationCurve::TimingFunctionType timingFunctionType,
+ WebScrollOffsetAnimationCurve::ScrollDurationBehavior durationBehavior)
+ {
+ return new WebScrollOffsetAnimationCurve(targetValue, timingFunctionType,
+ durationBehavior);
+ }
+
+ WebTransformAnimationCurve* createTransformAnimationCurve() override
+ {
+ return new WebTransformAnimationCurve();
+ }
+
+ WebTransformOperations* createTransformOperations() override
+ {
+ return new WebTransformOperations();
+ }
+
+ WebFilterOperations* createFilterOperations() override
+ {
+ return new WebFilterOperations();
+ }
+};
+
+static CompositorFactory* s_factory = 0;
+
+void CompositorFactory::initializeDefault()
+{
+ s_factory = nullptr;
+}
+
+void CompositorFactory::initializeForTesting(scoped_ptr<CompositorFactory> factory)
+{
+ s_factory = factory.release();
+}
+
+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