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 94fbc5cda53008ab813598cd8b48e27211c42e3d..a67b4ba2474a25536837507d6a14ee11147ee99a 100644 |
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp |
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp |
@@ -272,6 +272,13 @@ |
m_isTransformInvertible = true; |
} |
+static void updateFilterReferences(HTMLCanvasElement* canvasElement, |
+ CanvasRenderingContext2D* context, |
+ const FilterOperations& filters) { |
+ context->clearFilterReferences(); |
+ context->addFilterReferences(filters, canvasElement->document()); |
+} |
+ |
sk_sp<SkImageFilter> CanvasRenderingContext2DState::getFilter( |
Element* styleResolutionHost, |
IntSize canvasSize, |
@@ -315,7 +322,8 @@ |
m_resolvedFilter = |
SkiaImageFilterBuilder::build(lastEffect, ColorSpaceDeviceRGB); |
if (m_resolvedFilter) { |
- context->updateFilterReferences(filterStyle->filter()); |
+ updateFilterReferences(toHTMLCanvasElement(styleResolutionHost), |
+ context, filterStyle->filter()); |
if (lastEffect->originTainted()) |
context->setOriginTainted(); |
} |