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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 { | 62 { |
63 return compareCSSValuePtr(m_color, other.m_color) | 63 return compareCSSValuePtr(m_color, other.m_color) |
64 && compareCSSValuePtr(m_position, other.m_position); | 64 && compareCSSValuePtr(m_position, other.m_position); |
65 } | 65 } |
66 bool isHint() const | 66 bool isHint() const |
67 { | 67 { |
68 ASSERT(m_color || m_position); | 68 ASSERT(m_color || m_position); |
69 return !m_color; | 69 return !m_color; |
70 } | 70 } |
71 | 71 |
72 void trace(Visitor*); | 72 DECLARE_TRACE(); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace blink | 75 } // namespace blink |
76 | 76 |
77 | 77 |
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 { |
(...skipping 20 matching lines...) Expand all Loading... |
103 CSSGradientType gradientType() const { return m_gradientType; } | 103 CSSGradientType gradientType() const { return m_gradientType; } |
104 | 104 |
105 bool isFixedSize() const { return false; } | 105 bool isFixedSize() const { return false; } |
106 IntSize fixedSize(const LayoutObject*) const { return IntSize(); } | 106 IntSize fixedSize(const LayoutObject*) const { return IntSize(); } |
107 | 107 |
108 bool isPending() const { return false; } | 108 bool isPending() const { return false; } |
109 bool knownToBeOpaque(const LayoutObject*) const; | 109 bool knownToBeOpaque(const LayoutObject*) const; |
110 | 110 |
111 void loadSubimages(ResourceFetcher*) { } | 111 void loadSubimages(ResourceFetcher*) { } |
112 | 112 |
113 void traceAfterDispatch(Visitor*); | 113 DECLARE_TRACE_AFTER_DISPATCH(); |
114 | 114 |
115 protected: | 115 protected: |
116 CSSGradientValue(ClassType classType, CSSGradientRepeat repeat, CSSGradientT
ype gradientType) | 116 CSSGradientValue(ClassType classType, CSSGradientRepeat repeat, CSSGradientT
ype gradientType) |
117 : CSSImageGeneratorValue(classType) | 117 : CSSImageGeneratorValue(classType) |
118 , m_stopsSorted(false) | 118 , m_stopsSorted(false) |
119 , m_gradientType(gradientType) | 119 , m_gradientType(gradientType) |
120 , m_repeating(repeat == Repeating) | 120 , m_repeating(repeat == Repeating) |
121 { | 121 { |
122 } | 122 } |
123 | 123 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // Create the gradient for a given size. | 172 // Create the gradient for a given size. |
173 PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const
IntSize&, const LayoutObject&); | 173 PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const
IntSize&, const LayoutObject&); |
174 | 174 |
175 PassRefPtrWillBeRawPtr<CSSLinearGradientValue> clone() const | 175 PassRefPtrWillBeRawPtr<CSSLinearGradientValue> clone() const |
176 { | 176 { |
177 return adoptRefWillBeNoop(new CSSLinearGradientValue(*this)); | 177 return adoptRefWillBeNoop(new CSSLinearGradientValue(*this)); |
178 } | 178 } |
179 | 179 |
180 bool equals(const CSSLinearGradientValue&) const; | 180 bool equals(const CSSLinearGradientValue&) const; |
181 | 181 |
182 void traceAfterDispatch(Visitor*); | 182 DECLARE_TRACE_AFTER_DISPATCH(); |
183 | 183 |
184 private: | 184 private: |
185 CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSLinearGradient) | 185 CSSLinearGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSLinearGradient) |
186 : CSSGradientValue(LinearGradientClass, repeat, gradientType) | 186 : CSSGradientValue(LinearGradientClass, repeat, gradientType) |
187 { | 187 { |
188 } | 188 } |
189 | 189 |
190 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) | 190 explicit CSSLinearGradientValue(const CSSLinearGradientValue& other) |
191 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) | 191 : CSSGradientValue(other, LinearGradientClass, other.gradientType()) |
192 , m_angle(other.m_angle) | 192 , m_angle(other.m_angle) |
(...skipping 26 matching lines...) Expand all Loading... |
219 void setSizingBehavior(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_si
zingBehavior = val; } | 219 void setSizingBehavior(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_si
zingBehavior = val; } |
220 | 220 |
221 void setEndHorizontalSize(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m
_endHorizontalSize = val; } | 221 void setEndHorizontalSize(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m
_endHorizontalSize = val; } |
222 void setEndVerticalSize(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_e
ndVerticalSize = val; } | 222 void setEndVerticalSize(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_e
ndVerticalSize = val; } |
223 | 223 |
224 // Create the gradient for a given size. | 224 // Create the gradient for a given size. |
225 PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const
IntSize&, const LayoutObject&); | 225 PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const
IntSize&, const LayoutObject&); |
226 | 226 |
227 bool equals(const CSSRadialGradientValue&) const; | 227 bool equals(const CSSRadialGradientValue&) const; |
228 | 228 |
229 void traceAfterDispatch(Visitor*); | 229 DECLARE_TRACE_AFTER_DISPATCH(); |
230 | 230 |
231 private: | 231 private: |
232 CSSRadialGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSRadialGradient) | 232 CSSRadialGradientValue(CSSGradientRepeat repeat, CSSGradientType gradientTyp
e = CSSRadialGradient) |
233 : CSSGradientValue(RadialGradientClass, repeat, gradientType) | 233 : CSSGradientValue(RadialGradientClass, repeat, gradientType) |
234 { | 234 { |
235 } | 235 } |
236 | 236 |
237 explicit CSSRadialGradientValue(const CSSRadialGradientValue& other) | 237 explicit CSSRadialGradientValue(const CSSRadialGradientValue& other) |
238 : CSSGradientValue(other, RadialGradientClass, other.gradientType()) | 238 : CSSGradientValue(other, RadialGradientClass, other.gradientType()) |
239 , m_firstRadius(other.m_firstRadius) | 239 , m_firstRadius(other.m_firstRadius) |
(...skipping 19 matching lines...) Expand all Loading... |
259 | 259 |
260 RefPtrWillBeMember<CSSPrimitiveValue> m_endHorizontalSize; | 260 RefPtrWillBeMember<CSSPrimitiveValue> m_endHorizontalSize; |
261 RefPtrWillBeMember<CSSPrimitiveValue> m_endVerticalSize; | 261 RefPtrWillBeMember<CSSPrimitiveValue> m_endVerticalSize; |
262 }; | 262 }; |
263 | 263 |
264 DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue()); | 264 DEFINE_CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue()); |
265 | 265 |
266 } // namespace blink | 266 } // namespace blink |
267 | 267 |
268 #endif // CSSGradientValue_h | 268 #endif // CSSGradientValue_h |
OLD | NEW |