Chromium Code Reviews| 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..6c0a35190b3a23daa8b9144bb27279262a75d5d3 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 SK_ColorBLACK; |
|
Stephen White
2015/03/18 22:09:35
Nit: this is an RGBA32 (Blink type) but you're ret
Justin Novosad
2015/03/19 14:32:21
Yeah... RGBA32 and SkColor are completely intercha
|
| +} |
| + |
| DEFINE_TRACE(CanvasStyle) |
| { |
| visitor->trace(m_gradient); |