Title: [289855] trunk
Revision
289855
Author
hironori.fu...@sony.com
Date
2022-02-15 15:05:57 -0800 (Tue, 15 Feb 2022)

Log Message

[TextureMapperGL] drop-shadow filter with blur-radius doesn't work as expected if it is the last filter
https://bugs.webkit.org/show_bug.cgi?id=236407

Reviewed by Don Olmstead.

Source/WebCore:

BitmapTextureGL::applyFilters doesn't actually apply the last filter
and returns a texture by saving the last filter information in
m_filterInfo. Then, TextureMapperGL::drawTexture will actually apply
the last filter while drawing the texture.

TextureMapperGL::drawTexture shouldn't use
TextureMapperShaderProgram::TextureRGB option if the BitmapTextureGL
has m_filterInfo.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
AlphaBlur and ContentTexture filters should be applied before Opacity filter.

LayoutTests:

* platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png: Added.
* platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (289854 => 289855)


--- trunk/LayoutTests/ChangeLog	2022-02-15 22:51:20 UTC (rev 289854)
+++ trunk/LayoutTests/ChangeLog	2022-02-15 23:05:57 UTC (rev 289855)
@@ -1,3 +1,13 @@
+2022-02-15  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [TextureMapperGL] drop-shadow filter with blur-radius doesn't work as expected if it is the last filter
+        https://bugs.webkit.org/show_bug.cgi?id=236407
+
+        Reviewed by Don Olmstead.
+
+        * platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png: Added.
+        * platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.txt:
+
 2022-02-15  Matteo Flores  <matteo_flo...@apple.com>
 
         REGRESSION(r287249): [ Monterey wk2 ] media/media-source/media-webm-vorbis-partial.html is a constant text failure

Added: trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png


(Binary files differ)
Index: trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png =================================================================== --- trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png 2022-02-15 22:51:20 UTC (rev 289854) +++ trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png 2022-02-15 23:05:57 UTC (rev 289855) Property changes on: trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.png ___________________________________________________________________

Added: svn:mime-type

+image/png \ No newline at end of property

Modified: trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.txt (289854 => 289855)


--- trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.txt	2022-02-15 22:51:20 UTC (rev 289854)
+++ trunk/LayoutTests/platform/wincairo/css3/filters/effect-drop-shadow-hw-expected.txt	2022-02-15 23:05:57 UTC (rev 289855)
@@ -9,9 +9,8 @@
         text run at (384,105) width 4: " "
       RenderText {#text} at (578,105) size 4x19
         text run at (578,105) width 4: " "
-      RenderText {#text} at (772,105) size 4x19
-        text run at (772,105) width 4: " "
       RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
 layer at (23,23) size 160x90
   RenderImage {IMG} at (15,15) size 160x90
 layer at (217,23) size 160x90

Modified: trunk/Source/WebCore/ChangeLog (289854 => 289855)


--- trunk/Source/WebCore/ChangeLog	2022-02-15 22:51:20 UTC (rev 289854)
+++ trunk/Source/WebCore/ChangeLog	2022-02-15 23:05:57 UTC (rev 289855)
@@ -1,3 +1,24 @@
+2022-02-15  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [TextureMapperGL] drop-shadow filter with blur-radius doesn't work as expected if it is the last filter
+        https://bugs.webkit.org/show_bug.cgi?id=236407
+
+        Reviewed by Don Olmstead.
+
+        BitmapTextureGL::applyFilters doesn't actually apply the last filter
+        and returns a texture by saving the last filter information in
+        m_filterInfo. Then, TextureMapperGL::drawTexture will actually apply
+        the last filter while drawing the texture.
+
+        TextureMapperGL::drawTexture shouldn't use
+        TextureMapperShaderProgram::TextureRGB option if the BitmapTextureGL
+        has m_filterInfo.
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::drawTexture):
+        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
+        AlphaBlur and ContentTexture filters should be applied before Opacity filter.
+
 2022-02-15  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [macOS] Add a context menu item to "Copy Cropped Image"

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (289854 => 289855)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2022-02-15 22:51:20 UTC (rev 289854)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2022-02-15 23:05:57 UTC (rev 289855)
@@ -472,7 +472,7 @@
         && exposedEdges == AllEdges
         && !modelViewMatrix.mapQuad(targetRect).isRectilinear();
 
-    TextureMapperShaderProgram::Options options = TextureMapperShaderProgram::TextureRGB;
+    TextureMapperShaderProgram::Options options = 0;
     if (useRect)
         options |= TextureMapperShaderProgram::Rect;
     if (opacity < 1)
@@ -493,7 +493,8 @@
         options |= optionsForFilterType(filter->type(), data().filterInfo->pass);
         if (filter->affectsOpacity())
             flags |= ShouldBlend;
-    }
+    } else
+        options |= TextureMapperShaderProgram::TextureRGB;
 
     if (useAntialiasing || opacity < 1)
         flags |= ShouldBlend;

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp (289854 => 289855)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2022-02-15 22:51:20 UTC (rev 289854)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2022-02-15 23:05:57 UTC (rev 289855)
@@ -502,6 +502,8 @@
             applyTexturePackedYUVIfNeeded(color, texCoord);
             applyPremultiplyIfNeeded(color);
             applySolidColorIfNeeded(color);
+            applyAlphaBlurIfNeeded(color, texCoord);
+            applyContentTextureIfNeeded(color, texCoord);
             applyAntialiasingIfNeeded(color);
             applyOpacityIfNeeded(color);
             applyGrayscaleFilterIfNeeded(color);
@@ -513,8 +515,6 @@
             applyContrastFilterIfNeeded(color);
             applyOpacityFilterIfNeeded(color);
             applyBlurFilterIfNeeded(color, texCoord);
-            applyAlphaBlurIfNeeded(color, texCoord);
-            applyContentTextureIfNeeded(color, texCoord);
             applyTextureExternalOESIfNeeded(color, texCoord);
             applyRoundedRectClipIfNeeded(color);
             gl_FragColor = color;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to