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

Unified Diff: third_party/WebKit/Source/core/animation/IntegerOptionalIntegerSVGInterpolation.cpp

Issue 1417483015: SVG Web Animations: Add SVGIntegerOptionalIntegerInterpolationType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More test work... Some failing Created 5 years, 1 month 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/IntegerOptionalIntegerSVGInterpolation.cpp
diff --git a/third_party/WebKit/Source/core/animation/IntegerOptionalIntegerSVGInterpolation.cpp b/third_party/WebKit/Source/core/animation/IntegerOptionalIntegerSVGInterpolation.cpp
deleted file mode 100644
index 095159df29656c21111f0be073a246b56b2003c3..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/animation/IntegerOptionalIntegerSVGInterpolation.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015 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 "config.h"
-#include "core/animation/IntegerOptionalIntegerSVGInterpolation.h"
-
-#include "core/SVGNames.h"
-
-namespace blink {
-
-namespace {
-
-// For order, the values must be integers greater than zero.
-// For filterRes, negative values are an error. Zero values disable rendering of the element which referenced the filter.
-PassRefPtrWillBeRawPtr<SVGInteger> toPositiveInteger(const InterpolableValue* number, int min)
-{
- return SVGInteger::create(clampTo<int>(roundf(toInterpolableNumber(number)->value()), min));
-}
-
-} // namespace
-
-PassOwnPtr<InterpolableValue> IntegerOptionalIntegerSVGInterpolation::toInterpolableValue(SVGPropertyBase* value)
-{
- RefPtrWillBeRawPtr<SVGIntegerOptionalInteger> integerOptionalInteger = toSVGIntegerOptionalInteger(value);
- OwnPtr<InterpolableList> result = InterpolableList::create(2);
- result->set(0, InterpolableNumber::create(integerOptionalInteger->firstInteger()->value()));
- result->set(1, InterpolableNumber::create(integerOptionalInteger->secondInteger()->value()));
- return result.release();
-}
-
-PassRefPtrWillBeRawPtr<SVGIntegerOptionalInteger> IntegerOptionalIntegerSVGInterpolation::fromInterpolableValue(const InterpolableValue& value, int min)
-{
- const InterpolableList& list = toInterpolableList(value);
- return SVGIntegerOptionalInteger::create(
- toPositiveInteger(list.get(0), min),
- toPositiveInteger(list.get(1), min));
-}
-
-}

Powered by Google App Engine
This is Rietveld 408576698