Bug 96285 - [CSS Shaders] The mesh should be specified using <column, row> order
Summary: [CSS Shaders] The mesh should be specified using <column, row> order
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Max Vujovic
URL:
Keywords:
Depends on:
Blocks: 71392
  Show dependency treegraph
 
Reported: 2012-09-10 10:07 PDT by Alexandru Chiculita
Modified: 2012-10-24 16:01 PDT (History)
7 users (show)

See Also:


Attachments
Patch (9.09 KB, patch)
2012-10-22 16:50 PDT, Max Vujovic
no flags Details | Formatted Diff | Diff
Patch (9.20 KB, patch)
2012-10-23 11:55 PDT, Max Vujovic
no flags Details | Formatted Diff | Diff
Patch (9.21 KB, patch)
2012-10-23 13:44 PDT, Max Vujovic
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Chiculita 2012-09-10 10:07:57 PDT
The spec says the mesh is defined using <column, row> and not <row, column>. Update the implementation to match that.

https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#vertexMesh-attribute
Comment 1 Max Vujovic 2012-10-22 16:50:27 PDT
Created attachment 170027 [details]
Patch
Comment 2 Alexandru Chiculita 2012-10-23 09:40:19 PDT
Comment on attachment 170027 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170027&action=review

Looks good.

> LayoutTests/css3/filters/resources/discard-bottom-vertices.vs:13
> +	if (position.y > 0.0)

Why not use the a_triangleCoord.y instead?

> LayoutTests/css3/filters/resources/discard-bottom-vertices.vs:14
> +		position = vec4(-0.5);

nit: use 4 spaces for indentation.
nit: You are also setting the 3rd and 4th values to -0.5.

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:939
> -            meshParameters->append(cssValuePool().createValue(customOperation->meshRows(), CSSPrimitiveValue::CSS_NUMBER));
>              meshParameters->append(cssValuePool().createValue(customOperation->meshColumns(), CSSPrimitiveValue::CSS_NUMBER));
> +            meshParameters->append(cssValuePool().createValue(customOperation->meshRows(), CSSPrimitiveValue::CSS_NUMBER));

Add a test for the computed style.
Comment 3 Max Vujovic 2012-10-23 11:55:48 PDT
Created attachment 170203 [details]
Patch
Comment 4 Max Vujovic 2012-10-23 13:44:59 PDT
Created attachment 170226 [details]
Patch

Removed tab character from test.
Comment 5 Max Vujovic 2012-10-23 13:47:19 PDT
Comment on attachment 170027 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170027&action=review

>> LayoutTests/css3/filters/resources/discard-bottom-vertices.vs:13
>> +	if (position.y > 0.0)
> 
> Why not use the a_triangleCoord.y instead?

After our in-person discussion, I've changed the test to create a checkboard pattern by coloring the mesh tiles using a_triangleCoord. If the checkboard tiles are squares, the test passes. If not, the test fails.

>> LayoutTests/css3/filters/resources/discard-bottom-vertices.vs:14
>> +		position = vec4(-0.5);
> 
> nit: use 4 spaces for indentation.
> nit: You are also setting the 3rd and 4th values to -0.5.

nit 1: Thanks for catching that. My editor was misbehaving.
nit 2: The new test doesn't need to do that anymore.

>> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:939
>> +            meshParameters->append(cssValuePool().createValue(customOperation->meshRows(), CSSPrimitiveValue::CSS_NUMBER));
> 
> Add a test for the computed style.

This is already covered by the computed style tests. In computed style, we can only check that the order we input the mesh attributes is the order we output them. For example, we can only check that the mesh coords of "10 20" come back as "10 20". They're not labeled, so I can't test which one represents numColumns vs. numRows. However, the test I've added verifies the numColumns vs. numRows difference by rendering it.
Comment 6 Max Vujovic 2012-10-24 15:43:10 PDT
Thanks for the review, Dean!
Comment 7 WebKit Review Bot 2012-10-24 16:01:46 PDT
Comment on attachment 170226 [details]
Patch

Clearing flags on attachment: 170226

Committed r132416: <http://trac.webkit.org/changeset/132416>
Comment 8 WebKit Review Bot 2012-10-24 16:01:51 PDT
All reviewed patches have been landed.  Closing bug.