| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // We have to declare the VectorTraits specialization before CSSGradientValue | 78 // We have to declare the VectorTraits specialization before CSSGradientValue |
| 79 // declares its inline capacity vector below. | 79 // declares its inline capacity vector below. |
| 80 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSGradientColorStop); | 80 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSGradientColorStop); |
| 81 | 81 |
| 82 namespace blink { | 82 namespace blink { |
| 83 | 83 |
| 84 class CSSGradientValue : public CSSImageGeneratorValue { | 84 class CSSGradientValue : public CSSImageGeneratorValue { |
| 85 public: | 85 public: |
| 86 PassRefPtr<Image> image(LayoutObject*, const IntSize&); | 86 PassRefPtr<Image> image(LayoutObject*, const IntSize&); |
| 87 | 87 |
| 88 void setFirstX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_firstX = v
al; } | 88 void setFirstX(PassRefPtrWillBeRawPtr<CSSValue> val) { m_firstX = val; } |
| 89 void setFirstY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_firstY = v
al; } | 89 void setFirstY(PassRefPtrWillBeRawPtr<CSSValue> val) { m_firstY = val; } |
| 90 void setSecondX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_secondX =
val; } | 90 void setSecondX(PassRefPtrWillBeRawPtr<CSSValue> val) { m_secondX = val; } |
| 91 void setSecondY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_secondY =
val; } | 91 void setSecondY(PassRefPtrWillBeRawPtr<CSSValue> val) { m_secondY = val; } |
| 92 | 92 |
| 93 void addStop(const CSSGradientColorStop& stop) { m_stops.append(stop); } | 93 void addStop(const CSSGradientColorStop& stop) { m_stops.append(stop); } |
| 94 | 94 |
| 95 unsigned stopCount() const { return m_stops.size(); } | 95 unsigned stopCount() const { return m_stops.size(); } |
| 96 | 96 |
| 97 void appendCSSTextForDeprecatedColorStops(StringBuilder&) const; | 97 void appendCSSTextForDeprecatedColorStops(StringBuilder&) const; |
| 98 | 98 |
| 99 bool isRepeating() const { return m_repeating; } | 99 bool isRepeating() const { return m_repeating; } |
| 100 | 100 |
| 101 CSSGradientType gradientType() const { return m_gradientType; } | 101 CSSGradientType gradientType() const { return m_gradientType; } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 129 , m_stopsSorted(other.m_stopsSorted) | 129 , m_stopsSorted(other.m_stopsSorted) |
| 130 , m_gradientType(gradientType) | 130 , m_gradientType(gradientType) |
| 131 , m_repeating(other.isRepeating() ? Repeating : NonRepeating) | 131 , m_repeating(other.isRepeating() ? Repeating : NonRepeating) |
| 132 { | 132 { |
| 133 } | 133 } |
| 134 | 134 |
| 135 void addStops(Gradient*, const CSSToLengthConversionData&, const LayoutObjec
t&); | 135 void addStops(Gradient*, const CSSToLengthConversionData&, const LayoutObjec
t&); |
| 136 void addDeprecatedStops(Gradient*, const LayoutObject&); | 136 void addDeprecatedStops(Gradient*, const LayoutObject&); |
| 137 | 137 |
| 138 // Resolve points/radii to front end values. | 138 // Resolve points/radii to front end values. |
| 139 FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, const CSS
ToLengthConversionData&, const IntSize&); | 139 FloatPoint computeEndPoint(CSSValue*, CSSValue*, const CSSToLengthConversion
Data&, const IntSize&); |
| 140 | 140 |
| 141 bool isCacheable() const; | 141 bool isCacheable() const; |
| 142 | 142 |
| 143 // Points. Some of these may be null. | 143 // Points. Some of these may be null. |
| 144 RefPtrWillBeMember<CSSPrimitiveValue> m_firstX; | 144 RefPtrWillBeMember<CSSValue> m_firstX; |
| 145 RefPtrWillBeMember<CSSPrimitiveValue> m_firstY; | 145 RefPtrWillBeMember<CSSValue> m_firstY; |
| 146 | 146 |
| 147 RefPtrWillBeMember<CSSPrimitiveValue> m_secondX; | 147 RefPtrWillBeMember<CSSValue> m_secondX; |
| 148 RefPtrWillBeMember<CSSPrimitiveValue> m_secondY; | 148 RefPtrWillBeMember<CSSValue> m_secondY; |
| 149 | 149 |
| 150 // Stops | 150 // Stops |
| 151 WillBeHeapVector<CSSGradientColorStop, 2> m_stops; | 151 WillBeHeapVector<CSSGradientColorStop, 2> m_stops; |
| 152 bool m_stopsSorted; | 152 bool m_stopsSorted; |
| 153 CSSGradientType m_gradientType; | 153 CSSGradientType m_gradientType; |
| 154 bool m_repeating; | 154 bool m_repeating; |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 DEFINE_CSS_VALUE_TYPE_CASTS(CSSGradientValue, isGradientValue()); | 157 DEFINE_CSS_VALUE_TYPE_CASTS(CSSGradientValue, isGradientValue()); |
| 158 | 158 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 RefPtrWillBeMember<CSSPrimitiveValue> m_endHorizontalSize; | 259 RefPtrWillBeMember<CSSPrimitiveValue> m_endHorizontalSize; |
| 260 RefPtrWillBeMember<CSSPrimitiveValue> m_endVerticalSize; | 260 RefPtrWillBeMember<CSSPrimitiveValue> m_endVerticalSize; |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue()); | 263 DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue()); |
| 264 | 264 |
| 265 } // namespace blink | 265 } // namespace blink |
| 266 | 266 |
| 267 #endif // CSSGradientValue_h | 267 #endif // CSSGradientValue_h |
| OLD | NEW |