[CSS Shaders] Update custom filter tests to use the new security model
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2012 18:26:57 +0000 (18:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2012 18:26:57 +0000 (18:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95760

Patch by Max Vujovic <mvujovic@adobe.com> on 2012-09-05
Reviewed by Dirk Schulze.

This patch updates the custom filter tests to not sample u_texture and not write
to gl_FragColor. Now, the tests use the new security model by writing to
css_MixColor and indirectly blending with the DOM element texture.

This patch prepares us to remove direct DOM texture access via "u_texture":
https://bugs.webkit.org/show_bug.cgi?id=93871

* css3/filters/custom/custom-filter-css-keyword-as-parameter-name-expected.png:
* css3/filters/custom/custom-filter-shader-cache-expected.png:
* css3/filters/custom/custom-filter-shader-cache.html:
    Use the CSS mix function with the updated color-offset.fs.
* css3/filters/custom/effect-color-check-expected.png:
* css3/filters/custom/effect-color-check.html:
    Use the CSS mix function with the updated color-fill.fs.
* css3/filters/custom/effect-custom-combined-missing-expected.png:
* css3/filters/custom/effect-custom-combined-missing.html:
    Use the CSS mix function with the updated color-offset.fs.
* css3/filters/custom/effect-custom-expected.png:
* css3/filters/custom/effect-custom-parameters-expected.png:
* css3/filters/custom/effect-custom-parameters.html:
    Use the mix-color.fs shader instead of color-offset-parameters.fs.
* css3/filters/custom/effect-custom.html:
    Use the CSS mix function with the updated color-offset.fs.
* css3/filters/custom/filter-repaint-custom-clipped-expected.png:
* css3/filters/custom/filter-repaint-custom-clipped.html:
    Use the mix-color.fs shader instead of color-add.fs.
* css3/filters/custom/filter-repaint-custom-expected.png:
* css3/filters/custom/filter-repaint-custom-rotated-expected.png:
* css3/filters/custom/filter-repaint-custom-rotated.html:
    Use the mix-color.fs shader instead of color-add.fs. Fix a small typo in a comment.
* css3/filters/custom/filter-repaint-custom.html:
    Use the mix-color.fs shader instead of color-add.fs.
* css3/filters/custom/invalid-custom-filter-shader.html:
    Use the CSS mix function with the updated color-offset.fs.
* css3/filters/custom/missing-custom-filter-shader-expected.png:
* css3/filters/custom/missing-custom-filter-shader.html:
    Use the CSS mix function with the updated color-offset.fs.
* css3/filters/resources/color-add.fs:
    Removed. The mix-color.fs shader can perform this shader's function.
* css3/filters/resources/color-fill.fs:
    Rewrote this shader to write to css_MixColor instead of sampling u_texture and writing
    to gl_FragColor.
* css3/filters/resources/color-offset-parameters.fs:
    Removed. The mix-color.fs shader can perform this shader's function.
* css3/filters/resources/color-offset.fs:
    Rewrote this shader to write to css_MixColor instead of sampling u_texture and writing
    to gl_FragColor.
* platform/chromium-mac/css3/filters/custom/custom-filter-shader-cache-expected.png:
* platform/chromium-mac/css3/filters/custom/effect-color-check-expected.png:
* platform/chromium-mac/css3/filters/custom/effect-custom-combined-missing-expected.png:
* platform/chromium-mac/css3/filters/custom/effect-custom-expected.png:
* platform/chromium-mac/css3/filters/custom/effect-custom-parameters-expected.png:
* platform/chromium-mac/css3/filters/custom/filter-repaint-custom-clipped-expected.png:
* platform/chromium-mac/css3/filters/custom/filter-repaint-custom-expected.png:
* platform/chromium-mac/css3/filters/custom/filter-repaint-custom-rotated-expected.png:
* platform/chromium/TestExpectations:

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

34 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/filters/custom/custom-filter-css-keyword-as-parameter-name-expected.png
LayoutTests/css3/filters/custom/custom-filter-shader-cache-expected.png
LayoutTests/css3/filters/custom/custom-filter-shader-cache.html
LayoutTests/css3/filters/custom/effect-color-check-expected.png
LayoutTests/css3/filters/custom/effect-color-check.html
LayoutTests/css3/filters/custom/effect-custom-combined-missing-expected.png
LayoutTests/css3/filters/custom/effect-custom-combined-missing.html
LayoutTests/css3/filters/custom/effect-custom-expected.png
LayoutTests/css3/filters/custom/effect-custom-parameters-expected.png
LayoutTests/css3/filters/custom/effect-custom-parameters.html
LayoutTests/css3/filters/custom/effect-custom.html
LayoutTests/css3/filters/custom/filter-repaint-custom-clipped-expected.png
LayoutTests/css3/filters/custom/filter-repaint-custom-clipped.html
LayoutTests/css3/filters/custom/filter-repaint-custom-expected.png
LayoutTests/css3/filters/custom/filter-repaint-custom-rotated-expected.png
LayoutTests/css3/filters/custom/filter-repaint-custom-rotated.html
LayoutTests/css3/filters/custom/filter-repaint-custom.html
LayoutTests/css3/filters/custom/invalid-custom-filter-shader.html
LayoutTests/css3/filters/custom/missing-custom-filter-shader-expected.png
LayoutTests/css3/filters/custom/missing-custom-filter-shader.html
LayoutTests/css3/filters/resources/color-add.fs [deleted file]
LayoutTests/css3/filters/resources/color-fill.fs
LayoutTests/css3/filters/resources/color-offset-parameters.fs [deleted file]
LayoutTests/css3/filters/resources/color-offset.fs
LayoutTests/platform/chromium-mac/css3/filters/custom/custom-filter-shader-cache-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/effect-color-check-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-combined-missing-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-parameters-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-clipped-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-expected.png
LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-rotated-expected.png
LayoutTests/platform/chromium/TestExpectations

index 984f9a5..20e7083 100644 (file)
@@ -1,3 +1,67 @@
+2012-09-05  Max Vujovic  <mvujovic@adobe.com>
+
+        [CSS Shaders] Update custom filter tests to use the new security model
+        https://bugs.webkit.org/show_bug.cgi?id=95760
+
+        Reviewed by Dirk Schulze.
+
+        This patch updates the custom filter tests to not sample u_texture and not write
+        to gl_FragColor. Now, the tests use the new security model by writing to
+        css_MixColor and indirectly blending with the DOM element texture.
+
+        This patch prepares us to remove direct DOM texture access via "u_texture":
+        https://bugs.webkit.org/show_bug.cgi?id=93871
+
+        * css3/filters/custom/custom-filter-css-keyword-as-parameter-name-expected.png:
+        * css3/filters/custom/custom-filter-shader-cache-expected.png:
+        * css3/filters/custom/custom-filter-shader-cache.html:
+            Use the CSS mix function with the updated color-offset.fs.
+        * css3/filters/custom/effect-color-check-expected.png:
+        * css3/filters/custom/effect-color-check.html:
+            Use the CSS mix function with the updated color-fill.fs.
+        * css3/filters/custom/effect-custom-combined-missing-expected.png:
+        * css3/filters/custom/effect-custom-combined-missing.html:
+            Use the CSS mix function with the updated color-offset.fs.           
+        * css3/filters/custom/effect-custom-expected.png:
+        * css3/filters/custom/effect-custom-parameters-expected.png:
+        * css3/filters/custom/effect-custom-parameters.html:
+            Use the mix-color.fs shader instead of color-offset-parameters.fs.
+        * css3/filters/custom/effect-custom.html:
+            Use the CSS mix function with the updated color-offset.fs.
+        * css3/filters/custom/filter-repaint-custom-clipped-expected.png:
+        * css3/filters/custom/filter-repaint-custom-clipped.html:
+            Use the mix-color.fs shader instead of color-add.fs.
+        * css3/filters/custom/filter-repaint-custom-expected.png:
+        * css3/filters/custom/filter-repaint-custom-rotated-expected.png:
+        * css3/filters/custom/filter-repaint-custom-rotated.html:
+            Use the mix-color.fs shader instead of color-add.fs. Fix a small typo in a comment.
+        * css3/filters/custom/filter-repaint-custom.html:
+            Use the mix-color.fs shader instead of color-add.fs.
+        * css3/filters/custom/invalid-custom-filter-shader.html:
+            Use the CSS mix function with the updated color-offset.fs.
+        * css3/filters/custom/missing-custom-filter-shader-expected.png:
+        * css3/filters/custom/missing-custom-filter-shader.html:
+            Use the CSS mix function with the updated color-offset.fs.
+        * css3/filters/resources/color-add.fs:
+            Removed. The mix-color.fs shader can perform this shader's function.
+        * css3/filters/resources/color-fill.fs:
+            Rewrote this shader to write to css_MixColor instead of sampling u_texture and writing
+            to gl_FragColor.
+        * css3/filters/resources/color-offset-parameters.fs:
+            Removed. The mix-color.fs shader can perform this shader's function.
+        * css3/filters/resources/color-offset.fs:
+            Rewrote this shader to write to css_MixColor instead of sampling u_texture and writing
+            to gl_FragColor.
+        * platform/chromium-mac/css3/filters/custom/custom-filter-shader-cache-expected.png:
+        * platform/chromium-mac/css3/filters/custom/effect-color-check-expected.png:
+        * platform/chromium-mac/css3/filters/custom/effect-custom-combined-missing-expected.png:
+        * platform/chromium-mac/css3/filters/custom/effect-custom-expected.png:
+        * platform/chromium-mac/css3/filters/custom/effect-custom-parameters-expected.png:
+        * platform/chromium-mac/css3/filters/custom/filter-repaint-custom-clipped-expected.png:
+        * platform/chromium-mac/css3/filters/custom/filter-repaint-custom-expected.png:
+        * platform/chromium-mac/css3/filters/custom/filter-repaint-custom-rotated-expected.png:
+        * platform/chromium/TestExpectations:
+
 2012-09-05  Tommy Widenflycht  <tommyw@google.com>
 
         MediaStream API: Add the local and remote description functionality to RTCPeerConnection
index 0a8ba0c..81316ff 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/custom-filter-css-keyword-as-parameter-name-expected.png and b/LayoutTests/css3/filters/custom/custom-filter-css-keyword-as-parameter-name-expected.png differ
index c5167cd..dd3bd45 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/custom-filter-shader-cache-expected.png and b/LayoutTests/css3/filters/custom/custom-filter-shader-cache-expected.png differ
index f3cc6f9..e3a0ab5 100644 (file)
             }
             .fragment_shader
             {
-                -webkit-filter: custom(url('../resources/pass-tex-coord.vs') url('../resources/color-offset.fs'));
+                -webkit-filter: custom(url('../resources/pass-tex-coord.vs') mix(url('../resources/color-offset.fs') normal source-atop));
             }
             .both_shaders
             {
-                -webkit-filter: custom(url('../resources/vertex-offset.vs') url('../resources/color-offset.fs'));
+                -webkit-filter: custom(url('../resources/vertex-offset.vs') mix(url('../resources/color-offset.fs') normal source-atop));
             }
         </style>
     </head>
index 0617a17..5a28df6 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/effect-color-check-expected.png and b/LayoutTests/css3/filters/custom/effect-color-check-expected.png differ
index 01499fa..080d37b 100644 (file)
         </script>
     </head>
     <body onload="runTest()">
-        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') url('../resources/color-fill.fs'), color 1 0 0 1)" src="../../../compositing/resources/thiswayup.png">
-        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') url('../resources/color-fill.fs'), color 0 1 0 1)" src="../../../compositing/resources/thiswayup.png">
-        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') url('../resources/color-fill.fs'), color 0 0 1 1)" src="../../../compositing/resources/thiswayup.png">
+        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') mix(url('../resources/color-fill.fs') normal source-atop), color 1 0 0 1)" src="../../../compositing/resources/thiswayup.png">
+        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') mix(url('../resources/color-fill.fs') normal source-atop), color 0 1 0 1)" src="../../../compositing/resources/thiswayup.png">
+        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') mix(url('../resources/color-fill.fs') normal source-atop), color 0 0 1 1)" src="../../../compositing/resources/thiswayup.png">
         <!--
             Testing that the color channels are specified correctly. You should see 3 boxes filled with red, green and blue. The arrow should
-            point upside and the text should be written from left to right (no mirror). Also the gradient starts from up - transparent to down - full color.
+            point upward and the text should be written from left to right (no mirror). Also the gradient starts from up - no color to down - full color.
             Note: WebGL needs to be enabled for this test to succeed.
         -->
     </body>
index 4107129..d34dc47 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/effect-custom-combined-missing-expected.png and b/LayoutTests/css3/filters/custom/effect-custom-combined-missing-expected.png differ
index de819a5..9b7f1cb 100644 (file)
@@ -24,9 +24,9 @@
             height: 90px;
         }
         .filterA {
-            -webkit-filter: custom(url('../resources/vertex-offset.vs') url('../resources/color-offset.fs'))
-                            custom(url('../resources/missing-vertex-offset.vs') url('../resources/missing-color-offset.fs'))
-                            custom(url('../resources/vertex-offset.vs') url('../resources/color-offset.fs'));
+            -webkit-filter: custom(url('../resources/vertex-offset.vs') mix(url('../resources/color-offset.fs') normal source-atop))
+                            custom(url('../resources/missing-vertex-offset.vs') mix(url('../resources/missing-color-offset.fs') normal source-atop))
+                            custom(url('../resources/vertex-offset.vs') mix(url('../resources/color-offset.fs') normal source-atop));
         }
         </style>
     </head>
@@ -35,8 +35,9 @@
             <img class='filterA' src="../resources/reference.png">
         </div>
         <!--
-            Testing that multiple filters can be applied even if some filters cannot be loaded. You should see a washed out block of colored bars on top of green background. 
-            There should be two columns at the left of the block with different shades of green.
+            Testing that multiple filters can be applied even if some filters cannot be loaded.
+            You should see a rectangle with a washed out block of colored bars on top of green background.
+            There should be a green column left of the block spanning 20% of the rectangle's width.
         -->
     </body>
 </html>
index c914a71..ce78c4d 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/effect-custom-expected.png and b/LayoutTests/css3/filters/custom/effect-custom-expected.png differ
index 5447162..fff74c7 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/effect-custom-parameters-expected.png and b/LayoutTests/css3/filters/custom/effect-custom-parameters-expected.png differ
index 435a7e1..2a07a2e 100644 (file)
         <style>
         /* Testing parameters of type float, vec2 and vec3 in vertex-offset-parameters.vs and vec4 in color-offset-parameters.fs. */
         .filterA {
-            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') url('../resources/color-offset-parameters.fs'), 
+            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') mix(url('../resources/mix-color.fs') normal source-atop),
                                    perspective 2, 
                                    vertex_offset -0.05 0.1,
                                    rotate 45 -25 -10, 
-                                   color_offset 0.4 0.2 0.5 0.1);
+                                   mix_color 0.4 0.2 0.5 0.5);
         }
         .filterB {
-            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') url('../resources/color-offset-parameters.fs'), 
+            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') mix(url('../resources/mix-color.fs') normal source-atop),
                                    rotate 45 25 -10,
                                    perspective 10, 
                                    vertex_offset -0.05 0.1,
-                                   color_offset 0.1 0.9 0.5 -0.5);
+                                   mix_color 0.1 0.9 0.5 0.5);
         }
         .filterC {
-            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') url('../resources/color-offset-parameters.fs'), 
-                                   color_offset 0 0 0 0,
+            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') mix(url('../resources/mix-color.fs') normal source-atop),
+                                   mix_color 0 0 0 0.5,
                                    perspective 2, 
                                    vertex_offset -0.05 0.1,
                                    rotate 45 -25 -10);
         }
         .filterD {
-            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') url('../resources/color-offset-parameters.fs'), 
+            -webkit-filter: custom(url('../resources/vertex-offset-parameters.vs') mix(url('../resources/mix-color.fs') normal source-atop),
                                    vertex_offset -0.15 0.1,
                                    rotate 15 -45 10,
                                    perspective 1.5, 
-                                   color_offset 0.4 0.2 0.5 0.1);
+                                   mix_color 0.4 0.2 0.5 0.5);
         }
         </style>
     </head>
index a5c5554..a01e56a 100644 (file)
         </script>
     </head>
     <body onload="runTest()">
-        <img style="-webkit-filter: custom(url('../resources/vertex-offset.vs') url('../resources/color-offset.fs'))" src="../resources/reference.png">
+        <img style="-webkit-filter: custom(url('../resources/vertex-offset.vs') mix(url('../resources/color-offset.fs') normal source-atop))" src="../resources/reference.png">
         <img style="-webkit-filter: custom(url('../resources/vertex-offset.vs') mix(url('../resources/empty-shader.fs') normal source-atop), 6 11)" src="../resources/reference.png">
         <img style="-webkit-filter: custom(url('../resources/vertex-explode-detached.vs') mix(url('../resources/empty-shader.fs') normal source-atop), 3 3 detached)" src="../resources/reference.png">
-        <img style="-webkit-filter: custom(url('../resources/vertex-explode-detached.vs') url('../resources/color-offset.fs'), 3 3 detached)" src="../resources/reference.png">
-        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') url('../resources/color-offset.fs'))" src="../resources/reference.png">
+        <img style="-webkit-filter: custom(url('../resources/vertex-explode-detached.vs') mix(url('../resources/color-offset.fs') normal source-atop), 3 3 detached)" src="../resources/reference.png">
+        <img style="-webkit-filter: custom(url('../resources/pass-tex-coord.vs') mix(url('../resources/color-offset.fs') normal source-atop))" src="../resources/reference.png">
         <!--
             Testing that simple custom filters work in software mode. You should see 5 blocks of colored bars with different effects applied, from left to right: 
             offset to the right with washed out colors, just offset to the right with normal colors, 4 smaller blocks attached to the corners, 4 smaller blocks 
index a582125..35a48e2 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/filter-repaint-custom-clipped-expected.png and b/LayoutTests/css3/filters/custom/filter-repaint-custom-clipped-expected.png differ
index ca64d2d..2f92cc1 100644 (file)
@@ -41,7 +41,7 @@
         }
 
         .shader {
-            -webkit-filter: custom(url(../resources/vertex-horizontal-offset.vs) url(../resources/color-add.fs), offset -0.5, add 0.1);
+            -webkit-filter: custom(url(../resources/vertex-horizontal-offset.vs) mix(url(../resources/mix-color.fs) normal source-atop), offset -0.5, mix_color 1.0 1.0 1.0 0.1);
         }
     </style>
 
index 0d4c885..00736b0 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/filter-repaint-custom-expected.png and b/LayoutTests/css3/filters/custom/filter-repaint-custom-expected.png differ
index d3b8592..37f9690 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/filter-repaint-custom-rotated-expected.png and b/LayoutTests/css3/filters/custom/filter-repaint-custom-rotated-expected.png differ
index 3c0291b..ae7417e 100644 (file)
@@ -2,7 +2,7 @@
 <!-- 
     This tests verifies that filter shader is repainted using the full source image of the element instead of just the dirty area.
     Also it tests that the clipping or the transform rectangle of the box is not affecting the filter.
-    There should be one light green boxes on the screen. No red should be visible.
+    There should be one light green box on the screen. No red should be visible.
 -->
 <html>
 <head>
@@ -41,7 +41,7 @@
         }
 
         .shader {
-            -webkit-filter: custom(url(../resources/vertex-horizontal-offset.vs) url(../resources/color-add.fs), offset -0.5, add 0.1);
+            -webkit-filter: custom(url(../resources/vertex-horizontal-offset.vs) mix(url(../resources/mix-color.fs) normal source-atop), offset -0.5, mix_color 1.0 1.0 1.0 0.1);
             -webkit-transform-origin: 50px 50px;
             -webkit-transform: rotate(90deg);
         }
index d0af8de..96fa38f 100644 (file)
@@ -32,7 +32,7 @@
         .shader {
             border-top: 50px solid blue;
             width: 50px;
-            -webkit-filter: custom(url(../resources/vertex-rotate.vs) url(../resources/color-add.fs), rotateBy 90, add 0.1);
+            -webkit-filter: custom(url(../resources/vertex-rotate.vs) mix(url(../resources/mix-color.fs) normal source-atop), rotateBy 90, mix_color 1.0 1.0 1.0 0.1);
         }
     </style>
 
index 9c9c598..2df1f69 100644 (file)
             }
             .invalid_fragment_shader
             {
-                -webkit-filter: custom(none url('../resources/invalid-shader.vs'));
+                -webkit-filter: custom(none mix(url('../resources/invalid-shader.vs') normal source-atop));
             }
             .both_shaders_but_invalid_vertex_shader
             {
-                -webkit-filter: custom(url('../resources/invalid-shader.vs') url('../resources/color-offset.fs'));
+                -webkit-filter: custom(url('../resources/invalid-shader.vs') mix(url('../resources/color-offset.fs') normal source-atop));
             }
 
             .both_shaders_but_invalid_fragment_shader
             {
-                -webkit-filter: custom(url('../resources/vertex-offset.vs') url('../resources/invalid-shader.vs'));
+                -webkit-filter: custom(url('../resources/vertex-offset.vs') mix(url('../resources/invalid-shader.vs') normal source-atop));
             }
             .both_shaders_invalid
             {
-                -webkit-filter: custom(url('../resources/invalid-shader.vs') url('../resources/invalid-shader.vs'));
+                -webkit-filter: custom(url('../resources/invalid-shader.vs') mix(url('../resources/invalid-shader.vs') normal-source-atop));
             }
         </style>
     </head>
index 1bb4852..cc54362 100644 (file)
Binary files a/LayoutTests/css3/filters/custom/missing-custom-filter-shader-expected.png and b/LayoutTests/css3/filters/custom/missing-custom-filter-shader-expected.png differ
index 66583fb..1a2a706 100644 (file)
             }
             .missing_fragment_shader
             {
-                -webkit-filter: custom(none url('../resources/missing-color-offset.fs'));
+                -webkit-filter: custom(none mix(url('../resources/missing-color-offset.fs') normal source-atop));
             }
             .both_shaders_but_missing_vertex_shader
             {
-                -webkit-filter: custom(url('../resources/missing-vertex-offset.vs') url('../resources/color-offset.fs'));
+                -webkit-filter: custom(url('../resources/missing-vertex-offset.vs') mix(url('../resources/color-offset.fs') normal source-atop));
             }
 
             .both_shaders_but_missing_fragment_shader
             {
-                -webkit-filter: custom(url('../resources/vertex-offset.vs') url('../resources/missing-color-offset.fs'));
+                -webkit-filter: custom(url('../resources/vertex-offset.vs') mix(url('../resources/missing-color-offset.fs') normal source-atop));
             }
             .both_shaders_missing
             {
-                -webkit-filter: custom(url('../resources/missing-vertex-offset.vs') url('../resources/missing-color-offset.fs'));
+                -webkit-filter: custom(url('../resources/missing-vertex-offset.vs') mix(url('../resources/missing-color-offset.fs') normal source-atop));
             }
         </style>
     </head>
diff --git a/LayoutTests/css3/filters/resources/color-add.fs b/LayoutTests/css3/filters/resources/color-add.fs
deleted file mode 100644 (file)
index 151d741..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-precision mediump float;
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
-uniform float add;
-
-void main()
-{
-    // Offset the color value with "add" on each color channel.
-    vec4 sourceColor = texture2D(u_texture, v_texCoord);
-    gl_FragColor = vec4(sourceColor.xyz + add, sourceColor.a);
-}
index 182bdb8..7e42bed 100644 (file)
@@ -1,12 +1,10 @@
 precision mediump float;
 uniform vec4 color;
 varying vec2 v_texCoord;
-uniform sampler2D u_texture;
 void main()
 {
-    vec4 sourceColor = texture2D(u_texture, v_texCoord);
-    // Note that gl_FragColor and sourceColor are unmultiplied.
-    // Multiply the texture with the color specified as an uniform. Also apply a 
-    // gradient to check for the right direction. The result should be transparent on top.
-    gl_FragColor = vec4(sourceColor.xyz * color.xyz, sourceColor.a * color.a * v_texCoord.y);
+    // Mix the texture with the color specified as an uniform.
+    // Also apply a gradient to check for the right direction.
+    // The color should be lightest at the top and darkest at the bottom.
+    css_MixColor = vec4(color.xyz, color.a * v_texCoord.y);
 }
diff --git a/LayoutTests/css3/filters/resources/color-offset-parameters.fs b/LayoutTests/css3/filters/resources/color-offset-parameters.fs
deleted file mode 100644 (file)
index b071d81..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-precision mediump float;
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
-uniform vec4 color_offset;
-
-void main()
-{
-    // Offset the color value using the uniform parameter that we get from CSS.
-    gl_FragColor = texture2D(u_texture, v_texCoord) + color_offset;
-}
index a1ce2d5..b20acc7 100644 (file)
@@ -1,8 +1,6 @@
 precision mediump float;
-varying vec2 v_texCoord;
-uniform sampler2D u_texture;
 void main()
 {
-    // Offset the color value with 0.3 on each color channel.
-    gl_FragColor = texture2D(u_texture, v_texCoord) + 0.3;
+    // Mix some white with the DOM element texture.
+    css_MixColor = vec4(1.0, 1.0, 1.0, 0.5);
 }
index 90225f0..a96847f 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/custom-filter-shader-cache-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/custom-filter-shader-cache-expected.png differ
index fba21f7..da72fa8 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-color-check-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-color-check-expected.png differ
index 4196a66..c2b0377 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-combined-missing-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-combined-missing-expected.png differ
index 10b8961..d5cf3e7 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-expected.png differ
index acd1fae..39bf973 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-parameters-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/effect-custom-parameters-expected.png differ
index 4213bb9..b27e561 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-clipped-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-clipped-expected.png differ
index 2afdc45..836cedf 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-expected.png differ
index d8e1681..ddce9de 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-rotated-expected.png and b/LayoutTests/platform/chromium-mac/css3/filters/custom/filter-repaint-custom-rotated-expected.png differ
index 61ce393..48a2358 100644 (file)
@@ -3430,6 +3430,14 @@ BUGWK94256 DEBUG : fast/block/inline-children-root-linebox-crash.html = PASS CRA
 // Following tests need baselines on Win and Linux 
 BUGWK94492 WIN LINUX : css3/filters/custom/custom-filter-color-matrix.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
 BUGWK94492 WIN LINUX : css3/filters/custom/custom-filter-composite-source-atop.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/custom-filter-shader-cache.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/effect-color-check.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/effect-custom-combined-missing.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/effect-custom.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/effect-custom-parameters.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/filter-repaint-custom-clipped.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/filter-repaint-custom.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
+BUGWK94492 WIN LINUX : css3/filters/custom/filter-repaint-custom-rotated.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
 
 // Flaky
 BUGWK95246 : http/tests/security/mixedContent/filesystem-url-in-iframe.html = PASS TEXT