| Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
|
| diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
|
| index 466850eef937b89985b5aa6c4ca66ac64a201b5e..71f1564cd33b96301deb0625dda26a6ea970a15e 100644
|
| --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
|
| +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
|
| @@ -354,12 +354,19 @@ SkImageFilter* CanvasRenderingContext2DState::getFilter(Element* styleResolution
|
| StyleResolverState resolverState(styleResolutionHost->document(), styleResolutionHost, filterStyle.get());
|
| resolverState.setStyle(filterStyle);
|
|
|
| - // TODO(junov): crbug.com/502877 Feed m_fillStyle and m_strokeStyle into FillPaint and
|
| - // StrokePaint respectively for filters that reference SVG.
|
| StyleBuilder::applyProperty(CSSPropertyWebkitFilter, resolverState, m_filterValue.get());
|
| RefPtrWillBeRawPtr<FilterEffectBuilder> filterEffectBuilder = FilterEffectBuilder::create();
|
| +
|
| + // We can't reuse m_fillPaint and m_strokePaint for the filter, since these incorporate
|
| + // the global alpha, which isn't applicable here.
|
| + SkPaint fillPaintForFilter;
|
| + SkPaint strokePaintForFilter;
|
| + m_fillStyle->applyToPaint(fillPaintForFilter);
|
| + m_strokeStyle->applyToPaint(strokePaintForFilter);
|
| + fillPaintForFilter.setColor(m_fillStyle->paintColor());
|
| + strokePaintForFilter.setColor(m_strokeStyle->paintColor());
|
| const double effectiveZoom = 1.0; // Deliberately ignore zoom on the canvas element
|
| - filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), effectiveZoom);
|
| + filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), effectiveZoom, &fillPaintForFilter, &strokePaintForFilter);
|
|
|
| SkiaImageFilterBuilder imageFilterBuilder;
|
| RefPtrWillBeRawPtr<FilterEffect> lastEffect = filterEffectBuilder->lastEffect();
|
|
|