Changeset 127517 in webkit


Ignore:
Timestamp:
Sep 4, 2012 3:53:25 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Shaders] Implement multiply, screen, darken, lighten, difference, exclusion blend modes.
https://bugs.webkit.org/show_bug.cgi?id=93870

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

Source/WebCore:

Add expressions for the aforementioned blend modes. The expressions are lifted directly
from the CSS Compositing and Blending spec [1]. WebKit adds these blending expressions to
the author's shader.

[1]: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnormal

Test: css3/filters/custom/custom-filter-blend-modes.html

  • platform/graphics/filters/CustomFilterValidatedProgram.cpp:

(WebCore::CustomFilterValidatedProgram::blendFunctionString):

LayoutTests:

Add test to check that the DOM element texture blends correctly with the css_MixColor
variable from the author's shader for each blend mode.

  • css3/filters/custom/custom-filter-blend-modes-expected.html: Added.
  • css3/filters/custom/custom-filter-blend-modes.html: Added.
  • css3/filters/resources/mix-color.fs: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127513 r127517  
     12012-09-04  Max Vujovic  <mvujovic@adobe.com>
     2
     3        [CSS Shaders] Implement multiply, screen, darken, lighten, difference, exclusion blend modes.
     4        https://bugs.webkit.org/show_bug.cgi?id=93870
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Add test to check that the DOM element texture blends correctly with the css_MixColor
     9        variable from the author's shader for each blend mode.
     10
     11        * css3/filters/custom/custom-filter-blend-modes-expected.html: Added.
     12        * css3/filters/custom/custom-filter-blend-modes.html: Added.
     13        * css3/filters/resources/mix-color.fs: Added.
     14
    1152012-09-04  Jeffrey Pfau  <jpfau@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r127514 r127517  
     12012-09-04  Max Vujovic  <mvujovic@adobe.com>
     2
     3        [CSS Shaders] Implement multiply, screen, darken, lighten, difference, exclusion blend modes.
     4        https://bugs.webkit.org/show_bug.cgi?id=93870
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Add expressions for the aforementioned blend modes. The expressions are lifted directly
     9        from the CSS Compositing and Blending spec [1]. WebKit adds these blending expressions to
     10        the author's shader.
     11
     12        [1]: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnormal
     13
     14        Test: css3/filters/custom/custom-filter-blend-modes.html
     15
     16        * platform/graphics/filters/CustomFilterValidatedProgram.cpp:
     17        (WebCore::CustomFilterValidatedProgram::blendFunctionString):
     18
    1192012-09-04  Nikhil Bhargava  <nbhargava@google.com>
    220
  • trunk/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp

    r127217 r127517  
    174174        break;
    175175    case BlendModeMultiply:
     176        expression = "Cs * Cb";
     177        break;
    176178    case BlendModeScreen:
     179        expression = "Cb + Cs - (Cb * Cs)";
     180        break;
     181    case BlendModeDarken:
     182        expression = "min(Cb, Cs)";
     183        break;
     184    case BlendModeLighten:
     185        expression = "max(Cb, Cs)";
     186        break;
     187    case BlendModeDifference:
     188        expression = "abs(Cb - Cs)";
     189        break;
     190    case BlendModeExclusion:
     191        expression = "Cb + Cs - 2.0 * Cb * Cs";
     192        break;
    177193    case BlendModeOverlay:
    178     case BlendModeDarken:
    179     case BlendModeLighten:
    180194    case BlendModeColorDodge:
    181195    case BlendModeColorBurn:
    182196    case BlendModeHardLight:
    183197    case BlendModeSoftLight:
    184     case BlendModeDifference:
    185     case BlendModeExclusion:
    186198    case BlendModeHue:
    187199    case BlendModeSaturation:
Note: See TracChangeset for help on using the changeset viewer.