Title: [288432] trunk/Source
Revision
288432
Author
[email protected]
Date
2022-01-24 00:58:48 -0800 (Mon, 24 Jan 2022)

Log Message

[GPU Process] [Filters] Move FEImage to the 'platform' directory
https://bugs.webkit.org/show_bug.cgi?id=234109
rdar://86608573

Reviewed by Darin Adler.

Source/WebCore:

Move FEImageSoftwareApplier to separate source and header files. Make all
the filter applier concrete classes be final and make their overridden
'apply()' method be private and final.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/coreimage/FEColorMatrixCoreImageApplier.h:
* platform/graphics/coreimage/FEComponentTransferCoreImageApplier.h:
* platform/graphics/coreimage/SourceGraphicCoreImageApplier.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
* platform/graphics/filters/FEImage.cpp: Renamed from Source/WebCore/svg/graphics/filters/SVGFEImage.cpp.
(WebCore::FEImage::create):
(WebCore::FEImage::FEImage):
(WebCore::FEImage::calculateImageRect const):
(WebCore::FEImage::createSoftwareApplier const):
(WebCore::FEImage::externalRepresentation const):
* platform/graphics/filters/FEImage.h: Renamed from Source/WebCore/svg/graphics/filters/SVGFEImage.h.
(WebCore::FEImage::encode const):
(WebCore::FEImage::decode):
* platform/graphics/filters/software/FEBlendSoftwareApplier.h:
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h:
* platform/graphics/filters/software/FECompositeSoftwareApplier.h:
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h:
(WebCore::FEDisplacementMapSoftwareApplier::byteOffsetOfPixel): Deleted.
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.h:
* platform/graphics/filters/software/FEFloodSoftwareApplier.h:
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h:
* platform/graphics/filters/software/FEImageSoftwareApplier.cpp: Added.
(WebCore::FEImageSoftwareApplier::apply const):
* platform/graphics/filters/software/FEImageSoftwareApplier.h: Copied from Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.h.
* platform/graphics/filters/software/FELightingSoftwareApplier.h:
(WebCore::FELightingSoftwareApplier::AlphaWindow::topLeft const): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::left const): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::bottomLeft const): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::top const): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::center const): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::bottom const): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::setTop): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::setCenter): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::setBottom): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::setTopRight): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::setRight): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::setBottomRight): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::shiftRow): Deleted.
(WebCore::FELightingSoftwareApplier::AlphaWindow::shift): Deleted.
* platform/graphics/filters/software/FEMergeSoftwareApplier.h:
* platform/graphics/filters/software/FEMorphologySoftwareApplier.h:
(WebCore::FEMorphologySoftwareApplier::pixelArrayIndex): Deleted.
(WebCore::FEMorphologySoftwareApplier::makePixelValueFromColorComponents): Deleted.
(WebCore::FEMorphologySoftwareApplier::makeColorComponentsfromPixelValue): Deleted.
* platform/graphics/filters/software/FEOffsetSoftwareApplier.h:
* platform/graphics/filters/software/FETileSoftwareApplier.h:
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.h:
(WebCore::FETurbulenceSoftwareApplier::PaintingData::random): Deleted.
(WebCore::FETurbulenceSoftwareApplier::smoothCurve): Deleted.
(WebCore::FETurbulenceSoftwareApplier::linearInterpolation): Deleted.
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.h:
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.h:
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
* svg/SVGFEImageElement.cpp:
* svg/SVGFEImageElement.h:

Source/WebKit:

* Platform/IPC/FilterReference.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288431 => 288432)


--- trunk/Source/WebCore/ChangeLog	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/ChangeLog	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,3 +1,76 @@
+2022-01-24  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] [Filters] Move FEImage to the 'platform' directory
+        https://bugs.webkit.org/show_bug.cgi?id=234109
+        rdar://86608573
+
+        Reviewed by Darin Adler.
+
+        Move FEImageSoftwareApplier to separate source and header files. Make all
+        the filter applier concrete classes be final and make their overridden 
+        'apply()' method be private and final.
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/coreimage/FEColorMatrixCoreImageApplier.h:
+        * platform/graphics/coreimage/FEComponentTransferCoreImageApplier.h:
+        * platform/graphics/coreimage/SourceGraphicCoreImageApplier.h:
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        * platform/graphics/filters/FEImage.cpp: Renamed from Source/WebCore/svg/graphics/filters/SVGFEImage.cpp.
+        (WebCore::FEImage::create):
+        (WebCore::FEImage::FEImage):
+        (WebCore::FEImage::calculateImageRect const):
+        (WebCore::FEImage::createSoftwareApplier const):
+        (WebCore::FEImage::externalRepresentation const):
+        * platform/graphics/filters/FEImage.h: Renamed from Source/WebCore/svg/graphics/filters/SVGFEImage.h.
+        (WebCore::FEImage::encode const):
+        (WebCore::FEImage::decode):
+        * platform/graphics/filters/software/FEBlendSoftwareApplier.h:
+        * platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h:
+        * platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h:
+        * platform/graphics/filters/software/FECompositeSoftwareApplier.h:
+        * platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h:
+        * platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h:
+        (WebCore::FEDisplacementMapSoftwareApplier::byteOffsetOfPixel): Deleted.
+        * platform/graphics/filters/software/FEDropShadowSoftwareApplier.h:
+        * platform/graphics/filters/software/FEFloodSoftwareApplier.h:
+        * platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h:
+        * platform/graphics/filters/software/FEImageSoftwareApplier.cpp: Added.
+        (WebCore::FEImageSoftwareApplier::apply const):
+        * platform/graphics/filters/software/FEImageSoftwareApplier.h: Copied from Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.h.
+        * platform/graphics/filters/software/FELightingSoftwareApplier.h:
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::topLeft const): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::left const): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::bottomLeft const): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::top const): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::center const): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::bottom const): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::setTop): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::setCenter): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::setBottom): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::setTopRight): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::setRight): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::setBottomRight): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::shiftRow): Deleted.
+        (WebCore::FELightingSoftwareApplier::AlphaWindow::shift): Deleted.
+        * platform/graphics/filters/software/FEMergeSoftwareApplier.h:
+        * platform/graphics/filters/software/FEMorphologySoftwareApplier.h:
+        (WebCore::FEMorphologySoftwareApplier::pixelArrayIndex): Deleted.
+        (WebCore::FEMorphologySoftwareApplier::makePixelValueFromColorComponents): Deleted.
+        (WebCore::FEMorphologySoftwareApplier::makeColorComponentsfromPixelValue): Deleted.
+        * platform/graphics/filters/software/FEOffsetSoftwareApplier.h:
+        * platform/graphics/filters/software/FETileSoftwareApplier.h:
+        * platform/graphics/filters/software/FETurbulenceSoftwareApplier.h:
+        (WebCore::FETurbulenceSoftwareApplier::PaintingData::random): Deleted.
+        (WebCore::FETurbulenceSoftwareApplier::smoothCurve): Deleted.
+        (WebCore::FETurbulenceSoftwareApplier::linearInterpolation): Deleted.
+        * platform/graphics/filters/software/SourceAlphaSoftwareApplier.h:
+        * platform/graphics/filters/software/SourceGraphicSoftwareApplier.h:
+        * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
+        * svg/SVGFEImageElement.cpp:
+        * svg/SVGFEImageElement.h:
+
 2022-01-23  Matt Woodrow  <[email protected]>
 
         Position:fixed layers shouldn't allocate a backing buffer if all children are offscreen.

Modified: trunk/Source/WebCore/Headers.cmake (288431 => 288432)


--- trunk/Source/WebCore/Headers.cmake	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/Headers.cmake	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1600,6 +1600,7 @@
     platform/graphics/filters/FEDropShadow.h
     platform/graphics/filters/FEFlood.h
     platform/graphics/filters/FEGaussianBlur.h
+    platform/graphics/filters/FEImage.h
     platform/graphics/filters/FELighting.h
     platform/graphics/filters/FEMerge.h
     platform/graphics/filters/FEMorphology.h
@@ -1934,7 +1935,6 @@
 
     svg/graphics/SVGImageCache.h
 
-    svg/graphics/filters/SVGFEImage.h
     svg/graphics/filters/SVGFilter.h
     svg/graphics/filters/SVGFilterExpression.h
 

Modified: trunk/Source/WebCore/Sources.txt (288431 => 288432)


--- trunk/Source/WebCore/Sources.txt	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/Sources.txt	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2107,6 +2107,7 @@
 platform/graphics/filters/FEDropShadow.cpp
 platform/graphics/filters/FEFlood.cpp
 platform/graphics/filters/FEGaussianBlur.cpp
+platform/graphics/filters/FEImage.cpp
 platform/graphics/filters/FELighting.cpp
 platform/graphics/filters/FEMerge.cpp
 platform/graphics/filters/FEMorphology.cpp
@@ -2133,6 +2134,7 @@
 platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp
 platform/graphics/filters/software/FEFloodSoftwareApplier.cpp
 platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp
+platform/graphics/filters/software/FEImageSoftwareApplier.cpp
 platform/graphics/filters/software/FELightingSoftwareApplier.cpp
 platform/graphics/filters/software/FEMergeSoftwareApplier.cpp
 platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp
@@ -2717,7 +2719,6 @@
 svg/graphics/SVGImage.cpp
 svg/graphics/SVGImageCache.cpp
 svg/graphics/SVGImageForContainer.cpp
-svg/graphics/filters/SVGFEImage.cpp
 svg/graphics/filters/SVGFilter.cpp
 svg/graphics/filters/SVGFilterBuilder.cpp
 svg/properties/SVGAnimatedProperty.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (288431 => 288432)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2323,6 +2323,7 @@
 		724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
 		724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		7256078E279D34B6007D2DD3 /* FEImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 72F7E74F279CEDE800D82D2D /* FEImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		726CDE202759735000A445B2 /* FilterEffectGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 729661A2275960A500E7DF9B /* FilterEffectGeometry.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		726D56E2253AE28D0002EF90 /* PlatformImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 726D56E1253AE0430002EF90 /* PlatformImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		726D56E3253AE3660002EF90 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F61D8209F40022C4C7 /* NativeImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3895,7 +3896,6 @@
 		B222F69D0AB771B80022EFAD /* JSSVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B222F69B0AB771B80022EFAD /* JSSVGElement.h */; };
 		B22362290C3AF04A0008CA9B /* JSSVGTextPathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22362270C3AF04A0008CA9B /* JSSVGTextPathElement.h */; };
 		B23540F30D00782E002382FA /* StringTruncator.h in Headers */ = {isa = PBXBuildFile; fileRef = B23540F10D00782E002382FA /* StringTruncator.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598EB0D00D8B900BB825C /* SVGFEImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B25599A40D00D8BA00BB825C /* SVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990C0D00D8B900BB825C /* SVGImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B25599A50D00D8BA00BB825C /* EmptyClients.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990D0D00D8B900BB825C /* EmptyClients.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B27535650B053814002CE64F /* PDFDocumentImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535370B053814002CE64F /* PDFDocumentImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -11354,6 +11354,10 @@
 		72F667DF260C264400EE36AD /* DiagnosticLoggingDomain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingDomain.h; sourceTree = "<group>"; };
 		72F7E742279B8F7400D82D2D /* SourceImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceImage.cpp; sourceTree = "<group>"; };
 		72F7E744279B8F7400D82D2D /* SourceImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceImage.h; sourceTree = "<group>"; };
+		72F7E74E279CEDE800D82D2D /* FEImage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FEImage.cpp; sourceTree = "<group>"; };
+		72F7E74F279CEDE800D82D2D /* FEImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FEImage.h; sourceTree = "<group>"; };
+		72F7E751279CEE5C00D82D2D /* FEImageSoftwareApplier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FEImageSoftwareApplier.cpp; sourceTree = "<group>"; };
+		72F7E752279CEE5C00D82D2D /* FEImageSoftwareApplier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FEImageSoftwareApplier.h; sourceTree = "<group>"; };
 		72FB238422497AD4007E5AC7 /* SVGValuePropertyAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyAnimatorImpl.h; sourceTree = "<group>"; };
 		72FB238622497AD5007E5AC7 /* SVGValuePropertyAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyAnimator.h; sourceTree = "<group>"; };
 		72FB238722497B15007E5AC7 /* SVGValuePropertyListAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyListAnimatorImpl.h; sourceTree = "<group>"; };
@@ -14767,8 +14771,6 @@
 		B22362270C3AF04A0008CA9B /* JSSVGTextPathElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGTextPathElement.h; sourceTree = "<group>"; };
 		B23540F00D00782E002382FA /* StringTruncator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringTruncator.cpp; sourceTree = "<group>"; };
 		B23540F10D00782E002382FA /* StringTruncator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringTruncator.h; sourceTree = "<group>"; };
-		B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEImage.cpp; sourceTree = "<group>"; };
-		B25598EB0D00D8B900BB825C /* SVGFEImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEImage.h; sourceTree = "<group>"; };
 		B255990B0D00D8B900BB825C /* SVGImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImage.cpp; sourceTree = "<group>"; };
 		B255990C0D00D8B900BB825C /* SVGImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImage.h; sourceTree = "<group>"; };
 		B255990D0D00D8B900BB825C /* EmptyClients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EmptyClients.h; sourceTree = "<group>"; };
@@ -24715,6 +24717,8 @@
 				72A13AC5274DE39E00E2A88E /* FEFloodSoftwareApplier.h */,
 				72A13AC6274DE3B700E2A88E /* FEGaussianBlurSoftwareApplier.cpp */,
 				72A13AC7274DE3B700E2A88E /* FEGaussianBlurSoftwareApplier.h */,
+				72F7E751279CEE5C00D82D2D /* FEImageSoftwareApplier.cpp */,
+				72F7E752279CEE5C00D82D2D /* FEImageSoftwareApplier.h */,
 				72A13AC8274DE3D100E2A88E /* FELightingSoftwareApplier.cpp */,
 				72A13AC9274DE3D100E2A88E /* FELightingSoftwareApplier.h */,
 				72A13ACA274DE3E500E2A88E /* FEMergeSoftwareApplier.cpp */,
@@ -26825,6 +26829,8 @@
 				84730D621248F0B300D3A9C9 /* FEFlood.h */,
 				84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */,
 				84801953108BAFB300CB2B1F /* FEGaussianBlur.h */,
+				72F7E74E279CEDE800D82D2D /* FEImage.cpp */,
+				72F7E74F279CEDE800D82D2D /* FEImage.h */,
 				84730D631248F0B300D3A9C9 /* FELighting.cpp */,
 				84730D641248F0B300D3A9C9 /* FELighting.h */,
 				84730D651248F0B300D3A9C9 /* FEMerge.cpp */,
@@ -28624,8 +28630,6 @@
 		B255989C0D00D8B800BB825C /* filters */ = {
 			isa = PBXGroup;
 			children = (
-				B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */,
-				B25598EB0D00D8B900BB825C /* SVGFEImage.h */,
 				845E72F90FD2623900A87D79 /* SVGFilter.cpp */,
 				845E72FA0FD2623900A87D79 /* SVGFilter.h */,
 				081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */,
@@ -34379,6 +34383,7 @@
 				4358E8811360A31700E4748C /* FEDropShadow.h in Headers */,
 				84730D7F1248F0B300D3A9C9 /* FEFlood.h in Headers */,
 				84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */,
+				7256078E279D34B6007D2DD3 /* FEImage.h in Headers */,
 				84730D811248F0B300D3A9C9 /* FELighting.h in Headers */,
 				84730D831248F0B300D3A9C9 /* FEMerge.h in Headers */,
 				84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */,
@@ -37395,7 +37400,6 @@
 				B22279E60D00BF220071B782 /* SVGFEFuncGElement.h in Headers */,
 				B22279E90D00BF220071B782 /* SVGFEFuncRElement.h in Headers */,
 				B22279EC0D00BF220071B782 /* SVGFEGaussianBlurElement.h in Headers */,
-				B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */,
 				B22279EF0D00BF220071B782 /* SVGFEImageElement.h in Headers */,
 				B22279F20D00BF220071B782 /* SVGFELightElement.h in Headers */,
 				B22279F40D00BF220071B782 /* SVGFEMergeElement.h in Headers */,

Modified: trunk/Source/WebCore/platform/graphics/coreimage/FEColorMatrixCoreImageApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/coreimage/FEColorMatrixCoreImageApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/coreimage/FEColorMatrixCoreImageApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,7 +33,7 @@
 
 class FEColorMatrix;
 
-class FEColorMatrixCoreImageApplier : public FilterEffectConcreteApplier<FEColorMatrix> {
+class FEColorMatrixCoreImageApplier final : public FilterEffectConcreteApplier<FEColorMatrix> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEColorMatrix>;
 
@@ -42,7 +42,8 @@
 
     static bool supportsCoreImageRendering(const FEColorMatrix&);
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/coreimage/FEComponentTransferCoreImageApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/coreimage/FEComponentTransferCoreImageApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/coreimage/FEComponentTransferCoreImageApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,7 +33,7 @@
 
 class FEComponentTransfer;
 
-class FEComponentTransferCoreImageApplier : public FilterEffectConcreteApplier<FEComponentTransfer> {
+class FEComponentTransferCoreImageApplier final : public FilterEffectConcreteApplier<FEComponentTransfer> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEComponentTransfer>;
 
@@ -42,7 +42,8 @@
 
     static bool supportsCoreImageRendering(const FEComponentTransfer&);
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,7 +33,7 @@
 
 class SourceGraphic;
 
-class SourceGraphicCoreImageApplier : public FilterEffectConcreteApplier<SourceGraphic> {
+class SourceGraphicCoreImageApplier final : public FilterEffectConcreteApplier<SourceGraphic> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<SourceGraphic>;
 
@@ -40,7 +40,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2022-01-24 08:58:48 UTC (rev 288432)
@@ -29,6 +29,7 @@
 #include "DisplayList.h"
 #include "DisplayListDrawingContext.h"
 #include "DisplayListItems.h"
+#include "FEImage.h"
 #include "Filter.h"
 #include "GraphicsContext.h"
 #include "ImageBuffer.h"
@@ -35,7 +36,6 @@
 #include "Logging.h"
 #include "MediaPlayer.h"
 #include "NotImplemented.h"
-#include "SVGFEImage.h"
 #include <wtf/MathExtras.h>
 #include <wtf/text/TextStream.h>
 

Copied: trunk/Source/WebCore/platform/graphics/filters/FEImage.cpp (from rev 288429, trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp) (0 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/FEImage.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/filters/FEImage.cpp	2022-01-24 08:58:48 UTC (rev 288432)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
+ * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
+ * Copyright (C) 2005 Eric Seidel <[email protected]>
+ * Copyright (C) 2010 Dirk Schulze <[email protected]>
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "FEImage.h"
+
+#include "FEImageSoftwareApplier.h"
+#include "Filter.h"
+#include <wtf/text/TextStream.h>
+
+namespace WebCore {
+
+Ref<FEImage> FEImage::create(SourceImage&& sourceImage, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue& preserveAspectRatio)
+{
+    return adoptRef(*new FEImage(WTFMove(sourceImage), sourceImageRect, preserveAspectRatio));
+}
+
+FEImage::FEImage(SourceImage&& sourceImage, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue& preserveAspectRatio)
+    : FilterEffect(Type::FEImage)
+    , m_sourceImage(WTFMove(sourceImage))
+    , m_sourceImageRect(sourceImageRect)
+    , m_preserveAspectRatio(preserveAspectRatio)
+{
+}
+
+FloatRect FEImage::calculateImageRect(const Filter& filter, const FilterImageVector&, const FloatRect& primitiveSubregion) const
+{
+    if (m_sourceImage.nativeImageIfExists()) {
+        auto imageRect = primitiveSubregion;
+        auto srcRect = m_sourceImageRect;
+        m_preserveAspectRatio.transformRect(imageRect, srcRect);
+        return filter.clipToMaxEffectRect(imageRect, primitiveSubregion);
+    }
+
+    if (m_sourceImage.imageBufferIfExists())
+        return filter.maxEffectRect(primitiveSubregion);
+
+    ASSERT_NOT_REACHED();
+    return FloatRect();
+}
+
+std::unique_ptr<FilterEffectApplier> FEImage::createSoftwareApplier() const
+{
+    return FilterEffectApplier::create<FEImageSoftwareApplier>(*this);
+}
+
+TextStream& FEImage::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
+{
+    ts << indent << "[feImage";
+    FilterEffect::externalRepresentation(ts, representation);
+
+    ts << " image-size=\"" << m_sourceImageRect.width() << "x" << m_sourceImageRect.height() << "\"";
+    // FIXME: should this dump also object returned by FEImage::image() ?
+
+    ts << "]\n";
+    return ts;
+}
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/platform/graphics/filters/FEImage.h (from rev 288429, trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h) (0 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/FEImage.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/filters/FEImage.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
+ * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
+ * Copyright (C) 2005 Eric Seidel <[email protected]>
+ * Copyright (C) 2010 Dirk Schulze <[email protected]>
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#include "FilterEffect.h"
+#include "Image.h"
+#include "ImageBuffer.h"
+#include "SVGPreserveAspectRatioValue.h"
+#include "SourceImage.h"
+
+namespace WebCore {
+
+class Image;
+class ImageBuffer;
+
+class FEImage final : public FilterEffect {
+public:
+    WEBCORE_EXPORT static Ref<FEImage> create(SourceImage&&, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue&);
+
+    const SourceImage& sourceImage() const { return m_sourceImage; }
+    void setImageSource(SourceImage&& sourceImage) { m_sourceImage = WTFMove(sourceImage); }
+
+    FloatRect sourceImageRect() const { return m_sourceImageRect; }
+    const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio; }
+
+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static std::optional<Ref<FEImage>> decode(Decoder&);
+
+private:
+    FEImage(SourceImage&&, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue&);
+
+    unsigned numberOfEffectInputs() const override { return 0; }
+
+    // FEImage results are always in DestinationColorSpace::SRGB()
+    void setOperatingColorSpace(const DestinationColorSpace&) override { }
+
+    FloatRect calculateImageRect(const Filter&, const FilterImageVector& inputs, const FloatRect& primitiveSubregion) const override;
+
+    std::unique_ptr<FilterEffectApplier> createSoftwareApplier() const final;
+
+    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const final;
+
+    SourceImage m_sourceImage;
+    FloatRect m_sourceImageRect;
+    SVGPreserveAspectRatioValue m_preserveAspectRatio;
+};
+
+template<class Encoder>
+void FEImage::encode(Encoder& encoder) const
+{
+    encoder << m_sourceImage;
+    encoder << m_sourceImageRect;
+    encoder << m_preserveAspectRatio;
+}
+
+template<class Decoder>
+std::optional<Ref<FEImage>> FEImage::decode(Decoder& decoder)
+{
+    std::optional<SourceImage> sourceImage;
+    decoder >> sourceImage;
+    if (!sourceImage)
+        return std::nullopt;
+
+    std::optional<FloatRect> sourceImageRect;
+    decoder >> sourceImageRect;
+    if (!sourceImageRect)
+        return std::nullopt;
+
+    std::optional<SVGPreserveAspectRatioValue> preserveAspectRatio;
+    decoder >> preserveAspectRatio;
+    if (!preserveAspectRatio)
+        return std::nullopt;
+
+    return FEImage::create(WTFMove(*sourceImage), *sourceImageRect, *preserveAspectRatio);
+}
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEImage)

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -3,7 +3,7 @@
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
  * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -29,7 +29,7 @@
 
 class FEBlend;
 
-class FEBlendSoftwareApplier : public FilterEffectConcreteApplier<FEBlend> {
+class FEBlendSoftwareApplier final : public FilterEffectConcreteApplier<FEBlend> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEBlend>;
 
@@ -36,7 +36,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -29,7 +29,7 @@
 class FEColorMatrix;
 class PixelBuffer;
 
-class FEColorMatrixSoftwareApplier : public FilterEffectConcreteApplier<FEColorMatrix> {
+class FEColorMatrixSoftwareApplier final : public FilterEffectConcreteApplier<FEColorMatrix> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEColorMatrix>;
 
@@ -36,9 +36,9 @@
 public:
     FEColorMatrixSoftwareApplier(const FEColorMatrix&);
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     inline void matrix(float& red, float& green, float& blue, float& alpha) const;
     inline void saturateAndHueRotate(float& red, float& green, float& blue) const;
     inline void luminance(float& red, float& green, float& blue, float& alpha) const;

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -30,7 +30,7 @@
 class PixelBuffer;
 struct ComponentTransferFunction;
 
-class FEComponentTransferSoftwareApplier : public FilterEffectConcreteApplier<FEComponentTransfer> {
+class FEComponentTransferSoftwareApplier final : public FilterEffectConcreteApplier<FEComponentTransfer> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEComponentTransfer>;
 
@@ -37,9 +37,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     using LookupTable = std::array<uint8_t, 256>;
 
     static void computeIdentityTable(LookupTable&, const ComponentTransferFunction&);

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -28,7 +28,7 @@
 
 class FEComposite;
 
-class FECompositeSoftwareApplier : public FilterEffectConcreteApplier<FEComposite> {
+class FECompositeSoftwareApplier final : public FilterEffectConcreteApplier<FEComposite> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEComposite>;
 
@@ -35,9 +35,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     static uint8_t clampByte(int);
 
     template <int b1, int b4>

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -3,7 +3,7 @@
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
  * Copyright (C) 2010 Zoltan Herczeg <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -34,7 +34,7 @@
 class FEConvolveMatrix;
 enum class EdgeModeType;
 
-class FEConvolveMatrixSoftwareApplier : public FilterEffectConcreteApplier<FEConvolveMatrix> {
+class FEConvolveMatrixSoftwareApplier final : public FilterEffectConcreteApplier<FEConvolveMatrix> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEConvolveMatrix>;
 
@@ -41,9 +41,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     struct PaintingData {
         const Uint8ClampedArray& srcPixelArray;
         Uint8ClampedArray& dstPixelArray;

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -28,7 +28,7 @@
 
 class FEDisplacementMap;
 
-class FEDisplacementMapSoftwareApplier : public FilterEffectConcreteApplier<FEDisplacementMap> {
+class FEDisplacementMapSoftwareApplier final : public FilterEffectConcreteApplier<FEDisplacementMap> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEDisplacementMap>;
 
@@ -35,9 +35,9 @@
 public:
     FEDisplacementMapSoftwareApplier(const FEDisplacementMap&);
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     static inline unsigned byteOffsetOfPixel(unsigned x, unsigned y, unsigned rowBytes)
     {
         const unsigned bytesPerPixel = 4;

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -26,7 +26,7 @@
 
 class FEDropShadow;
 
-class FEDropShadowSoftwareApplier : public FilterEffectConcreteApplier<FEDropShadow> {
+class FEDropShadowSoftwareApplier final : public FilterEffectConcreteApplier<FEDropShadow> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEDropShadow>;
 
@@ -33,7 +33,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -28,7 +28,7 @@
 
 class FEFlood;
 
-class FEFloodSoftwareApplier : public FilterEffectConcreteApplier<FEFlood> {
+class FEFloodSoftwareApplier final : public FilterEffectConcreteApplier<FEFlood> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEFlood>;
 
@@ -35,7 +35,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2015-2021 Apple, Inc. All rights reserved.
+ * Copyright (C) 2015-2022 Apple, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -31,7 +31,7 @@
 class FEGaussianBlur;
 enum class EdgeModeType;
 
-class FEGaussianBlurSoftwareApplier : public FilterEffectConcreteApplier<FEGaussianBlur> {
+class FEGaussianBlurSoftwareApplier final : public FilterEffectConcreteApplier<FEGaussianBlur> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEGaussianBlur>;
 
@@ -38,9 +38,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     struct ApplyParameters {
         RefPtr<Uint8ClampedArray> ioPixelArray;
         RefPtr<Uint8ClampedArray> tmpPixelArray;

Added: trunk/Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.cpp (0 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.cpp	2022-01-24 08:58:48 UTC (rev 288432)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2021-2022 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 "config.h"
+#include "FEImageSoftwareApplier.h"
+
+#include "FEImage.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+bool FEImageSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result) const
+{
+    auto resultImage = result.imageBuffer();
+    if (!resultImage)
+        return false;
+
+    auto& sourceImage = m_effect.sourceImage();
+    auto primitiveSubregion = result.primitiveSubregion();
+    auto& context = resultImage->context();
+
+    if (auto nativeImage = sourceImage.nativeImageIfExists()) {
+        auto imageRect = primitiveSubregion;
+        auto srcRect = m_effect.sourceImageRect();
+        m_effect.preserveAspectRatio().transformRect(imageRect, srcRect);
+        imageRect.scale(filter.filterScale());
+        imageRect = IntRect(imageRect) - result.absoluteImageRect().location();
+        context.drawNativeImage(*nativeImage, srcRect.size(), imageRect, srcRect);
+        return true;
+    }
+
+    if (auto imageBuffer = sourceImage.imageBufferIfExists()) {
+        auto imageRect = primitiveSubregion;
+        imageRect.moveBy(m_effect.sourceImageRect().location());
+        imageRect.scale(filter.filterScale());
+        imageRect = IntRect(imageRect) - result.absoluteImageRect().location();
+        context.drawImageBuffer(*imageBuffer, imageRect.location());
+        return true;
+    }
+    
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.h (from rev 288429, trunk/Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.h) (0 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEImageSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2021-2022 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 "FilterEffectApplier.h"
+
+namespace WebCore {
+
+class FEImage;
+
+class FEImageSoftwareApplier final : public FilterEffectConcreteApplier<FEImage> {
+    WTF_MAKE_FAST_ALLOCATED;
+    using Base = FilterEffectConcreteApplier<FEImage>;
+
+public:
+    using Base::Base;
+
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
+};
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2010 University of Szeged
  * Copyright (C) 2010 Zoltan Herczeg
- * Copyright (C) 2018-2021 Apple, Inc. All rights reserved.
+ * Copyright (C) 2018-2022 Apple, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,7 +37,7 @@
 
 class FELighting;
 
-class FELightingSoftwareApplier : public FilterEffectConcreteApplier<FELighting> {
+class FELightingSoftwareApplier final : public FilterEffectConcreteApplier<FELighting> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FELighting>;
 
@@ -44,9 +44,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     static constexpr int cPixelSize = 4;
     static constexpr int cAlphaChannelOffset = 3;
     static constexpr uint8_t cOpaqueAlpha = static_cast<uint8_t>(0xFF);

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) Apple Inc. 2021 All rights reserved.
+ * Copyright (C) 2021-2022 Apple, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -28,7 +28,7 @@
 
 class FEMerge;
 
-class FEMergeSoftwareApplier : public FilterEffectConcreteApplier<FEMerge> {
+class FEMergeSoftwareApplier final : public FilterEffectConcreteApplier<FEMerge> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEMerge>;
 
@@ -35,7 +35,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) Apple Inc. 2021 All rights reserved.
+ * Copyright (C) 2021-2022 Apple, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -32,7 +32,7 @@
 class FEMorphology;
 enum class MorphologyOperatorType;
 
-class FEMorphologySoftwareApplier : public FilterEffectConcreteApplier<FEMorphology> {
+class FEMorphologySoftwareApplier final : public FilterEffectConcreteApplier<FEMorphology> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEMorphology>;
 
@@ -39,9 +39,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     using ColumnExtrema = Vector<ColorComponents<uint8_t, 4>, 16>;
 
     struct PaintingData {

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -28,7 +28,7 @@
 
 class FEOffset;
 
-class FEOffsetSoftwareApplier : public FilterEffectConcreteApplier<FEOffset> {
+class FEOffsetSoftwareApplier final : public FilterEffectConcreteApplier<FEOffset> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEOffset>;
 
@@ -35,7 +35,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -2,7 +2,7 @@
  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
  * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
  * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -28,7 +28,7 @@
 
 class FETile;
 
-class FETileSoftwareApplier : public FilterEffectConcreteApplier<FETile> {
+class FETileSoftwareApplier final : public FilterEffectConcreteApplier<FETile> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FETile>;
 
@@ -35,7 +35,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -4,7 +4,7 @@
  * Copyright (C) 2005 Eric Seidel <[email protected]>
  * Copyright (C) 2009 Dirk Schulze <[email protected]>
  * Copyright (C) 2010 Renata Hodovan <[email protected]>
- * Copyright (C) 2017-2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2017-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -35,7 +35,7 @@
 class FETurbulence;
 enum class TurbulenceType;
 
-class FETurbulenceSoftwareApplier : public FilterEffectConcreteApplier<FETurbulence> {
+class FETurbulenceSoftwareApplier final : public FilterEffectConcreteApplier<FETurbulence> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FETurbulence>;
 
@@ -42,9 +42,9 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 
-private:
     // Produces results in the range [1, 2**31 - 2]. Algorithm is:
     // r = (a * r) mod m where a = s_randAmplitude = 16807 and
     // m = s_randMaximum = 2**31 - 1 = 2147483647, r = seed.

Modified: trunk/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Dirk Schulze <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -26,7 +26,7 @@
 
 class SourceAlpha;
 
-class SourceAlphaSoftwareApplier : public FilterEffectConcreteApplier<SourceAlpha> {
+class SourceAlphaSoftwareApplier final : public FilterEffectConcreteApplier<SourceAlpha> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<SourceAlpha>;
 
@@ -33,7 +33,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h (288431 => 288432)


--- trunk/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2008 Alex Mathews <[email protected]>
  * Copyright (C) 2009 Dirk Schulze <[email protected]>
- * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -27,7 +27,7 @@
 
 class SourceGraphic;
 
-class SourceGraphicSoftwareApplier : public FilterEffectConcreteApplier<SourceGraphic> {
+class SourceGraphicSoftwareApplier final : public FilterEffectConcreteApplier<SourceGraphic> {
     WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<SourceGraphic>;
 
@@ -34,7 +34,8 @@
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
+private:
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const final;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp (288431 => 288432)


--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp	2022-01-24 08:58:48 UTC (rev 288432)
@@ -31,7 +31,6 @@
 #include "SVGElementTypeHelpers.h"
 #include "SVGFEDiffuseLightingElement.h"
 #include "SVGFEFloodElement.h"
-#include "SVGFEImage.h"
 #include "SVGFESpecularLightingElement.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 #include "SVGNames.h"

Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (288431 => 288432)


--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp	2022-01-24 08:58:48 UTC (rev 288432)
@@ -27,6 +27,7 @@
 #include "CachedResourceLoader.h"
 #include "CachedResourceRequest.h"
 #include "Document.h"
+#include "FEImage.h"
 #include "Image.h"
 #include "RenderObject.h"
 #include "RenderSVGResource.h"

Modified: trunk/Source/WebCore/svg/SVGFEImageElement.h (288431 => 288432)


--- trunk/Source/WebCore/svg/SVGFEImageElement.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -23,7 +23,6 @@
 
 #include "CachedImageClient.h"
 #include "CachedResourceHandle.h"
-#include "SVGFEImage.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 #include "SVGURIReference.h"
 

Deleted: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp (288431 => 288432)


--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,124 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
- * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2010 Dirk Schulze <[email protected]>
- * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SVGFEImage.h"
-
-#include "Filter.h"
-#include "FilterEffectApplier.h"
-#include "GraphicsContext.h"
-#include <wtf/text/TextStream.h>
-
-namespace WebCore {
-
-Ref<FEImage> FEImage::create(SourceImage&& sourceImage, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue& preserveAspectRatio)
-{
-    return adoptRef(*new FEImage(WTFMove(sourceImage), sourceImageRect, preserveAspectRatio));
-}
-
-FEImage::FEImage(SourceImage&& sourceImage, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue& preserveAspectRatio)
-    : FilterEffect(Type::FEImage)
-    , m_sourceImage(WTFMove(sourceImage))
-    , m_sourceImageRect(sourceImageRect)
-    , m_preserveAspectRatio(preserveAspectRatio)
-{
-}
-
-FloatRect FEImage::calculateImageRect(const Filter& filter, const FilterImageVector&, const FloatRect& primitiveSubregion) const
-{
-    if (m_sourceImage.nativeImageIfExists()) {
-        auto imageRect = primitiveSubregion;
-        auto srcRect = m_sourceImageRect;
-        m_preserveAspectRatio.transformRect(imageRect, srcRect);
-        return filter.clipToMaxEffectRect(imageRect, primitiveSubregion);
-    }
-
-    if (m_sourceImage.imageBufferIfExists())
-        return filter.maxEffectRect(primitiveSubregion);
-
-    ASSERT_NOT_REACHED();
-    return FloatRect();
-}
-
-// FIXME: Move the class FEImageSoftwareApplier to separate source and header files.
-class FEImageSoftwareApplier : public FilterEffectConcreteApplier<FEImage> {
-    WTF_MAKE_FAST_ALLOCATED;
-    using Base = FilterEffectConcreteApplier<FEImage>;
-
-public:
-    using Base::Base;
-
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
-};
-
-bool FEImageSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result) const
-{
-    auto resultImage = result.imageBuffer();
-    if (!resultImage)
-        return false;
-
-    auto& sourceImage = m_effect.sourceImage();
-    auto primitiveSubregion = result.primitiveSubregion();
-    auto& context = resultImage->context();
-
-    if (auto nativeImage = sourceImage.nativeImageIfExists()) {
-        auto imageRect = primitiveSubregion;
-        auto srcRect = m_effect.sourceImageRect();
-        m_effect.preserveAspectRatio().transformRect(imageRect, srcRect);
-        imageRect.scale(filter.filterScale());
-        imageRect = IntRect(imageRect) - result.absoluteImageRect().location();
-        context.drawNativeImage(*nativeImage, srcRect.size(), imageRect, srcRect);
-        return true;
-    }
-
-    if (auto imageBuffer = sourceImage.imageBufferIfExists()) {
-        auto imageRect = primitiveSubregion;
-        imageRect.moveBy(m_effect.sourceImageRect().location());
-        imageRect.scale(filter.filterScale());
-        imageRect = IntRect(imageRect) - result.absoluteImageRect().location();
-        context.drawImageBuffer(*imageBuffer, imageRect.location());
-        return true;
-    }
-    
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-std::unique_ptr<FilterEffectApplier> FEImage::createSoftwareApplier() const
-{
-    return FilterEffectApplier::create<FEImageSoftwareApplier>(*this);
-}
-
-TextStream& FEImage::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
-{
-    ts << indent << "[feImage";
-    FilterEffect::externalRepresentation(ts, representation);
-
-    ts << " image-size=\"" << m_sourceImageRect.width() << "x" << m_sourceImageRect.height() << "\"";
-    // FIXME: should this dump also object returned by SVGFEImage::image() ?
-
-    ts << "]\n";
-    return ts;
-}
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h (288431 => 288432)


--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
- * Copyright (C) 2005 Eric Seidel <[email protected]>
- * Copyright (C) 2010 Dirk Schulze <[email protected]>
- * Copyright (C) 2021-2022 Apple Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "FilterEffect.h"
-#include "Image.h"
-#include "ImageBuffer.h"
-#include "SVGPreserveAspectRatioValue.h"
-#include "SourceImage.h"
-
-namespace WebCore {
-
-class Image;
-class ImageBuffer;
-
-class FEImage final : public FilterEffect {
-public:
-    WEBCORE_EXPORT static Ref<FEImage> create(SourceImage&&, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue&);
-
-    const SourceImage& sourceImage() const { return m_sourceImage; }
-    void setImageSource(SourceImage&& sourceImage) { m_sourceImage = WTFMove(sourceImage); }
-
-    FloatRect sourceImageRect() const { return m_sourceImageRect; }
-    const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio; }
-
-    template<class Encoder> void encode(Encoder&) const;
-    template<class Decoder> static std::optional<Ref<FEImage>> decode(Decoder&);
-
-private:
-    FEImage(SourceImage&&, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue&);
-
-    unsigned numberOfEffectInputs() const override { return 0; }
-
-    // FEImage results are always in DestinationColorSpace::SRGB()
-    void setOperatingColorSpace(const DestinationColorSpace&) override { }
-
-    FloatRect calculateImageRect(const Filter&, const FilterImageVector& inputs, const FloatRect& primitiveSubregion) const override;
-
-    std::unique_ptr<FilterEffectApplier> createSoftwareApplier() const final;
-
-    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const final;
-
-    SourceImage m_sourceImage;
-    FloatRect m_sourceImageRect;
-    SVGPreserveAspectRatioValue m_preserveAspectRatio;
-};
-
-template<class Encoder>
-void FEImage::encode(Encoder& encoder) const
-{
-    encoder << m_sourceImage;
-    encoder << m_sourceImageRect;
-    encoder << m_preserveAspectRatio;
-}
-
-template<class Decoder>
-std::optional<Ref<FEImage>> FEImage::decode(Decoder& decoder)
-{
-    std::optional<SourceImage> sourceImage;
-    decoder >> sourceImage;
-    if (!sourceImage)
-        return std::nullopt;
-
-    std::optional<FloatRect> sourceImageRect;
-    decoder >> sourceImageRect;
-    if (!sourceImageRect)
-        return std::nullopt;
-
-    std::optional<SVGPreserveAspectRatioValue> preserveAspectRatio;
-    decoder >> preserveAspectRatio;
-    if (!preserveAspectRatio)
-        return std::nullopt;
-
-    return FEImage::create(WTFMove(*sourceImage), *sourceImageRect, *preserveAspectRatio);
-}
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEImage)

Modified: trunk/Source/WebKit/ChangeLog (288431 => 288432)


--- trunk/Source/WebKit/ChangeLog	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebKit/ChangeLog	2022-01-24 08:58:48 UTC (rev 288432)
@@ -1,3 +1,13 @@
+2022-01-24  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] [Filters] Move FEImage to the 'platform' directory
+        https://bugs.webkit.org/show_bug.cgi?id=234109
+        rdar://86608573
+
+        Reviewed by Darin Adler.
+
+        * Platform/IPC/FilterReference.h:
+
 2022-01-22  Ben Nham  <[email protected]>
 
         Add PushSubscriptionIdentifier

Modified: trunk/Source/WebKit/Platform/IPC/FilterReference.h (288431 => 288432)


--- trunk/Source/WebKit/Platform/IPC/FilterReference.h	2022-01-24 07:32:16 UTC (rev 288431)
+++ trunk/Source/WebKit/Platform/IPC/FilterReference.h	2022-01-24 08:58:48 UTC (rev 288432)
@@ -36,6 +36,7 @@
 #include <WebCore/FEDropShadow.h>
 #include <WebCore/FEFlood.h>
 #include <WebCore/FEGaussianBlur.h>
+#include <WebCore/FEImage.h>
 #include <WebCore/FEMerge.h>
 #include <WebCore/FEMorphology.h>
 #include <WebCore/FEOffset.h>
@@ -44,7 +45,6 @@
 #include <WebCore/FETurbulence.h>
 #include <WebCore/Filter.h>
 #include <WebCore/FilterEffectVector.h>
-#include <WebCore/SVGFEImage.h>
 #include <WebCore/SVGFilter.h>
 #include <WebCore/SourceAlpha.h>
 #include <WebCore/SourceGraphic.h>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to