Title: [196571] trunk
Revision
196571
Author
[email protected]
Date
2016-02-14 21:10:58 -0800 (Sun, 14 Feb 2016)

Log Message

[CSS Filters] When applying an SVG filter on a composited image using CSS the image is rendered without the filter
https://bugs.webkit.org/show_bug.cgi?id=154108

Reviewed by Sam Weinig.
Source/WebCore:

When checking whether we can directly composite an image, we need to check for software-rendered
filters.

Test: compositing/filters/simple-image-with-svg-filter.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isDirectlyCompositedImage):

LayoutTests:

* compositing/filters/simple-image-with-svg-filter-expected.html: Added.
* compositing/filters/simple-image-with-svg-filter.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196570 => 196571)


--- trunk/LayoutTests/ChangeLog	2016-02-15 04:49:31 UTC (rev 196570)
+++ trunk/LayoutTests/ChangeLog	2016-02-15 05:10:58 UTC (rev 196571)
@@ -1,3 +1,13 @@
+2016-02-14  Simon Fraser  <[email protected]>
+
+        [CSS Filters] When applying an SVG filter on a composited image using CSS the image is rendered without the filter
+        https://bugs.webkit.org/show_bug.cgi?id=154108
+
+        Reviewed by Sam Weinig.
+
+        * compositing/filters/simple-image-with-svg-filter-expected.html: Added.
+        * compositing/filters/simple-image-with-svg-filter.html: Added.
+
 2016-02-14  Chris Dumez  <[email protected]>
 
         Window and WorkerGlobalScope should inherit EventTarget

Added: trunk/LayoutTests/compositing/filters/simple-image-with-svg-filter-expected.html (0 => 196571)


--- trunk/LayoutTests/compositing/filters/simple-image-with-svg-filter-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/filters/simple-image-with-svg-filter-expected.html	2016-02-15 05:10:58 UTC (rev 196571)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+    img {
+        margin: 10px;
+        height: 100px;
+        width: 100px;
+    }
+    
+    svg {
+        display: none;
+    }
+    </style>
+</head>
+<body>
+    <!-- These two images should look the same. -->
+    <img style="-webkit-filter: url(#redToGreen);" src=""
+    <img style="-webkit-filter: url(#redToGreen);" src=""
+
+    <svg>
+      	<filter id="redToGreen">
+        <feColorMatrix type="matrix" values="0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0" />
+      </filter>
+    </svg>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/filters/simple-image-with-svg-filter.html (0 => 196571)


--- trunk/LayoutTests/compositing/filters/simple-image-with-svg-filter.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/filters/simple-image-with-svg-filter.html	2016-02-15 05:10:58 UTC (rev 196571)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+    img {
+        margin: 10px;
+        height: 100px;
+        width: 100px;
+    }
+    
+    .composited {
+        -webkit-transform: translateZ(0);
+    }
+    
+    svg {
+        display: none;
+    }
+    </style>
+</head>
+<body>
+    <!-- These two images should look the same. -->
+    <img style="-webkit-filter: url(#redToGreen);" src="" class="composited" >
+    <img style="-webkit-filter: url(#redToGreen);" src=""
+
+    <svg>
+      	<filter id="redToGreen">
+        <feColorMatrix type="matrix" values="0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0" />
+      </filter>
+    </svg>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (196570 => 196571)


--- trunk/Source/WebCore/ChangeLog	2016-02-15 04:49:31 UTC (rev 196570)
+++ trunk/Source/WebCore/ChangeLog	2016-02-15 05:10:58 UTC (rev 196571)
@@ -1,3 +1,18 @@
+2016-02-14  Simon Fraser  <[email protected]>
+
+        [CSS Filters] When applying an SVG filter on a composited image using CSS the image is rendered without the filter
+        https://bugs.webkit.org/show_bug.cgi?id=154108
+
+        Reviewed by Sam Weinig.
+        
+        When checking whether we can directly composite an image, we need to check for software-rendered
+        filters.
+
+        Test: compositing/filters/simple-image-with-svg-filter.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
+
 2016-02-14  Chris Dumez  <[email protected]>
 
         Drop the [EventTarget] WebKit-specific IDL extended attribute

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (196570 => 196571)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-02-15 04:49:31 UTC (rev 196570)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-02-15 05:10:58 UTC (rev 196571)
@@ -1995,7 +1995,7 @@
 // that require painting. Direct compositing saves backing store.
 bool RenderLayerBacking::isDirectlyCompositedImage() const
 {
-    if (!is<RenderImage>(renderer()) || m_owningLayer.hasBoxDecorationsOrBackground() || renderer().hasClip())
+    if (!is<RenderImage>(renderer()) || m_owningLayer.hasBoxDecorationsOrBackground() || m_owningLayer.paintsWithFilters() || renderer().hasClip())
         return false;
 
 #if ENABLE(VIDEO)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to