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

Side by Side Diff: Source/core/animation/AnimatableLength.h

Issue 64293008: Wrap CSS length conversion arguments in an object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: don't make it noncopyable ; clang doesn't do the RVO stuffs? Created 7 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 static PassRefPtr<AnimatableLength> create(CSSValue*); 66 static PassRefPtr<AnimatableLength> create(CSSValue*);
67 static PassRefPtr<AnimatableLength> create(double number, NumberUnitType uni tType, CSSPrimitiveValue* cssPrimitiveValue = 0) 67 static PassRefPtr<AnimatableLength> create(double number, NumberUnitType uni tType, CSSPrimitiveValue* cssPrimitiveValue = 0)
68 { 68 {
69 return adoptRef(new AnimatableLength(number, unitType, cssPrimitiveValue )); 69 return adoptRef(new AnimatableLength(number, unitType, cssPrimitiveValue ));
70 } 70 }
71 static PassRefPtr<AnimatableLength> create(PassRefPtr<CSSCalcExpressionNode> calcExpression, CSSPrimitiveValue* cssPrimitiveValue = 0) 71 static PassRefPtr<AnimatableLength> create(PassRefPtr<CSSCalcExpressionNode> calcExpression, CSSPrimitiveValue* cssPrimitiveValue = 0)
72 { 72 {
73 return adoptRef(new AnimatableLength(calcExpression, cssPrimitiveValue)) ; 73 return adoptRef(new AnimatableLength(calcExpression, cssPrimitiveValue)) ;
74 } 74 }
75 PassRefPtr<CSSValue> toCSSValue(NumberRange = AllValues) const; 75 PassRefPtr<CSSValue> toCSSValue(NumberRange = AllValues) const;
76 Length toLength(const RenderStyle* currStyle, const RenderStyle* rootStyle, double zoom, NumberRange = AllValues) const; 76 Length toLength(const CSSToLengthConversionData&, NumberRange = AllValues) c onst;
77 77
78 protected: 78 protected:
79 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do uble fraction) const OVERRIDE; 79 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do uble fraction) const OVERRIDE;
80 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV ERRIDE; 80 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV ERRIDE;
81 81
82 private: 82 private:
83 AnimatableLength(double number, NumberUnitType unitType, CSSPrimitiveValue* cssPrimitiveValue) 83 AnimatableLength(double number, NumberUnitType unitType, CSSPrimitiveValue* cssPrimitiveValue)
84 : m_number(number) 84 : m_number(number)
85 , m_unitType(unitType) 85 , m_unitType(unitType)
86 , m_cachedCSSPrimitiveValue(cssPrimitiveValue) 86 , m_cachedCSSPrimitiveValue(cssPrimitiveValue)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 mutable RefPtr<CSSPrimitiveValue> m_cachedCSSPrimitiveValue; 152 mutable RefPtr<CSSPrimitiveValue> m_cachedCSSPrimitiveValue;
153 153
154 friend class AnimationAnimatableLengthTest; 154 friend class AnimationAnimatableLengthTest;
155 }; 155 };
156 156
157 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength()); 157 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength());
158 158
159 } // namespace WebCore 159 } // namespace WebCore
160 160
161 #endif // AnimatableLength_h 161 #endif // AnimatableLength_h
OLDNEW
« no previous file with comments | « Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl ('k') | Source/core/animation/AnimatableLength.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698