Don't assert if mix-blend-mode is set to a non-separable blend mode on a composited...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Oct 2017 21:12:36 +0000 (21:12 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Oct 2017 21:12:36 +0000 (21:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178196
rdar://problem/34942337

Reviewed by Dan Bates.

Source/WebCore:

Core Animation doesn't support non-separable blend modes (hue, saturation, color, luminosity)
on layers, but don't assert if we try to use them.

Test: compositing/filters/blend-mode-saturation.html

* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):

LayoutTests:

* compositing/filters/blend-mode-saturation-expected.txt: Added.
* compositing/filters/blend-mode-saturation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/filters/blend-mode-saturation-expected.txt [new file with mode: 0644]
LayoutTests/compositing/filters/blend-mode-saturation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm

index 76d3b7e..6e2fb48 100644 (file)
@@ -1,3 +1,14 @@
+2017-10-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Don't assert if mix-blend-mode is set to a non-separable blend mode on a composited layer
+        https://bugs.webkit.org/show_bug.cgi?id=178196
+        rdar://problem/34942337
+
+        Reviewed by Dan Bates.
+
+        * compositing/filters/blend-mode-saturation-expected.txt: Added.
+        * compositing/filters/blend-mode-saturation.html: Added.
+
 2017-10-12  John Wilander  <wilander@apple.com>
 
         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
diff --git a/LayoutTests/compositing/filters/blend-mode-saturation-expected.txt b/LayoutTests/compositing/filters/blend-mode-saturation-expected.txt
new file mode 100644 (file)
index 0000000..55af489
--- /dev/null
@@ -0,0 +1,3 @@
+This test should not assert (but the saturation blend mode may not be applied).
+
+
diff --git a/LayoutTests/compositing/filters/blend-mode-saturation.html b/LayoutTests/compositing/filters/blend-mode-saturation.html
new file mode 100644 (file)
index 0000000..da7f067
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        .container {
+            position: absolute;
+            padding: 50px;
+            background-color: blue;
+            z-index: 0;
+        }
+        .box {
+            height: 100px;
+            width: 100px;
+            background-color: hsl(270, 60%, 70%);
+            border: 1px solid black;
+            mix-blend-mode: saturation;
+            will-change: transform;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+    </script>
+</head>
+<body>
+    <p>This test should not assert (but the saturation blend mode may not be applied).
+    <div class="container">
+        <div class="box"></div>
+    </div>
+</body>
+</html>
index afa1cd4..0014b27 100644 (file)
@@ -1,3 +1,19 @@
+2017-10-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Don't assert if mix-blend-mode is set to a non-separable blend mode on a composited layer
+        https://bugs.webkit.org/show_bug.cgi?id=178196
+        rdar://problem/34942337
+
+        Reviewed by Dan Bates.
+
+        Core Animation doesn't support non-separable blend modes (hue, saturation, color, luminosity)
+        on layers, but don't assert if we try to use them.
+
+        Test: compositing/filters/blend-mode-saturation.html
+
+        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
+        (PlatformCAFilters::setBlendingFiltersOnLayer):
+
 2017-10-12  John Wilander  <wilander@apple.com>
 
         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
index 3d1d9a5..475dfd3 100644 (file)
@@ -586,6 +586,12 @@ void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformLayer* layer, const Bl
     case BlendModePlusLighter:
         filter = [CAFilter filterWithType:kCAFilterPlusL];
         break;
+    case BlendModeHue:
+    case BlendModeSaturation:
+    case BlendModeColor:
+    case BlendModeLuminosity:
+        // FIXME: CA does't support non-separable blend modes on compositing filters.
+        break;
     default:
         ASSERT_NOT_REACHED();
     }