| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2015 Google Inc. All rights reserved. | 3 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/css/CSSGradientValue.h" | 28 #include "core/css/CSSGradientValue.h" |
| 29 | 29 |
| 30 #include "core/CSSValueKeywords.h" | 30 #include "core/CSSValueKeywords.h" |
| 31 #include "core/css/CSSCalculationValue.h" | 31 #include "core/css/CSSCalculationValue.h" |
| 32 #include "core/css/CSSToLengthConversionData.h" | 32 #include "core/css/CSSToLengthConversionData.h" |
| 33 #include "core/css/Pair.h" | 33 #include "core/css/Pair.h" |
| 34 #include "core/dom/NodeLayoutStyle.h" | 34 #include "core/dom/NodeComputedStyle.h" |
| 35 #include "core/dom/TextLinkColors.h" | 35 #include "core/dom/TextLinkColors.h" |
| 36 #include "core/layout/LayoutObject.h" | 36 #include "core/layout/LayoutObject.h" |
| 37 #include "platform/geometry/IntSize.h" | 37 #include "platform/geometry/IntSize.h" |
| 38 #include "platform/graphics/Gradient.h" | 38 #include "platform/graphics/Gradient.h" |
| 39 #include "platform/graphics/GradientGeneratedImage.h" | 39 #include "platform/graphics/GradientGeneratedImage.h" |
| 40 #include "platform/graphics/Image.h" | 40 #include "platform/graphics/Image.h" |
| 41 #include "platform/graphics/skia/SkiaUtils.h" | 41 #include "platform/graphics/skia/SkiaUtils.h" |
| 42 #include "wtf/text/StringBuilder.h" | 42 #include "wtf/text/StringBuilder.h" |
| 43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 44 #include <utility> | 44 #include <utility> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 // Need to look up our size. Create a string of width*height to use as
a hash key. | 64 // Need to look up our size. Create a string of width*height to use as
a hash key. |
| 65 Image* result = getImage(renderer, size); | 65 Image* result = getImage(renderer, size); |
| 66 if (result) | 66 if (result) |
| 67 return result; | 67 return result; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // We need to create an image. | 70 // We need to create an image. |
| 71 RefPtr<Gradient> gradient; | 71 RefPtr<Gradient> gradient; |
| 72 | 72 |
| 73 const LayoutStyle* rootStyle = renderer->document().documentElement()->layou
tStyle(); | 73 const ComputedStyle* rootStyle = renderer->document().documentElement()->com
putedStyle(); |
| 74 CSSToLengthConversionData conversionData(renderer->style(), rootStyle, rende
rer->view(), renderer->style()->effectiveZoom()); | 74 CSSToLengthConversionData conversionData(renderer->style(), rootStyle, rende
rer->view(), renderer->style()->effectiveZoom()); |
| 75 if (isLinearGradientValue()) | 75 if (isLinearGradientValue()) |
| 76 gradient = toCSSLinearGradientValue(this)->createGradient(conversionData
, size, *renderer); | 76 gradient = toCSSLinearGradientValue(this)->createGradient(conversionData
, size, *renderer); |
| 77 else | 77 else |
| 78 gradient = toCSSRadialGradientValue(this)->createGradient(conversionData
, size, *renderer); | 78 gradient = toCSSRadialGradientValue(this)->createGradient(conversionData
, size, *renderer); |
| 79 | 79 |
| 80 RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size); | 80 RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size); |
| 81 if (cacheable) | 81 if (cacheable) |
| 82 putImage(size, newImage); | 82 putImage(size, newImage); |
| 83 | 83 |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 visitor->trace(m_firstRadius); | 1202 visitor->trace(m_firstRadius); |
| 1203 visitor->trace(m_secondRadius); | 1203 visitor->trace(m_secondRadius); |
| 1204 visitor->trace(m_shape); | 1204 visitor->trace(m_shape); |
| 1205 visitor->trace(m_sizingBehavior); | 1205 visitor->trace(m_sizingBehavior); |
| 1206 visitor->trace(m_endHorizontalSize); | 1206 visitor->trace(m_endHorizontalSize); |
| 1207 visitor->trace(m_endVerticalSize); | 1207 visitor->trace(m_endVerticalSize); |
| 1208 CSSGradientValue::traceAfterDispatch(visitor); | 1208 CSSGradientValue::traceAfterDispatch(visitor); |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 } // namespace blink | 1211 } // namespace blink |
| OLD | NEW |