Bug 94020 - [CSS Shaders] Change the default compositing mode and the default CSS value for <fragmentShader>
Summary: [CSS Shaders] Change the default compositing mode and the default CSS value f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michelangelo De Simone
URL:
Keywords:
Depends on:
Blocks: 71392
  Show dependency treegraph
 
Reported: 2012-08-14 13:58 PDT by Max Vujovic
Modified: 2012-10-30 04:24 PDT (History)
10 users (show)

See Also:


Attachments
Patatch not for formal review (33.13 KB, patch)
2012-10-29 13:55 PDT, Michelangelo De Simone
no flags Details | Formatted Diff | Diff
Patch (52.43 KB, patch)
2012-10-29 16:09 PDT, Michelangelo De Simone
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Vujovic 2012-08-14 13:58:26 PDT
The spec has changed:
- The default compositing mode is now source-atop, not source-over.
- The default value for fragmentShader is now "mix(<default-fragment-shader> normal source-atop)", not "<default-fragment-shader>".

https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#fragmentShader-attribute
Comment 1 Michelangelo De Simone 2012-10-29 13:55:16 PDT
Created attachment 171304 [details]
Patatch not for formal review
Comment 2 Max Vujovic 2012-10-29 14:06:54 PDT
Comment on attachment 171304 [details]
Patatch not for formal review

Thanks for the patch! A couple of comments:

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

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:924
> +                if (program->programType() == PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE) {

To avoid nesting this if statement, we could do something like:

if (!program->fragmentShader()) {
    shadersList->append(cssValuePool().createIdentifierValue(CSSValueNone));
} else if (program->programType() == PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE) {
    ...
} else {
    shadersList->append(program->fragmentShader()->cssValue());
}

It looks prettier, but it might be less clear than the original, so I'm not sure.

> Source/WebCore/css/StyleResolver.cpp:4780
> +    unsigned shadersListLength = shadersList->length();

Don't extract this into a local var unless you use it twice.

> Source/WebCore/css/StyleResolver.cpp:4788
> +    programType = PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE;

Set this default value when you declare the local var programType.

> LayoutTests/css3/filters/resources/empty-shader.fs:-1
> -void main()

Nice. It's good we don't need this shader anymore.
Comment 3 WebKit Review Bot 2012-10-29 14:47:43 PDT
Comment on attachment 171304 [details]
Patatch not for formal review

Attachment 171304 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14627279

New failing tests:
css3/filters/custom/custom-filter-property-computed-style.html
Comment 4 Michelangelo De Simone 2012-10-29 14:50:44 PDT
(In reply to comment #2)

> > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:924
> > +                if (program->programType() == PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE) {
> To avoid nesting this if statement, we could do something like:
> 
> if (!program->fragmentShader()) {
>     shadersList->append(cssValuePool().createIdentifierValue(CSSValueNone));
> } else if (program->programType() == PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE) {
>     ...
> } else {
>     shadersList->append(program->fragmentShader()->cssValue());
> }
> 
> It looks prettier, but it might be less clear than the original, so I'm not sure.

Neither am I. I'll leave it as it is for now, waiting for other feedbacks.

> > Source/WebCore/css/StyleResolver.cpp:4780
> > +    unsigned shadersListLength = shadersList->length();
> Don't extract this into a local var unless you use it twice.

It is indeed (assert and branch), that's the reason why I changed it.

> Set this default value when you declare the local var programType.

Oops, my fault, I just forgot it there.:)

> > LayoutTests/css3/filters/resources/empty-shader.fs:-1
> > -void main()
> Nice. It's good we don't need this shader anymore.

Getting rid of old stuff is always nice.:)
Comment 5 Michelangelo De Simone 2012-10-29 16:09:16 PDT
Created attachment 171332 [details]
Patch
Comment 6 WebKit Review Bot 2012-10-30 04:24:11 PDT
Comment on attachment 171332 [details]
Patch

Clearing flags on attachment: 171332

Committed r132892: <http://trac.webkit.org/changeset/132892>
Comment 7 WebKit Review Bot 2012-10-30 04:24:15 PDT
All reviewed patches have been landed.  Closing bug.