| Index: Source/core/platform/CalculationValue.h
|
| diff --git a/Source/core/platform/CalculationValue.h b/Source/core/platform/CalculationValue.h
|
| index 55d5f9e8f21c9e15ba04326fb4a80ec505f690e0..03348bcf8ff1e6c8e5c4a9a119dfce1f203201c0 100644
|
| --- a/Source/core/platform/CalculationValue.h
|
| +++ b/Source/core/platform/CalculationValue.h
|
| @@ -59,7 +59,7 @@ enum CalcExpressionNodeType {
|
| CalcExpressionNodeBinaryOperation,
|
| CalcExpressionNodeBlendLength,
|
| };
|
| -
|
| +
|
| class CalcExpressionNode {
|
| WTF_MAKE_FAST_ALLOCATED;
|
| public:
|
| @@ -67,37 +67,37 @@ public:
|
| : m_type(CalcExpressionNodeUndefined)
|
| {
|
| }
|
| -
|
| +
|
| virtual ~CalcExpressionNode()
|
| {
|
| }
|
| -
|
| +
|
| virtual float evaluate(float maxValue) const = 0;
|
| virtual bool operator==(const CalcExpressionNode&) const = 0;
|
|
|
| CalcExpressionNodeType type() const { return m_type; }
|
| -
|
| +
|
| protected:
|
| CalcExpressionNodeType m_type;
|
| };
|
| -
|
| +
|
| class CalculationValue : public RefCounted<CalculationValue> {
|
| public:
|
| static PassRefPtr<CalculationValue> create(PassOwnPtr<CalcExpressionNode> value, CalculationPermittedValueRange);
|
| float evaluate(float maxValue) const;
|
|
|
| - bool operator==(const CalculationValue& o) const
|
| - {
|
| + bool operator==(const CalculationValue& o) const
|
| + {
|
| return *(m_value.get()) == *(o.m_value.get());
|
| }
|
| -
|
| +
|
| private:
|
| CalculationValue(PassOwnPtr<CalcExpressionNode> value, CalculationPermittedValueRange range)
|
| : m_value(value)
|
| , m_isNonNegative(range == CalculationRangeNonNegative)
|
| {
|
| }
|
| -
|
| +
|
| OwnPtr<CalcExpressionNode> m_value;
|
| bool m_isNonNegative;
|
| };
|
| @@ -119,12 +119,12 @@ public:
|
| {
|
| return type() == o.type() && *this == static_cast<const CalcExpressionNumber&>(o);
|
| }
|
| -
|
| - virtual float evaluate(float) const
|
| +
|
| + virtual float evaluate(float) const
|
| {
|
| return m_value;
|
| }
|
| -
|
| +
|
| private:
|
| float m_value;
|
| };
|
| @@ -141,17 +141,17 @@ public:
|
| {
|
| return m_length == o.m_length;
|
| }
|
| -
|
| +
|
| virtual bool operator==(const CalcExpressionNode& o) const
|
| {
|
| return type() == o.type() && *this == static_cast<const CalcExpressionLength&>(o);
|
| }
|
| -
|
| +
|
| virtual float evaluate(float maxValue) const
|
| {
|
| return floatValueForLength(m_length, maxValue);
|
| }
|
| -
|
| +
|
| private:
|
| Length m_length;
|
| };
|
| @@ -175,8 +175,8 @@ public:
|
| {
|
| return type() == o.type() && *this == static_cast<const CalcExpressionBinaryOperation&>(o);
|
| }
|
| -
|
| -
|
| +
|
| +
|
| virtual float evaluate(float) const;
|
|
|
| private:
|
| @@ -194,28 +194,28 @@ public:
|
| {
|
| m_type = CalcExpressionNodeBlendLength;
|
| }
|
| -
|
| +
|
| bool operator==(const CalcExpressionBlendLength& o) const
|
| {
|
| return m_progress == o.m_progress && m_from == o.m_from && m_to == o.m_to;
|
| }
|
| -
|
| +
|
| virtual bool operator==(const CalcExpressionNode& o) const
|
| {
|
| return type() == o.type() && *this == static_cast<const CalcExpressionBlendLength&>(o);
|
| }
|
| -
|
| +
|
| virtual float evaluate(float maxValue) const
|
| {
|
| return (1.0f - m_progress) * floatValueForLength(m_from, maxValue) + m_progress * floatValueForLength(m_to, maxValue);
|
| }
|
| -
|
| -private:
|
| +
|
| +private:
|
| Length m_from;
|
| Length m_to;
|
| float m_progress;
|
| };
|
| -
|
| +
|
| } // namespace WebCore
|
|
|
| #endif // CalculationValue_h
|
|
|