| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 void CSSGradientColorStop::trace(Visitor* visitor) | 46 void CSSGradientColorStop::trace(Visitor* visitor) |
| 47 { | 47 { |
| 48 visitor->trace(m_position); | 48 visitor->trace(m_position); |
| 49 visitor->trace(m_color); | 49 visitor->trace(m_color); |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize&
size) | 52 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize&
size) |
| 53 { | 53 { |
| 54 if (size.isEmpty()) | 54 if (size.isEmpty()) |
| 55 return 0; | 55 return nullptr; |
| 56 | 56 |
| 57 bool cacheable = isCacheable(); | 57 bool cacheable = isCacheable(); |
| 58 if (cacheable) { | 58 if (cacheable) { |
| 59 if (!clients().contains(renderer)) | 59 if (!clients().contains(renderer)) |
| 60 return 0; | 60 return nullptr; |
| 61 | 61 |
| 62 // Need to look up our size. Create a string of width*height to use as
a hash key. | 62 // Need to look up our size. Create a string of width*height to use as
a hash key. |
| 63 Image* result = getImage(renderer, size); | 63 Image* result = getImage(renderer, size); |
| 64 if (result) | 64 if (result) |
| 65 return result; | 65 return result; |
| 66 } | 66 } |
| 67 | 67 |
| 68 // We need to create an image. | 68 // We need to create an image. |
| 69 RefPtr<Gradient> gradient; | 69 RefPtr<Gradient> gradient; |
| 70 | 70 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 RefPtrWillBeRawPtr<CSSGradientValue> result; | 125 RefPtrWillBeRawPtr<CSSGradientValue> result; |
| 126 if (!derived) | 126 if (!derived) |
| 127 result = this; | 127 result = this; |
| 128 else if (isLinearGradientValue()) | 128 else if (isLinearGradientValue()) |
| 129 result = toCSSLinearGradientValue(this)->clone(); | 129 result = toCSSLinearGradientValue(this)->clone(); |
| 130 else if (isRadialGradientValue()) | 130 else if (isRadialGradientValue()) |
| 131 result = toCSSRadialGradientValue(this)->clone(); | 131 result = toCSSRadialGradientValue(this)->clone(); |
| 132 else { | 132 else { |
| 133 ASSERT_NOT_REACHED(); | 133 ASSERT_NOT_REACHED(); |
| 134 return 0; | 134 return nullptr; |
| 135 } | 135 } |
| 136 | 136 |
| 137 for (unsigned i = 0; i < result->m_stops.size(); i++) | 137 for (unsigned i = 0; i < result->m_stops.size(); i++) |
| 138 result->m_stops[i].m_resolvedColor = textLinkColors.colorFromPrimitiveVa
lue(result->m_stops[i].m_color.get(), currentColor); | 138 result->m_stops[i].m_resolvedColor = textLinkColors.colorFromPrimitiveVa
lue(result->m_stops[i].m_color.get(), currentColor); |
| 139 | 139 |
| 140 return result.release(); | 140 return result.release(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void CSSGradientValue::addStops(Gradient* gradient, const CSSToLengthConversionD
ata& conversionData, float maxLengthForRepeat) | 143 void CSSGradientValue::addStops(Gradient* gradient, const CSSToLengthConversionD
ata& conversionData, float maxLengthForRepeat) |
| 144 { | 144 { |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 visitor->trace(m_firstRadius); | 1187 visitor->trace(m_firstRadius); |
| 1188 visitor->trace(m_secondRadius); | 1188 visitor->trace(m_secondRadius); |
| 1189 visitor->trace(m_shape); | 1189 visitor->trace(m_shape); |
| 1190 visitor->trace(m_sizingBehavior); | 1190 visitor->trace(m_sizingBehavior); |
| 1191 visitor->trace(m_endHorizontalSize); | 1191 visitor->trace(m_endHorizontalSize); |
| 1192 visitor->trace(m_endVerticalSize); | 1192 visitor->trace(m_endVerticalSize); |
| 1193 CSSGradientValue::traceAfterDispatch(visitor); | 1193 CSSGradientValue::traceAfterDispatch(visitor); |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 } // namespace WebCore | 1196 } // namespace WebCore |
| OLD | NEW |