Diff
Modified: trunk/LayoutTests/ChangeLog (132415 => 132416)
--- trunk/LayoutTests/ChangeLog 2012-10-24 23:00:00 UTC (rev 132415)
+++ trunk/LayoutTests/ChangeLog 2012-10-24 23:01:30 UTC (rev 132416)
@@ -1,3 +1,20 @@
+2012-10-24 Max Vujovic <[email protected]>
+
+ [CSS Shaders] The mesh should be specified using <column, row> order
+ https://bugs.webkit.org/show_bug.cgi?id=96285
+
+ Reviewed by Dean Jackson.
+
+ Add a test verifying that WebKit interprets the CSS mesh values in column, row order.
+ Update existing tests for u_meshSize and u_tileSize to expect column, row order.
+
+ * css3/filters/custom/custom-filter-mesh-column-row-order-expected.html: Added.
+ * css3/filters/custom/custom-filter-mesh-column-row-order.html: Added.
+ * css3/filters/resources/checkerboard.vs: Added.
+ * css3/filters/resources/u-mesh-size.fs:
+ * css3/filters/resources/u-tile-size.fs:
+ * css3/filters/resources/varying-mix-color.fs: Added.
+
2012-10-24 Tony Chang <[email protected]>
[chromium] Unreviewed, land pixel results on Win/Mac for a new repaint test.
Added: trunk/LayoutTests/css3/filters/custom/custom-filter-mesh-column-row-order-expected.html (0 => 132416)
--- trunk/LayoutTests/css3/filters/custom/custom-filter-mesh-column-row-order-expected.html (rev 0)
+++ trunk/LayoutTests/css3/filters/custom/custom-filter-mesh-column-row-order-expected.html 2012-10-24 23:01:30 UTC (rev 132416)
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+<head>
+ <title>Test that in CSS, the vertex mesh dimensions are specified in column, row order.</title>
+ <!--
+ This is the reference file for the test.
+ If the test passes, you should see a checkboard with 2 columns and 4 rows of black and green squares.
+ -->
+ <style>
+ body {
+ width: 100px;
+ }
+ div {
+ float: left;
+ width: 50px;
+ height: 50px;
+ }
+ div:nth-child(4n), div:nth-child(4n+1) { background-color: #000 }
+ div:nth-child(4n+2), div:nth-child(4n+3) { background-color: #0f0 }
+ </style>
+</head>
+<body>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</body>
+</html>
Added: trunk/LayoutTests/css3/filters/custom/custom-filter-mesh-column-row-order.html (0 => 132416)
--- trunk/LayoutTests/css3/filters/custom/custom-filter-mesh-column-row-order.html (rev 0)
+++ trunk/LayoutTests/css3/filters/custom/custom-filter-mesh-column-row-order.html 2012-10-24 23:01:30 UTC (rev 132416)
@@ -0,0 +1,33 @@
+<!doctype html>
+<html>
+<head>
+ <title>Test that in CSS, the vertex mesh dimensions are specified in column, row order.</title>
+ <!-- If the test passes, you should see a checkboard with 2 columns and 4 rows of black and green squares. -->
+ <script>
+ if (window.testRunner) {
+ window.testRunner.overridePreference("WebKitCSSCustomFilterEnabled", "1");
+ window.testRunner.overridePreference("WebKitWebGLEnabled", "1");
+ window.testRunner.waitUntilDone();
+ }
+
+ function runTest()
+ {
+ // We need to run the tests after the shaders download.
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ }
+ </script>
+ <style>
+ #filter-target {
+ position: absolute;
+ width: 100px;
+ height: 200px;
+ background-color: red;
+ -webkit-filter: custom(url(../resources/checkerboard.vs) mix(url(../resources/varying-mix-color.fs) normal source-atop), 2 4 detached);
+ }
+ </style>
+</head>
+<body _onload_="runTest()">
+ <div id="filter-target"></div>
+</body>
+</html>
Added: trunk/LayoutTests/css3/filters/resources/checkerboard.vs (0 => 132416)
--- trunk/LayoutTests/css3/filters/resources/checkerboard.vs (rev 0)
+++ trunk/LayoutTests/css3/filters/resources/checkerboard.vs 2012-10-24 23:01:30 UTC (rev 132416)
@@ -0,0 +1,18 @@
+// This shader colors alternating tiles in the mesh black or green to create a checkboard pattern.
+
+precision mediump float;
+precision mediump int;
+
+attribute vec4 a_position;
+attribute vec3 a_triangleCoord;
+
+uniform mat4 u_projectionMatrix;
+
+varying vec4 v_mixColor;
+
+void main()
+{
+ float green = mod(a_triangleCoord.x + a_triangleCoord.y, 2.0);
+ v_mixColor = vec4(0.0, green, 0.0, 1.0);
+ gl_Position = u_projectionMatrix * a_position;
+}
Modified: trunk/LayoutTests/css3/filters/resources/u-mesh-size.fs (132415 => 132416)
--- trunk/LayoutTests/css3/filters/resources/u-mesh-size.fs 2012-10-24 23:00:00 UTC (rev 132415)
+++ trunk/LayoutTests/css3/filters/resources/u-mesh-size.fs 2012-10-24 23:01:30 UTC (rev 132416)
@@ -15,5 +15,5 @@
void main()
{
- gl_FragColor = areVectorsEqual(u_meshSize, vec2(20.0, 10.0)) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = areVectorsEqual(u_meshSize, vec2(10.0, 20.0)) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
}
Modified: trunk/LayoutTests/css3/filters/resources/u-tile-size.fs (132415 => 132416)
--- trunk/LayoutTests/css3/filters/resources/u-tile-size.fs 2012-10-24 23:00:00 UTC (rev 132415)
+++ trunk/LayoutTests/css3/filters/resources/u-tile-size.fs 2012-10-24 23:01:30 UTC (rev 132416)
@@ -15,5 +15,5 @@
void main()
{
- gl_FragColor = areVectorsEqual(u_tileSize, vec2(0.05, 0.10)) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = areVectorsEqual(u_tileSize, vec2(1.0 / 10.0, 1.0 / 20.0)) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
}
Added: trunk/LayoutTests/css3/filters/resources/varying-mix-color.fs (0 => 132416)
--- trunk/LayoutTests/css3/filters/resources/varying-mix-color.fs (rev 0)
+++ trunk/LayoutTests/css3/filters/resources/varying-mix-color.fs 2012-10-24 23:01:30 UTC (rev 132416)
@@ -0,0 +1,8 @@
+precision mediump float;
+
+varying vec4 v_mixColor;
+
+void main()
+{
+ css_MixColor = v_mixColor;
+}
Modified: trunk/Source/WebCore/ChangeLog (132415 => 132416)
--- trunk/Source/WebCore/ChangeLog 2012-10-24 23:00:00 UTC (rev 132415)
+++ trunk/Source/WebCore/ChangeLog 2012-10-24 23:01:30 UTC (rev 132416)
@@ -1,3 +1,23 @@
+2012-10-24 Max Vujovic <[email protected]>
+
+ [CSS Shaders] The mesh should be specified using <column, row> order
+ https://bugs.webkit.org/show_bug.cgi?id=96285
+
+ Reviewed by Dean Jackson.
+
+ Change StyleResolver and CSSComputedStyleDeclaration to handle the mesh parameters in
+ column, row order.
+
+ Test: css3/filters/custom/custom-filter-mesh-column-row-order.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::valueForFilter):
+ Append the number of columns before the number of rows in the meshParameters
+ CSSValueList.
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::createCustomFilterOperation):
+ Store the second mesh parameter in meshRows instead of meshColumns.
+
2012-10-24 Jae Hyun Park <[email protected]>
loaderRunLoop() should use synchronization instead of while loop
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (132415 => 132416)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2012-10-24 23:00:00 UTC (rev 132415)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2012-10-24 23:01:30 UTC (rev 132416)
@@ -935,8 +935,8 @@
filterValue->append(shadersList.release());
RefPtr<CSSValueList> meshParameters = CSSValueList::createSpaceSeparated();
+ meshParameters->append(cssValuePool().createValue(customOperation->meshColumns(), CSSPrimitiveValue::CSS_NUMBER));
meshParameters->append(cssValuePool().createValue(customOperation->meshRows(), CSSPrimitiveValue::CSS_NUMBER));
- meshParameters->append(cssValuePool().createValue(customOperation->meshColumns(), CSSPrimitiveValue::CSS_NUMBER));
meshParameters->append(cssValuePool().createValue(customOperation->meshBoxType()));
// FIXME: The specification doesn't have any "attached" identifier. Should we add one?
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (132415 => 132416)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2012-10-24 23:00:00 UTC (rev 132415)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2012-10-24 23:01:30 UTC (rev 132416)
@@ -4816,14 +4816,14 @@
if (primitiveValue->isNumber()) {
// If only one integer value is specified, it will set both
// the rows and the columns.
- meshRows = meshColumns = primitiveValue->getIntValue();
+ meshColumns = meshRows = primitiveValue->getIntValue();
iterator.advance();
- // Try to match another number for the columns.
+ // Try to match another number for the rows.
if (iterator.hasMore() && iterator.isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());
if (primitiveValue->isNumber()) {
- meshColumns = primitiveValue->getIntValue();
+ meshRows = primitiveValue->getIntValue();
iterator.advance();
}
}