| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #include "core/css/CSSGradientValue.h" | 27 #include "core/css/CSSGradientValue.h" |
| 28 | 28 |
| 29 #include "core/CSSValueKeywords.h" | 29 #include "core/CSSValueKeywords.h" |
| 30 #include "core/css/CSSCalculationValue.h" | 30 #include "core/css/CSSCalculationValue.h" |
| 31 #include "core/css/CSSToLengthConversionData.h" | 31 #include "core/css/CSSToLengthConversionData.h" |
| 32 #include "core/css/CSSValuePair.h" | 32 #include "core/css/CSSValuePair.h" |
| 33 #include "core/dom/NodeComputedStyle.h" | 33 #include "core/dom/NodeComputedStyle.h" |
| 34 #include "core/dom/TextLinkColors.h" | 34 #include "core/dom/TextLinkColors.h" |
| 35 #include "core/layout/LayoutObject.h" | 35 #include "core/layout/LayoutObject.h" |
| 36 #include "core/layout/api/LayoutViewItem.h" |
| 36 #include "platform/geometry/IntSize.h" | 37 #include "platform/geometry/IntSize.h" |
| 37 #include "platform/graphics/Gradient.h" | 38 #include "platform/graphics/Gradient.h" |
| 38 #include "platform/graphics/GradientGeneratedImage.h" | 39 #include "platform/graphics/GradientGeneratedImage.h" |
| 39 #include "platform/graphics/Image.h" | 40 #include "platform/graphics/Image.h" |
| 40 #include "platform/graphics/skia/SkiaUtils.h" | 41 #include "platform/graphics/skia/SkiaUtils.h" |
| 41 #include "wtf/text/StringBuilder.h" | 42 #include "wtf/text/StringBuilder.h" |
| 42 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 43 #include <algorithm> | 44 #include <algorithm> |
| 44 #include <utility> | 45 #include <utility> |
| 45 | 46 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 64 // Need to look up our size. Create a string of width*height to use as
a hash key. | 65 // Need to look up our size. Create a string of width*height to use as
a hash key. |
| 65 Image* result = getImage(&layoutObject, size); | 66 Image* result = getImage(&layoutObject, size); |
| 66 if (result) | 67 if (result) |
| 67 return result; | 68 return result; |
| 68 } | 69 } |
| 69 | 70 |
| 70 // We need to create an image. | 71 // We need to create an image. |
| 71 RefPtr<Gradient> gradient; | 72 RefPtr<Gradient> gradient; |
| 72 | 73 |
| 73 const ComputedStyle* rootStyle = layoutObject.document().documentElement()->
computedStyle(); | 74 const ComputedStyle* rootStyle = layoutObject.document().documentElement()->
computedStyle(); |
| 74 CSSToLengthConversionData conversionData(layoutObject.style(), rootStyle, la
youtObject.view(), layoutObject.style()->effectiveZoom()); | 75 CSSToLengthConversionData conversionData(layoutObject.style(), rootStyle, La
youtViewItem(layoutObject.view()), layoutObject.style()->effectiveZoom()); |
| 75 if (isLinearGradientValue()) | 76 if (isLinearGradientValue()) |
| 76 gradient = toCSSLinearGradientValue(this)->createGradient(conversionData
, size, layoutObject); | 77 gradient = toCSSLinearGradientValue(this)->createGradient(conversionData
, size, layoutObject); |
| 77 else | 78 else |
| 78 gradient = toCSSRadialGradientValue(this)->createGradient(conversionData
, size, layoutObject); | 79 gradient = toCSSRadialGradientValue(this)->createGradient(conversionData
, size, layoutObject); |
| 79 | 80 |
| 80 RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size); | 81 RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size); |
| 81 if (cacheable) | 82 if (cacheable) |
| 82 putImage(size, newImage); | 83 putImage(size, newImage); |
| 83 | 84 |
| 84 return newImage.release(); | 85 return newImage.release(); |
| (...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 visitor->trace(m_firstRadius); | 1222 visitor->trace(m_firstRadius); |
| 1222 visitor->trace(m_secondRadius); | 1223 visitor->trace(m_secondRadius); |
| 1223 visitor->trace(m_shape); | 1224 visitor->trace(m_shape); |
| 1224 visitor->trace(m_sizingBehavior); | 1225 visitor->trace(m_sizingBehavior); |
| 1225 visitor->trace(m_endHorizontalSize); | 1226 visitor->trace(m_endHorizontalSize); |
| 1226 visitor->trace(m_endVerticalSize); | 1227 visitor->trace(m_endVerticalSize); |
| 1227 CSSGradientValue::traceAfterDispatch(visitor); | 1228 CSSGradientValue::traceAfterDispatch(visitor); |
| 1228 } | 1229 } |
| 1229 | 1230 |
| 1230 } // namespace blink | 1231 } // namespace blink |
| OLD | NEW |