Changeset 142190 in webkit


Ignore:
Timestamp:
Feb 7, 2013 3:32:53 PM (11 years ago)
Author:
Michelangelo De Simone
Message:

[CSS Shaders] Add the last blending step
https://bugs.webkit.org/show_bug.cgi?id=104012

Source/WebCore:

The resulting blended color in mix() is now weighted according to
the original element's backdrop alpha value.

Reviewed by Dean Jackson.

Test: css3/filters/custom/custom-filter-blend-fractional-destination-alpha.html

  • platform/graphics/filters/CustomFilterValidatedProgram.cpp:

(WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader):

LayoutTests:

Added a test to check the correct blending in presence of a transparent backdrop.

Reviewed by Dean Jackson.

  • css3/filters/custom/custom-filter-blend-fractional-destination-alpha-expected.html: Added.
  • css3/filters/custom/custom-filter-blend-fractional-destination-alpha.html: Added.
  • platform/mac/TestExpectations: This test is currently skipped on Mac for slight color

differences, please see the relevant bug: http://webkit.org/b/107487

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142187 r142190  
     12013-02-07  Michelangelo De Simone  <michelangelo@webkit.org>
     2
     3        [CSS Shaders] Add the last blending step
     4        https://bugs.webkit.org/show_bug.cgi?id=104012
     5
     6        Added a test to check the correct blending in presence of a transparent backdrop.
     7
     8        Reviewed by Dean Jackson.
     9
     10        * css3/filters/custom/custom-filter-blend-fractional-destination-alpha-expected.html: Added.
     11        * css3/filters/custom/custom-filter-blend-fractional-destination-alpha.html: Added.
     12        * platform/mac/TestExpectations: This test is currently skipped on Mac for slight color
     13        differences, please see the relevant bug: http://webkit.org/b/107487
     14
    1152013-02-07  Hans Muller  <hmuller@adobe.com>
    216
  • trunk/LayoutTests/platform/mac/TestExpectations

    r142167 r142190  
    945945css3/filters/composited-during-transition-layertree.html
    946946
     947# --- Custom Filters ---
     948# This test is currently skipped on Mac for slight color differences, please see the relevant bug: http://webkit.org/b/107487
     949webkit.org/b/107487 css3/filters/custom/custom-filter-blend-fractional-destination-alpha.html [ Skip ]
     950
    947951# --- Text ---
    948952fast/forms/text-control-intrinsic-widths.html
  • trunk/Source/WebCore/ChangeLog

    r142189 r142190  
     12013-02-07  Michelangelo De Simone  <michelangelo@webkit.org>
     2
     3        [CSS Shaders] Add the last blending step
     4        https://bugs.webkit.org/show_bug.cgi?id=104012
     5
     6        The resulting blended color in mix() is now weighted according to
     7        the original element's backdrop alpha value.
     8
     9        Reviewed by Dean Jackson.
     10
     11        Test: css3/filters/custom/custom-filter-blend-fractional-destination-alpha.html
     12
     13        * platform/graphics/filters/CustomFilterValidatedProgram.cpp:
     14        (WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader):
     15
    1162013-02-07  Benjamin Poulain  <bpoulain@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp

    r136430 r142190  
    277277            mediump vec4 multipliedColor = clamp(css_ColorMatrix * originalColor, 0.0, 1.0);
    278278            mediump vec3 blendedColor = css_BlendColor(multipliedColor.rgb, css_MixColor.rgb);
    279             gl_FragColor = css_Composite(multipliedColor.rgb, multipliedColor.a, blendedColor.rgb, css_MixColor.a);
     279            mediump vec3 weightedColor = (1.0 - multipliedColor.a) * css_MixColor.rgb + multipliedColor.a * blendedColor;
     280            gl_FragColor = css_Composite(multipliedColor.rgb, multipliedColor.a, weightedColor.rgb, css_MixColor.a);
    280281        }
    281282    ));
Note: See TracChangeset for help on using the changeset viewer.