<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[286466] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/286466">286466</a></dd>
<dt>Author</dt> <dd>said@apple.com</dd>
<dt>Date</dt> <dd>2021-12-02 16:37:00 -0800 (Thu, 02 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GPU Process] Move the FilterEffect boundaries to a new class FilterEffectGeometry
https://bugs.webkit.org/show_bug.cgi?id=233618
rdar://85881969

Reviewed by Cameron McCormack.

The plan is to have Filter own its geometry and the geometry of the
FilterEffects. So move the boundaries and their flags from FilterEffect
to a new class called FilterEffectGeometry.

SVGFilterBuilder will calculate the FilterEffectGeometry for each FilterEffect
and store it in map { key: FilterEffect, value: FilterEffectGeometry }.
Eventually this map is moved to SVGFilter which will be used in the
virtual function effectGeometry(). determineFilterPrimitiveSubregion()
will call this virtual function to calculate the primitive subregion.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/Filter.h:
(WebCore::Filter::effectGeometry const):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::determineFilterPrimitiveSubregion):
(WebCore::FilterEffect::apply):
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::hasX const): Deleted.
(WebCore::FilterEffect::setHasX): Deleted.
(WebCore::FilterEffect::hasY const): Deleted.
(WebCore::FilterEffect::setHasY): Deleted.
(WebCore::FilterEffect::hasWidth const): Deleted.
(WebCore::FilterEffect::setHasWidth): Deleted.
(WebCore::FilterEffect::hasHeight const): Deleted.
(WebCore::FilterEffect::setHasHeight): Deleted.
(WebCore::FilterEffect::effectBoundaries const): Deleted.
(WebCore::FilterEffect::setEffectBoundaries): Deleted.
* platform/graphics/filters/FilterEffectGeometry.h: Added.
(WebCore::FilterEffectGeometry::FilterEffectGeometry):
(WebCore::FilterEffectGeometry::x const):
(WebCore::FilterEffectGeometry::y const):
(WebCore::FilterEffectGeometry::width const):
(WebCore::FilterEffectGeometry::height const):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::setStandardAttributes const): Deleted.
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::create):
(WebCore::SVGFilter::effectGeometry const):
* svg/graphics/filters/SVGFilter.h:
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::boundarySetFlagsForElement):
(WebCore::SVGFilterBuilder::buildFilterEffects):
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::takeEffectGeometryMap):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterh">trunk/Source/WebCore/platform/graphics/filters/Filter.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffecth">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFilterPrimitiveStandardAttributescpp">trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFilterPrimitiveStandardAttributesh">trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFiltercpp">trunk/Source/WebCore/svg/graphics/filters/SVGFilter.cpp</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFilterh">trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFilterBuildercpp">trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFilterBuilderh">trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffectGeometryh">trunk/Source/WebCore/platform/graphics/filters/FilterEffectGeometry.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/ChangeLog      2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2021-12-02  Said Abou-Hallawa  <said@apple.com>
+
+        [GPU Process] Move the FilterEffect boundaries to a new class FilterEffectGeometry
+        https://bugs.webkit.org/show_bug.cgi?id=233618
+        rdar://85881969
+
+        Reviewed by Cameron McCormack.
+
+        The plan is to have Filter own its geometry and the geometry of the
+        FilterEffects. So move the boundaries and their flags from FilterEffect 
+        to a new class called FilterEffectGeometry. 
+
+        SVGFilterBuilder will calculate the FilterEffectGeometry for each FilterEffect
+        and store it in map { key: FilterEffect, value: FilterEffectGeometry }.
+        Eventually this map is moved to SVGFilter which will be used in the
+        virtual function effectGeometry(). determineFilterPrimitiveSubregion()
+        will call this virtual function to calculate the primitive subregion.
+
+        * Headers.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/filters/Filter.h:
+        (WebCore::Filter::effectGeometry const):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::determineFilterPrimitiveSubregion):
+        (WebCore::FilterEffect::apply):
+        * platform/graphics/filters/FilterEffect.h:
+        (WebCore::FilterEffect::hasX const): Deleted.
+        (WebCore::FilterEffect::setHasX): Deleted.
+        (WebCore::FilterEffect::hasY const): Deleted.
+        (WebCore::FilterEffect::setHasY): Deleted.
+        (WebCore::FilterEffect::hasWidth const): Deleted.
+        (WebCore::FilterEffect::setHasWidth): Deleted.
+        (WebCore::FilterEffect::hasHeight const): Deleted.
+        (WebCore::FilterEffect::setHasHeight): Deleted.
+        (WebCore::FilterEffect::effectBoundaries const): Deleted.
+        (WebCore::FilterEffect::setEffectBoundaries): Deleted.
+        * platform/graphics/filters/FilterEffectGeometry.h: Added.
+        (WebCore::FilterEffectGeometry::FilterEffectGeometry):
+        (WebCore::FilterEffectGeometry::x const):
+        (WebCore::FilterEffectGeometry::y const):
+        (WebCore::FilterEffectGeometry::width const):
+        (WebCore::FilterEffectGeometry::height const):
+        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::setStandardAttributes const): Deleted.
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        * svg/graphics/filters/SVGFilter.cpp:
+        (WebCore::SVGFilter::create):
+        (WebCore::SVGFilter::effectGeometry const):
+        * svg/graphics/filters/SVGFilter.h:
+        * svg/graphics/filters/SVGFilterBuilder.cpp:
+        (WebCore::boundarySetFlagsForElement):
+        (WebCore::SVGFilterBuilder::buildFilterEffects):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        (WebCore::SVGFilterBuilder::takeEffectGeometryMap):
+
</ins><span class="cx"> 2021-12-02  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Move Shared Worker classes to WebCore/workers/shared
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/Headers.cmake  2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -1561,6 +1561,7 @@
</span><span class="cx">     platform/graphics/cv/ImageTransferSessionVT.h
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/filters/Filter.h
</span><ins>+    platform/graphics/filters/FilterEffectGeometry.h
</ins><span class="cx">     platform/graphics/filters/FilterFunction.h
</span><span class="cx">     platform/graphics/filters/FilterImage.h
</span><span class="cx">     platform/graphics/filters/FilterOperation.h
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -2304,6 +2304,7 @@
</span><span class="cx">          724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
</span><span class="cx">          724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               726CDE202759735000A445B2 /* FilterEffectGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 729661A2275960A500E7DF9B /* FilterEffectGeometry.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           726D56E2253AE28D0002EF90 /* PlatformImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 726D56E1253AE0430002EF90 /* PlatformImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          726D56E3253AE3660002EF90 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F61D8209F40022C4C7 /* NativeImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          727A7F3A24078B84004D2931 /* ImageBufferIOSurfaceBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 72BAC3AB23E1E544008D741C /* ImageBufferIOSurfaceBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -11187,6 +11188,7 @@
</span><span class="cx">          727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTsRGB.cpp; sourceTree = "<group>"; };
</span><span class="cx">          727AFED21A2EA6A0000442E8 /* EXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTsRGB.h; sourceTree = "<group>"; };
</span><span class="cx">          727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTsRGB.idl; sourceTree = "<group>"; };
</span><ins>+               729661A2275960A500E7DF9B /* FilterEffectGeometry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilterEffectGeometry.h; sourceTree = "<group>"; };
</ins><span class="cx">           7299BC6423D686A600CC6883 /* AlphaPremultiplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlphaPremultiplication.h; sourceTree = "<group>"; };
</span><span class="cx">          7299BC6623D686C600CC6883 /* RenderingMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderingMode.h; sourceTree = "<group>"; };
</span><span class="cx">          729D052E25313E2600422098 /* RenderingResourceIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderingResourceIdentifier.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -26640,6 +26642,7 @@
</span><span class="cx">                          08C925170FCC7C4A00480DEC /* FilterEffect.cpp */,
</span><span class="cx">                          08C925180FCC7C4A00480DEC /* FilterEffect.h */,
</span><span class="cx">                          72A13A9F274C5CC700E2A88E /* FilterEffectApplier.h */,
</span><ins>+                               729661A2275960A500E7DF9B /* FilterEffectGeometry.h */,
</ins><span class="cx">                           7214B9B7274458FA003BE6DF /* FilterEffectVector.h */,
</span><span class="cx">                          7262D757272A174100C56A09 /* FilterFunction.cpp */,
</span><span class="cx">                          7262D756272A174100C56A09 /* FilterFunction.h */,
</span><span class="lines">@@ -34184,6 +34187,7 @@
</span><span class="cx">                          712BE4831FE865DD002031CC /* FillMode.h in Headers */,
</span><span class="cx">                          845E72F80FD261EE00A87D79 /* Filter.h in Headers */,
</span><span class="cx">                          08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */,
</span><ins>+                               726CDE202759735000A445B2 /* FilterEffectGeometry.h in Headers */,
</ins><span class="cx">                           72B8B0352753438600F752AA /* FilterFunction.h in Headers */,
</span><span class="cx">                          72B8B0362753441400F752AA /* FilterImage.h in Headers */,
</span><span class="cx">                          49ECEB6E1499790D00CDD3A4 /* FilterOperation.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/Filter.h (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/Filter.h  2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/platform/graphics/filters/Filter.h     2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include "FilterEffectGeometry.h"
</ins><span class="cx"> #include "FilterFunction.h"
</span><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "GraphicsTypes.h"
</span><span class="lines">@@ -29,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class FilterEffect;
</ins><span class="cx"> class FilterImage;
</span><span class="cx"> 
</span><span class="cx"> class Filter : public FilterFunction {
</span><span class="lines">@@ -60,6 +62,8 @@
</span><span class="cx">     FloatSize scaledByFilterScale(const FloatSize&) const;
</span><span class="cx">     FloatRect scaledByFilterScale(const FloatRect&) const;
</span><span class="cx"> 
</span><ins>+    virtual std::optional<FilterEffectGeometry> effectGeometry(FilterEffect&) const { return std::nullopt; }
+
</ins><span class="cx">     FloatRect maxEffectRect(const FloatRect& primitiveSubregion) const;
</span><span class="cx">     FloatRect clipToMaxEffectRect(const FloatRect& imageRect, const FloatRect& primitiveSubregion) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp  2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp     2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -24,10 +24,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "FilterEffect.h"
</span><span class="cx"> 
</span><del>-#include "Color.h"
</del><span class="cx"> #include "Filter.h"
</span><span class="cx"> #include "FilterEffectApplier.h"
</span><del>-#include "GeometryUtilities.h"
</del><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include <wtf/text/TextStream.h>
</span><span class="lines">@@ -44,43 +42,42 @@
</span><span class="cx"> 
</span><span class="cx"> FloatRect FilterEffect::determineFilterPrimitiveSubregion(const Filter& filter)
</span><span class="cx"> {
</span><del>-    // FETile, FETurbulence, FEFlood don't have input effects, take the filter region as unite rect.
-    FloatRect subregion;
-    if (unsigned numberOfInputEffects = inputEffects().size()) {
-        subregion = inputEffect(0)->determineFilterPrimitiveSubregion(filter);
-        for (unsigned i = 1; i < numberOfInputEffects; ++i) {
-            auto inputPrimitiveSubregion = inputEffect(i)->determineFilterPrimitiveSubregion(filter);
-            subregion.unite(inputPrimitiveSubregion);
</del><ins>+    // This function implements https://www.w3.org/TR/filter-effects-1/#FilterPrimitiveSubRegion.
+    FloatRect primitiveSubregion;
+
+    // If there is no input effects, take the effect boundaries as unite rect.
+    if (!m_inputEffects.isEmpty()) {
+        for (auto& effect : m_inputEffects) {
+            auto inputPrimitiveSubregion = effect->determineFilterPrimitiveSubregion(filter);
+            primitiveSubregion.unite(inputPrimitiveSubregion);
</ins><span class="cx">         }
</span><span class="cx">     } else
</span><del>-        subregion = filter.filterRegion();
</del><ins>+        primitiveSubregion = filter.filterRegion();
</ins><span class="cx"> 
</span><del>-    // After calling determineFilterPrimitiveSubregion on the target effect, reset the subregion again for <feTile>.
</del><ins>+    // Don't use the input's subregion for FETile.
</ins><span class="cx">     if (filterType() == FilterEffect::Type::FETile)
</span><del>-        subregion = filter.filterRegion();
</del><ins>+        primitiveSubregion = filter.filterRegion();
+    
+    // Clip the primitive subregion to the effect geometry.
+    if (auto geometry = filter.effectGeometry(*this)) {
+        if (auto x = geometry->x())
+            primitiveSubregion.setX(*x);
+        if (auto y = geometry->y())
+            primitiveSubregion.setY(*y);
+        if (auto width = geometry->width())
+            primitiveSubregion.setWidth(*width);
+        if (auto height = geometry->height())
+            primitiveSubregion.setHeight(*height);
+    }
</ins><span class="cx"> 
</span><del>-    auto boundaries = effectBoundaries();
-    if (hasX())
-        subregion.setX(boundaries.x());
-    if (hasY())
-        subregion.setY(boundaries.y());
-    if (hasWidth())
-        subregion.setWidth(boundaries.width());
-    if (hasHeight())
-        subregion.setHeight(boundaries.height());
</del><ins>+    // Clip every filter effect to the filter region.
+    auto absoluteMaxEffectRect = filter.maxEffectRect(primitiveSubregion);
+    absoluteMaxEffectRect.scale(filter.filterScale());
</ins><span class="cx"> 
</span><del>-    setFilterPrimitiveSubregion(subregion);
</del><ins>+    setFilterPrimitiveSubregion(primitiveSubregion);
+    setMaxEffectRect(absoluteMaxEffectRect);
</ins><span class="cx"> 
</span><del>-    auto absoluteSubregion = subregion;
-    absoluteSubregion.scale(filter.filterScale());
-
-    // Clip every filter effect to the filter region.
-    auto absoluteScaledFilterRegion = filter.filterRegion();
-    absoluteScaledFilterRegion.scale(filter.filterScale());
-    absoluteSubregion.intersect(absoluteScaledFilterRegion);
-
-    setMaxEffectRect(absoluteSubregion);
-    return subregion;
</del><ins>+    return primitiveSubregion;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FilterEffect* FilterEffect::inputEffect(unsigned number) const
</span><span class="lines">@@ -129,7 +126,6 @@
</span><span class="cx">     LOG_WITH_STREAM(Filters, stream
</span><span class="cx">         << "FilterEffect " << filterName() << " " << this << " apply():"
</span><span class="cx">         << "\n  filterPrimitiveSubregion " << m_filterPrimitiveSubregion
</span><del>-        << "\n  effectBoundaries " << m_effectBoundaries
</del><span class="cx">         << "\n  absolutePaintRect " << absoluteImageRect
</span><span class="cx">         << "\n  maxEffectRect " << m_maxEffectRect
</span><span class="cx">         << "\n  filter scale " << filter.filterScale());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h    2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h       2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "FilterFunction.h"
</span><span class="cx"> #include "FilterImage.h"
</span><span class="cx"> #include "FilterImageVector.h"
</span><del>-#include "IntRect.h"
</del><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="lines">@@ -38,7 +37,6 @@
</span><span class="cx"> 
</span><span class="cx"> class Filter;
</span><span class="cx"> class FilterEffectApplier;
</span><del>-class ImageBuffer;
</del><span class="cx"> 
</span><span class="cx"> class FilterEffect : public FilterFunction {
</span><span class="cx"> public:
</span><span class="lines">@@ -71,26 +69,9 @@
</span><span class="cx">     enum class RepresentationType { TestOutput, Debugging };
</span><span class="cx">     virtual WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType = RepresentationType::TestOutput) const;
</span><span class="cx"> 
</span><del>-    // The following functions are SVG specific and will move to RenderSVGResourceFilterPrimitive.
-    // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
-    bool hasX() const { return m_hasX; }
-    void setHasX(bool value) { m_hasX = value; }
-
-    bool hasY() const { return m_hasY; }
-    void setHasY(bool value) { m_hasY = value; }
-
-    bool hasWidth() const { return m_hasWidth; }
-    void setHasWidth(bool value) { m_hasWidth = value; }
-
-    bool hasHeight() const { return m_hasHeight; }
-    void setHasHeight(bool value) { m_hasHeight = value; }
-
</del><span class="cx">     FloatRect filterPrimitiveSubregion() const { return m_filterPrimitiveSubregion; }
</span><span class="cx">     void setFilterPrimitiveSubregion(const FloatRect& filterPrimitiveSubregion) { m_filterPrimitiveSubregion = filterPrimitiveSubregion; }
</span><span class="cx"> 
</span><del>-    FloatRect effectBoundaries() const { return m_effectBoundaries; }
-    void setEffectBoundaries(const FloatRect& effectBoundaries) { m_effectBoundaries = effectBoundaries; }
-    
</del><span class="cx">     virtual FloatRect calculateImageRect(const Filter&, const FilterImageVector& inputs, const FloatRect& primitiveSubregion) const;
</span><span class="cx"> 
</span><span class="cx">     const DestinationColorSpace& operatingColorSpace() const { return m_operatingColorSpace; }
</span><span class="lines">@@ -102,7 +83,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void transformResultColorSpace(FilterEffect* in, const int) { in->transformResultColorSpace(m_operatingColorSpace); }
</span><span class="cx">     void transformResultColorSpace(const DestinationColorSpace&);
</span><del>-    
</del><ins>+
</ins><span class="cx"> protected:
</span><span class="cx">     using FilterFunction::FilterFunction;
</span><span class="cx"> 
</span><span class="lines">@@ -123,15 +104,6 @@
</span><span class="cx">     // This is SVG specific and needs to move to RenderSVGResourceFilterPrimitive.
</span><span class="cx">     FloatRect m_filterPrimitiveSubregion;
</span><span class="cx"> 
</span><del>-    // x, y, width and height of the actual SVGFE*Element. Is needed to determine the subregion of the
-    // filter primitive on a later step.
-    FloatRect m_effectBoundaries;
-    
-    bool m_hasX { false };
-    bool m_hasY { false };
-    bool m_hasWidth { false };
-    bool m_hasHeight { false };
-
</del><span class="cx">     DestinationColorSpace m_operatingColorSpace { DestinationColorSpace::SRGB() };
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffectGeometryh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/filters/FilterEffectGeometry.h (0 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffectGeometry.h                            (rev 0)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffectGeometry.h       2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "FloatRect.h"
+#include <wtf/OptionSet.h>
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class FilterEffect;
+
+class FilterEffectGeometry {
+public:
+    enum class Flags {
+        HasX      = 1 << 0,
+        HasY      = 1 << 1,
+        HasWidth  = 1 << 2,
+        HasHeight = 1 << 3
+    };
+
+    FilterEffectGeometry() = default;
+
+    FilterEffectGeometry(const FloatRect& boundaries, OptionSet<Flags> flags)
+        : m_boundaries(boundaries)
+        , m_flags(flags)
+    {
+    }
+
+    std::optional<float> x() const
+    {
+        if (m_flags.contains(Flags::HasX))
+            return m_boundaries.x();
+        return std::nullopt;
+    }
+
+    std::optional<float> y() const
+    {
+        if (m_flags.contains(Flags::HasY))
+            return m_boundaries.y();
+        return std::nullopt;
+    }
+
+    std::optional<float> width() const
+    {
+        if (m_flags.contains(Flags::HasWidth))
+            return m_boundaries.width();
+        return std::nullopt;
+    }
+
+    std::optional<float> height() const
+    {
+        if (m_flags.contains(Flags::HasHeight))
+            return m_boundaries.height();
+        return std::nullopt;
+    }
+
+private:
+    FloatRect m_boundaries;
+    OptionSet<Flags> m_flags;
+};
+
+using FilterEffectGeometryMap = HashMap<Ref<FilterEffect>, FilterEffectGeometry>;
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFilterPrimitiveStandardAttributescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp        2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp   2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -94,22 +94,6 @@
</span><span class="cx">     invalidate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(FilterEffect* filterEffect) const
-{
-    ASSERT(filterEffect);
-    if (!filterEffect)
-        return;
-
-    if (hasAttribute(SVGNames::xAttr))
-        filterEffect->setHasX(true);
-    if (hasAttribute(SVGNames::yAttr))
-        filterEffect->setHasY(true);
-    if (hasAttribute(SVGNames::widthAttr))
-        filterEffect->setHasWidth(true);
-    if (hasAttribute(SVGNames::heightAttr))
-        filterEffect->setHasHeight(true);
-}
-
</del><span class="cx"> RenderPtr<RenderElement> SVGFilterPrimitiveStandardAttributes::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
</span><span class="cx"> {
</span><span class="cx">     return createRenderer<RenderSVGResourceFilterPrimitive>(*this, WTFMove(style));
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFilterPrimitiveStandardAttributesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h  2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h     2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -36,8 +36,6 @@
</span><span class="cx"> class SVGFilterPrimitiveStandardAttributes : public SVGElement {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(SVGFilterPrimitiveStandardAttributes);
</span><span class="cx"> public:
</span><del>-    void setStandardAttributes(FilterEffect*) const;
-
</del><span class="cx">     virtual RefPtr<FilterEffect> build(SVGFilterBuilder&) const = 0;
</span><span class="cx">     // Returns true, if the new value is different from the old one.
</span><span class="cx">     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFilter.cpp (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFilter.cpp  2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFilter.cpp     2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -51,8 +51,7 @@
</span><span class="cx">     builder.setTargetBoundingBox(targetBoundingBox);
</span><span class="cx">     builder.setPrimitiveUnits(filterElement.primitiveUnits());
</span><span class="cx"> 
</span><del>-    auto lastEffect = builder.buildFilterEffects(filterElement);
-    if (!lastEffect)
</del><ins>+    if (!builder.buildFilterEffects(filterElement))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     FilterEffectVector expression;
</span><span class="lines">@@ -61,7 +60,9 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!expression.isEmpty());
</span><span class="cx">     filter->setExpression(WTFMove(expression));
</span><del>-    
</del><ins>+
+    filter->setEffectGeometryMap(builder.takeEffectGeometryMap());
+
</ins><span class="cx"> #if USE(CORE_IMAGE)
</span><span class="cx">     if (!filter->supportsCoreImageRendering())
</span><span class="cx">         filter->setRenderingMode(RenderingMode::Unaccelerated);
</span><span class="lines">@@ -98,6 +99,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+std::optional<FilterEffectGeometry> SVGFilter::effectGeometry(FilterEffect& effect) const
+{
+    auto it = m_effectGeometryMap.find(effect);
+    if (it != m_effectGeometryMap.end())
+        return it->value;
+    return std::nullopt;
+}
+
</ins><span class="cx"> bool SVGFilter::apply(const Filter& filter)
</span><span class="cx"> {
</span><span class="cx">     setSourceImage({ filter.sourceImage() });
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFilterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h    2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h       2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -42,19 +42,22 @@
</span><span class="cx"> 
</span><span class="cx">     FloatRect targetBoundingBox() const { return m_targetBoundingBox; }
</span><span class="cx"> 
</span><del>-    void setExpression(FilterEffectVector&& expression) { m_expression = WTFMove(expression); }
</del><span class="cx">     RefPtr<FilterEffect> lastEffect() const { return !m_expression.isEmpty() ? m_expression.last() : nullptr; }
</span><span class="cx"> 
</span><del>-    FloatSize resolvedSize(const FloatSize&) const final;
-
</del><span class="cx">     RefPtr<FilterImage> apply() override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     SVGFilter(RenderingMode, const FloatSize& filterScale, const FloatRect& sourceImageRect, const FloatRect& filterRegion, ClipOperation, const FloatRect& targetBoundingBox, SVGUnitTypes::SVGUnitType primitiveUnits);
</span><span class="cx"> 
</span><ins>+    // FIXME: Merge the effectBoundaries in the expression node.
+    void setExpression(FilterEffectVector&& expression) { m_expression = WTFMove(expression); }
+    void setEffectGeometryMap(FilterEffectGeometryMap&& effectGeometryMap) { m_effectGeometryMap = WTFMove(effectGeometryMap); }
+
</ins><span class="cx"> #if USE(CORE_IMAGE)
</span><span class="cx">     bool supportsCoreImageRendering() const override;
</span><span class="cx"> #endif
</span><ins>+    std::optional<FilterEffectGeometry> effectGeometry(FilterEffect&) const override;
+    FloatSize resolvedSize(const FloatSize&) const final;
</ins><span class="cx"> 
</span><span class="cx">     bool apply(const Filter&) override;
</span><span class="cx">     IntOutsets outsets() const override;
</span><span class="lines">@@ -63,7 +66,9 @@
</span><span class="cx">     FloatRect m_targetBoundingBox;
</span><span class="cx">     SVGUnitTypes::SVGUnitType m_primitiveUnits;
</span><span class="cx"> 
</span><ins>+    // FIXME: Make m_expression a Vector of the FilterEffect and the effectBoundaries.
</ins><span class="cx">     FilterEffectVector m_expression;
</span><ins>+    FilterEffectGeometryMap m_effectGeometryMap;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFilterBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp   2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp      2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
</span><ins>+ * Copyright (C) 2021 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -40,6 +41,25 @@
</span><span class="cx">     addBuiltinEffects();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static OptionSet<FilterEffectGeometry::Flags> boundarySetFlagsForElement(SVGElement& element)
+{
+    OptionSet<FilterEffectGeometry::Flags> flags;
+
+    if (element.hasAttribute(SVGNames::xAttr))
+        flags.add(FilterEffectGeometry::Flags::HasX);
+
+    if (element.hasAttribute(SVGNames::yAttr))
+        flags.add(FilterEffectGeometry::Flags::HasY);
+
+    if (element.hasAttribute(SVGNames::widthAttr))
+        flags.add(FilterEffectGeometry::Flags::HasWidth);
+
+    if (element.hasAttribute(SVGNames::heightAttr))
+        flags.add(FilterEffectGeometry::Flags::HasHeight);
+
+    return flags;
+}
+
</ins><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><span class="cx"> static ColorInterpolation colorInterpolationForElement(SVGElement& element)
</span><span class="cx"> {
</span><span class="lines">@@ -85,18 +105,19 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto& effectElement : childrenOfType<SVGFilterPrimitiveStandardAttributes>(filterElement)) {
</span><span class="cx">         effect = effectElement.build(*this);
</span><del>-        if (!effect) {
-            clearEffects();
-            return nullptr;
</del><ins>+        if (!effect)
+            break;
+
+        if (auto flags = boundarySetFlagsForElement(effectElement)) {
+            auto effectBoundaries = SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&effectElement, m_primitiveUnits, m_targetBoundingBox);
+            m_effectGeometryMap.add(*effect, FilterEffectGeometry(effectBoundaries, flags));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        effectElement.setStandardAttributes(effect.get());
-        effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&effectElement, m_primitiveUnits, m_targetBoundingBox));
-
</del><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><span class="cx">         if (colorInterpolationForElement(effectElement) == ColorInterpolation::LinearRGB)
</span><span class="cx">             effect->setOperatingColorSpace(DestinationColorSpace::LinearSRGB());
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">         if (auto renderer = effectElement.renderer())
</span><span class="cx">             appendEffectToEffectReferences(effect.copyRef(), renderer);
</span><span class="cx"> 
</span><span class="lines">@@ -103,8 +124,10 @@
</span><span class="cx">         add(effectElement.result(), effect);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!effect || totalNumberFilterEffects(*effect) > maxTotalNumberFilterEffects)
</del><ins>+    if (!effect || totalNumberFilterEffects(*effect) > maxTotalNumberFilterEffects) {
+        clearEffects();
</ins><span class="cx">         return nullptr;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     return effect;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFilterBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h (286465 => 286466)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h     2021-12-03 00:35:11 UTC (rev 286465)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h        2021-12-03 00:37:00 UTC (rev 286466)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
</span><span class="cx">  * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
</span><ins>+ * Copyright (C) 2021 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -69,6 +70,8 @@
</span><span class="cx">     RefPtr<FilterEffect> buildFilterEffects(SVGFilterElement&);
</span><span class="cx">     bool buildExpression(FilterEffectVector& expression) const;
</span><span class="cx"> 
</span><ins>+    FilterEffectGeometryMap takeEffectGeometryMap() { return WTFMove(m_effectGeometryMap); }
+
</ins><span class="cx"> private:
</span><span class="cx">     inline void addBuiltinEffects()
</span><span class="cx">     {
</span><span class="lines">@@ -84,8 +87,10 @@
</span><span class="cx">     HashMap<RenderObject*, FilterEffect*> m_effectRenderer;
</span><span class="cx"> 
</span><span class="cx">     RefPtr<FilterEffect> m_lastEffect;
</span><ins>+
</ins><span class="cx">     FloatRect m_targetBoundingBox;
</span><span class="cx">     SVGUnitTypes::SVGUnitType m_primitiveUnits { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE };
</span><ins>+    FilterEffectGeometryMap m_effectGeometryMap;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>