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

Unified Diff: Source/core/svg/SVGAnimatedRect.cpp

Issue 132233010: [SVG] SVGAnimatedRect migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebsaed Created 6 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
« no previous file with comments | « Source/core/svg/SVGAnimatedRect.h ('k') | Source/core/svg/SVGAnimatedType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimatedRect.cpp
diff --git a/Source/core/svg/SVGAnimatedRect.cpp b/Source/core/svg/SVGAnimatedRect.cpp
deleted file mode 100644
index be2b0e1b7b6c15f61fbeb8e2b3258a8549c8edd4..0000000000000000000000000000000000000000
--- a/Source/core/svg/SVGAnimatedRect.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/svg/SVGAnimatedRect.h"
-
-#include "core/svg/SVGAnimateElement.h"
-#include "core/svg/SVGParserUtilities.h"
-
-namespace WebCore {
-
-SVGAnimatedRectAnimator::SVGAnimatedRectAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement)
- : SVGAnimatedTypeAnimator(AnimatedRect, animationElement, contextElement)
-{
-}
-
-PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::constructFromString(const String& string)
-{
- OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createRect(new SVGRect);
- parseRect(string, animatedType->rect());
- return animatedType.release();
-}
-
-PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- return SVGAnimatedType::createRect(constructFromBaseValue<SVGAnimatedRect>(animatedTypes));
-}
-
-void SVGAnimatedRectAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- stopAnimValAnimationForType<SVGAnimatedRect>(animatedTypes);
-}
-
-void SVGAnimatedRectAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType* type)
-{
- resetFromBaseValue<SVGAnimatedRect>(animatedTypes, type, &SVGAnimatedType::rect);
-}
-
-void SVGAnimatedRectAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- animValWillChangeForType<SVGAnimatedRect>(animatedTypes);
-}
-
-void SVGAnimatedRectAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- animValDidChangeForType<SVGAnimatedRect>(animatedTypes);
-}
-
-void SVGAnimatedRectAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to)
-{
- ASSERT(from->type() == AnimatedRect);
- ASSERT(from->type() == to->type());
-
- to->rect() += from->rect();
-}
-
-void SVGAnimatedRectAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated)
-{
- ASSERT(m_animationElement);
- ASSERT(m_contextElement);
-
- const SVGRect& fromRect = m_animationElement->animationMode() == ToAnimation ? animated->rect() : from->rect();
- const SVGRect& toRect = to->rect();
- const SVGRect& toAtEndOfDurationRect = toAtEndOfDuration->rect();
- SVGRect& animatedRect = animated->rect();
-
- float animatedX = animatedRect.x();
- float animatedY = animatedRect.y();
- float animatedWidth = animatedRect.width();
- float animatedHeight = animatedRect.height();
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.x(), toRect.x(), toAtEndOfDurationRect.x(), animatedX);
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.y(), toRect.y(), toAtEndOfDurationRect.y(), animatedY);
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.width(), toRect.width(), toAtEndOfDurationRect.width(), animatedWidth);
- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.height(), toRect.height(), toAtEndOfDurationRect.height(), animatedHeight);
-
- animatedRect = SVGRect(animatedX, animatedY, animatedWidth, animatedHeight);
-}
-
-float SVGAnimatedRectAnimator::calculateDistance(const String&, const String&)
-{
- // FIXME: Distance calculation is not possible for SVGRect right now. We need the distance of for every single value.
- return -1;
-}
-
-}
« no previous file with comments | « Source/core/svg/SVGAnimatedRect.h ('k') | Source/core/svg/SVGAnimatedType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698