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

Unified Diff: sky/engine/core/animation/StringKeyframe.cpp

Issue 1229273004: Remove Animations and Transitions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « sky/engine/core/animation/StringKeyframe.h ('k') | sky/engine/core/animation/StyleInterpolation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/animation/StringKeyframe.cpp
diff --git a/sky/engine/core/animation/StringKeyframe.cpp b/sky/engine/core/animation/StringKeyframe.cpp
deleted file mode 100644
index 605a58856a7da725023be4e91c33c1a6846ebc56..0000000000000000000000000000000000000000
--- a/sky/engine/core/animation/StringKeyframe.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright 2014 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 "sky/engine/core/animation/StringKeyframe.h"
-
-#include "sky/engine/core/animation/DefaultStyleInterpolation.h"
-#include "sky/engine/core/animation/DeferredLegacyStyleInterpolation.h"
-#include "sky/engine/core/animation/LegacyStyleInterpolation.h"
-#include "sky/engine/core/animation/LengthStyleInterpolation.h"
-#include "sky/engine/core/animation/css/CSSAnimations.h"
-#include "sky/engine/core/css/CSSPropertyMetadata.h"
-#include "sky/engine/core/css/resolver/StyleResolver.h"
-#include "sky/engine/core/rendering/style/RenderStyle.h"
-
-namespace blink {
-
-StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom)
- : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing)
- , m_propertySet(copyFrom.m_propertySet->mutableCopy())
-{
-}
-
-void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& value, StyleSheetContents* styleSheetContents)
-{
- ASSERT(property != CSSPropertyInvalid);
- if (CSSAnimations::isAllowedAnimation(property))
- m_propertySet->setProperty(property, value, styleSheetContents);
-}
-
-PropertySet StringKeyframe::properties() const
-{
- // This is not used in time-critical code, so we probably don't need to
- // worry about caching this result.
- PropertySet properties;
- for (unsigned i = 0; i < m_propertySet->propertyCount(); ++i)
- properties.add(m_propertySet->propertyAt(i).id());
- return properties;
-}
-
-PassRefPtr<Keyframe> StringKeyframe::clone() const
-{
- return adoptRef(new StringKeyframe(*this));
-}
-PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::createPropertySpecificKeyframe(CSSPropertyID property) const
-{
- return adoptPtr(new PropertySpecificKeyframe(offset(), &easing(), propertyValue(property), composite()));
-}
-
-StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue* value, AnimationEffect::CompositeOperation op)
- : Keyframe::PropertySpecificKeyframe(offset, easing, op)
- , m_value(value)
-{ }
-
-StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue* value)
- : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::CompositeReplace)
- , m_value(value)
-{
- ASSERT(!isNull(m_offset));
-}
-
-PassRefPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::createInterpolation(CSSPropertyID property, Keyframe::PropertySpecificKeyframe* end, Element* element) const
-{
- CSSValue* fromCSSValue = m_value.get();
- CSSValue* toCSSValue = toStringPropertySpecificKeyframe(end)->value();
- ValueRange range = ValueRangeAll;
-
- if (!CSSPropertyMetadata::isAnimatableProperty(property))
- return DefaultStyleInterpolation::create(fromCSSValue, toCSSValue, property);
-
- switch (property) {
- case CSSPropertyBorderBottomWidth:
- case CSSPropertyBorderLeftWidth:
- case CSSPropertyBorderRightWidth:
- case CSSPropertyBorderTopWidth:
- case CSSPropertyFontSize:
- case CSSPropertyHeight:
- case CSSPropertyLineHeight:
- case CSSPropertyMaxHeight:
- case CSSPropertyMaxWidth:
- case CSSPropertyMinHeight:
- case CSSPropertyMinWidth:
- case CSSPropertyOutlineWidth:
- case CSSPropertyPaddingBottom:
- case CSSPropertyPaddingLeft:
- case CSSPropertyPaddingRight:
- case CSSPropertyPaddingTop:
- case CSSPropertyPerspective:
- case CSSPropertyWidth:
- range = ValueRangeNonNegative;
- // Fall through
- case CSSPropertyBottom:
- case CSSPropertyLeft:
- case CSSPropertyLetterSpacing:
- case CSSPropertyMarginBottom:
- case CSSPropertyMarginLeft:
- case CSSPropertyMarginRight:
- case CSSPropertyMarginTop:
- case CSSPropertyOutlineOffset:
- case CSSPropertyRight:
- case CSSPropertyTop:
- case CSSPropertyVerticalAlign:
- case CSSPropertyWordSpacing:
- if (LengthStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInterpolation::canCreateFrom(*toCSSValue))
- return LengthStyleInterpolation::create(fromCSSValue, toCSSValue, property, range);
- break;
- default:
- break;
- }
-
- if (DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*fromCSSValue) || DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(*toCSSValue))
- return DeferredLegacyStyleInterpolation::create(fromCSSValue, toCSSValue, property);
-
- // FIXME: Remove the use of AnimatableValues, RenderStyles and Elements here.
- // FIXME: Remove this cache
- ASSERT(element);
- if (!m_animatableValueCache)
- m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(*element, property, *fromCSSValue);
-
- RefPtr<AnimatableValue> to = StyleResolver::createAnimatableValueSnapshot(*element, property, *toCSSValue);
- toStringPropertySpecificKeyframe(end)->m_animatableValueCache = to;
-
- return LegacyStyleInterpolation::create(m_animatableValueCache.get(), to.release(), property);
-}
-
-PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const
-{
- return adoptPtr(new PropertySpecificKeyframe(offset, easing, 0, AnimationEffect::CompositeAdd));
-}
-
-PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificKeyframe::cloneWithOffset(double offset) const
-{
- Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe(offset, m_easing, m_value.get());
- toStringPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_animatableValueCache;
- return adoptPtr(theClone);
-}
-
-}
« no previous file with comments | « sky/engine/core/animation/StringKeyframe.h ('k') | sky/engine/core/animation/StyleInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698