| Index: Source/core/html/canvas/CanvasStyle.cpp
|
| diff --git a/Source/core/html/canvas/CanvasStyle.cpp b/Source/core/html/canvas/CanvasStyle.cpp
|
| index 4e450f7115a99a158054b678ad7da5adc603e890..a6a433670208250818959c47780dfd3da0de6e85 100644
|
| --- a/Source/core/html/canvas/CanvasStyle.cpp
|
| +++ b/Source/core/html/canvas/CanvasStyle.cpp
|
| @@ -145,6 +145,29 @@ void CanvasStyle::applyFillColor(GraphicsContext* context)
|
| }
|
| }
|
|
|
| +SkShader* CanvasStyle::shader() const
|
| +{
|
| + switch (m_type) {
|
| + case ColorRGBA:
|
| + return nullptr;
|
| + case Gradient:
|
| + return canvasGradient()->gradient()->shader();
|
| + case ImagePattern:
|
| + return canvasPattern()->pattern()->shader();
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| +RGBA32 CanvasStyle::paintColor() const
|
| +{
|
| + if (m_type == ColorRGBA)
|
| + return m_rgba;
|
| + ASSERT(m_type == Gradient || m_type == ImagePattern);
|
| + return Color::black;
|
| +}
|
| +
|
| DEFINE_TRACE(CanvasStyle)
|
| {
|
| visitor->trace(m_gradient);
|
|
|