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

Unified Diff: third_party/WebKit/Source/core/style/FilterOperation.cpp

Issue 2401343002: Tracking filter mutation via SVGElementProxy (Closed)
Patch Set: referenceChanged -> proxiedElementChanged Created 4 years, 2 months 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/core/style/FilterOperation.cpp
diff --git a/third_party/WebKit/Source/core/style/FilterOperation.cpp b/third_party/WebKit/Source/core/style/FilterOperation.cpp
index 6308d7038524d54066c603caa56efdd43355da27..52500005ea962fa9f95a70bc85dbcea14e75a86e 100644
--- a/third_party/WebKit/Source/core/style/FilterOperation.cpp
+++ b/third_party/WebKit/Source/core/style/FilterOperation.cpp
@@ -25,6 +25,7 @@
#include "core/style/FilterOperation.h"
+#include "core/svg/SVGElementProxy.h"
#include "platform/LengthFunctions.h"
#include "platform/animation/AnimationUtilities.h"
#include "platform/graphics/filters/FEDropShadow.h"
@@ -44,6 +45,7 @@ FilterOperation* FilterOperation::blend(const FilterOperation* from,
}
DEFINE_TRACE(ReferenceFilterOperation) {
+ visitor->trace(m_elementProxy);
visitor->trace(m_filter);
FilterOperation::trace(visitor);
}
@@ -55,6 +57,30 @@ FloatRect ReferenceFilterOperation::mapRect(const FloatRect& rect) const {
return lastEffect->mapRect(rect);
}
+ReferenceFilterOperation::ReferenceFilterOperation(
+ const String& url,
+ SVGElementProxy& elementProxy)
+ : FilterOperation(REFERENCE),
+ m_url(url),
+ m_elementProxy(&elementProxy),
+ m_elementProxyGeneration(elementProxy.generation()) {}
+
+void ReferenceFilterOperation::addClient(SVGResourceClient* client) {
+ m_elementProxy->addClient(client);
+}
+
+void ReferenceFilterOperation::removeClient(SVGResourceClient* client) {
+ m_elementProxy->removeClient(client);
+}
+
+bool ReferenceFilterOperation::operator==(const FilterOperation& o) const {
+ if (!isSameType(o))
+ return false;
+ const ReferenceFilterOperation& other = toReferenceFilterOperation(o);
+ return m_url == other.m_url && m_elementProxy == other.m_elementProxy &&
+ m_elementProxyGeneration == other.m_elementProxyGeneration;
esprehn 2016/10/25 01:18:42 What changes the generation?
fs 2016/10/25 15:00:53 All invalidations of the proxy (SVGElementProxy::p
+}
+
FilterOperation* BasicColorMatrixFilterOperation::blend(
const FilterOperation* from,
double progress) const {

Powered by Google App Engine
This is Rietveld 408576698