Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2490163002: Reland of "Tracking reference filter mutation via SVGElementProxy" (Closed)
Patch Set: Fix double observer unregistration; simplify scope selection; add tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index f7c2771743141f28f8d65ed237fec5339e22348b..9cf2cb0c58f2294695b0d661e3f211a7b66dd9f8 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -221,6 +221,7 @@ void CanvasRenderingContext2D::didSetSurfaceSize() {
DEFINE_TRACE(CanvasRenderingContext2D) {
visitor->trace(m_hitRegionManager);
+ visitor->trace(m_filterOperations);
CanvasRenderingContext::trace(visitor);
BaseRenderingContext2D::trace(visitor);
SVGResourceClient::trace(visitor);
@@ -565,7 +566,28 @@ void CanvasRenderingContext2D::styleDidChange(const ComputedStyle* oldStyle,
pruneLocalFontCache(0);
}
-void CanvasRenderingContext2D::filterNeedsInvalidation() {
+TreeScope* CanvasRenderingContext2D::treeScope() {
+ return &canvas()->treeScope();
+}
+
+void CanvasRenderingContext2D::clearFilterReferences() {
+ m_filterOperations.removeClient(this);
+ m_filterOperations.clear();
+}
+
+void CanvasRenderingContext2D::updateFilterReferences(
+ const FilterOperations& filters) {
+ clearFilterReferences();
+ filters.addClient(this);
+ m_filterOperations = filters;
+}
+
+void CanvasRenderingContext2D::resourceContentChanged() {
+ resourceElementChanged();
+}
+
+void CanvasRenderingContext2D::resourceElementChanged() {
+ clearFilterReferences();
state().clearResolvedFilter();
}

Powered by Google App Engine
This is Rietveld 408576698