⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181191 in webkit


Ignore:
Timestamp:
Mar 6, 2015, 4:08:32 PM (11 years ago)
Author:
dino@apple.com
Message:

Support "plus-lighter" in mix-blend mode
https://bugs.webkit.org/show_bug.cgi?id=142416
<rdar://problem/19993979>

Reviewed by Darin Adler and Sam Weinig.

Source/WebCore:

Support the "plus-lighter" blending mode to CSS.
See my reply to: https://lists.w3.org/Archives/Public/public-fx/2015JanMar/0021.html

Test: css3/blending/svg-blend-plus-lighter.html

  • css/CSSParser.cpp:

(WebCore::isValidKeywordPropertyAndValue): mix-blend-mode can now accept the
new keyword.

  • css/CSSPrimitiveValueMappings.h: Add the mappings to/from the GraphicsType.

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator BlendMode):

  • css/CSSValueKeywords.in: Add comment to show plus-darker and plus-lighter

are available.

  • platform/graphics/GraphicsTypes.cpp: New GraphicsType for PlusLighter.
  • platform/graphics/GraphicsTypes.h:
  • platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Map to the CA filter.

(PlatformCAFilters::setBlendingFiltersOnLayer):

  • platform/graphics/cg/GraphicsContextCG.cpp:

(WebCore::GraphicsContext::setPlatformCompositeOperation): Map to the CG
blending flag.

Source/WebKit2:

Output the appropriate blending type when logging.

  • Shared/mac/RemoteLayerTreeTransaction.mm:

(WebKit::RemoteLayerTreeTextStream::operator<<):

LayoutTests:

Add tests and new expected results for plus-lighter.

  • css3/blending/blend-mode-property-parsing-expected.txt:
  • css3/blending/blend-mode-simple-composited.html:
  • css3/blending/blend-mode-simple.html:
  • css3/blending/script-tests/blend-mode-property-parsing.js:
  • css3/blending/svg-blend-plus-lighter.html: Added.
  • platform/mac/css3/blending/blend-mode-simple-composited-expected.png:
  • platform/mac/css3/blending/blend-mode-simple-composited-expected.txt:
  • platform/mac/css3/blending/blend-mode-simple-expected.png:
  • platform/mac/css3/blending/blend-mode-simple-expected.txt:
  • platform/mac/css3/blending/svg-blend-plus-lighter-expected.txt: Added.
Location:
trunk
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r181189 r181191  
     12015-03-06  Dean Jackson  <dino@apple.com>
     2
     3        Support "plus-lighter" in mix-blend mode
     4        https://bugs.webkit.org/show_bug.cgi?id=142416
     5        <rdar://problem/19993979>
     6
     7        Reviewed by Darin Adler and Sam Weinig.
     8
     9        Add tests and new expected results for plus-lighter.
     10
     11        * css3/blending/blend-mode-property-parsing-expected.txt:
     12        * css3/blending/blend-mode-simple-composited.html:
     13        * css3/blending/blend-mode-simple.html:
     14        * css3/blending/script-tests/blend-mode-property-parsing.js:
     15        * css3/blending/svg-blend-plus-lighter.html: Added.
     16        * platform/mac/css3/blending/blend-mode-simple-composited-expected.png:
     17        * platform/mac/css3/blending/blend-mode-simple-composited-expected.txt:
     18        * platform/mac/css3/blending/blend-mode-simple-expected.png:
     19        * platform/mac/css3/blending/blend-mode-simple-expected.txt:
     20        * platform/mac/css3/blending/svg-blend-plus-lighter-expected.txt: Added.
     21
    1222015-03-06  Brent Fulgham  <bfulgham@apple.com>
    223
  • trunk/LayoutTests/css3/blending/blend-mode-property-parsing-expected.txt

    r178710 r181191  
    108108PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
    109109PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
     110
     111Basic reference : plus-lighter
     112PASS cssRule.type is 1
     113PASS declaration.length is 1
     114PASS declaration.getPropertyValue('mix-blend-mode') is 'plus-lighter'
     115PASS jsWrapperClass(blendModeRule) is 'CSSPrimitiveValue'
     116PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
     117PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
    110118PASS successfullyParsed is true
    111119
  • trunk/LayoutTests/css3/blending/blend-mode-simple-composited.html

    r178710 r181191  
    3636        <li><img style="mix-blend-mode: exclusion" src="resources/ducky.png"></li>
    3737        <li><img style="mix-blend-mode: plus-darker" src="resources/ducky.png"></li>
     38        <li><img style="mix-blend-mode: plus-lighter" src="resources/ducky.png"></li>
    3839    </ul>
    3940</body>
  • trunk/LayoutTests/css3/blending/blend-mode-simple.html

    r178710 r181191  
    4040        <li><img style="mix-blend-mode: exclusion" src="resources/ducky.png"></li>
    4141        <li><img style="mix-blend-mode: plus-darker" src="resources/ducky.png"></li>
     42        <li><img style="mix-blend-mode: plus-lighter" src="resources/ducky.png"></li>
    4243    </ul>
    4344</body>
  • trunk/LayoutTests/css3/blending/script-tests/blend-mode-property-parsing.js

    r178710 r181191  
    4444}
    4545
    46 var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "plus-darker"];
     46var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "plus-darker", "plus-lighter"];
    4747
    4848for(x in blendmodes)
  • trunk/LayoutTests/platform/mac/css3/blending/blend-mode-simple-composited-expected.txt

    r178710 r181191  
    1818        RenderBlock (floating) {LI} at (185,285) size 130x130
    1919        RenderBlock (floating) {LI} at (325,285) size 130x130
     20        RenderBlock (floating) {LI} at (465,285) size 130x130
    2021layer at (53,21) size 130x130
    2122  RenderImage {IMG} at (0,0) size 130x130
     
    4445layer at (333,301) size 130x130 blendMode: plus-darker
    4546  RenderImage {IMG} at (0,0) size 130x130
     47layer at (473,301) size 130x130 blendMode: plus-lighter
     48  RenderImage {IMG} at (0,0) size 130x130
  • trunk/LayoutTests/platform/mac/css3/blending/blend-mode-simple-expected.txt

    r178710 r181191  
    1919        RenderBlock (floating) {LI} at (185,285) size 130x130
    2020        RenderBlock (floating) {LI} at (325,285) size 130x130
     21        RenderBlock (floating) {LI} at (465,285) size 130x130
    2122layer at (193,21) size 130x130 blendMode: overlay
    2223  RenderImage {IMG} at (0,0) size 130x130
     
    4344layer at (333,301) size 130x130 blendMode: plus-darker
    4445  RenderImage {IMG} at (0,0) size 130x130
     46layer at (473,301) size 130x130 blendMode: plus-lighter
     47  RenderImage {IMG} at (0,0) size 130x130
  • trunk/Source/WebCore/ChangeLog

    r181190 r181191  
     12015-03-06  Dean Jackson  <dino@apple.com>
     2
     3        Support "plus-lighter" in mix-blend mode
     4        https://bugs.webkit.org/show_bug.cgi?id=142416
     5        <rdar://problem/19993979>
     6
     7        Reviewed by Darin Adler and Sam Weinig.
     8
     9        Support the "plus-lighter" blending mode to CSS.
     10        See my reply to: https://lists.w3.org/Archives/Public/public-fx/2015JanMar/0021.html
     11
     12        Test: css3/blending/svg-blend-plus-lighter.html
     13
     14        * css/CSSParser.cpp:
     15        (WebCore::isValidKeywordPropertyAndValue): mix-blend-mode can now accept the
     16        new keyword.
     17        * css/CSSPrimitiveValueMappings.h: Add the mappings to/from the GraphicsType.
     18        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     19        (WebCore::CSSPrimitiveValue::operator BlendMode):
     20        * css/CSSValueKeywords.in: Add comment to show plus-darker and plus-lighter
     21        are available.
     22        * platform/graphics/GraphicsTypes.cpp: New GraphicsType for PlusLighter.
     23        * platform/graphics/GraphicsTypes.h:
     24        * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Map to the CA filter.
     25        (PlatformCAFilters::setBlendingFiltersOnLayer):
     26        * platform/graphics/cg/GraphicsContextCG.cpp:
     27        (WebCore::GraphicsContext::setPlatformCompositeOperation): Map to the CG
     28        blending flag.
     29
    1302015-03-06  Alex Christensen  <achristensen@webkit.org>
    231
  • trunk/Source/WebCore/css/CSSParser.cpp

    r180867 r181191  
    821821            || valueID == CSSValueOverlay || valueID == CSSValueDarken || valueID == CSSValueLighten ||  valueID == CSSValueColorDodge
    822822            || valueID == CSSValueColorBurn || valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference
    823             || valueID == CSSValueExclusion || valueID == CSSValuePlusDarker))
     823            || valueID == CSSValueExclusion || valueID == CSSValuePlusDarker || valueID == CSSValuePlusLighter))
    824824            return true;
    825825        break;
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r180965 r181191  
    41184118    case BlendModePlusDarker:
    41194119        m_value.valueID = CSSValuePlusDarker;
     4120        break;
     4121    case BlendModePlusLighter:
     4122        m_value.valueID = CSSValuePlusLighter;
    41204123        break;
    41214124    }
     
    41614164    case CSSValuePlusDarker:
    41624165        return BlendModePlusDarker;
     4166    case CSSValuePlusLighter:
     4167        return BlendModePlusLighter;
    41634168    default:
    41644169        break;
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r180965 r181191  
    10571057color
    10581058luminosity
     1059// plus-darker
     1060// plus-lighter
    10591061
    10601062// isolation
  • trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp

    r178710 r181191  
    6767    "color",
    6868    "luminosity",
    69     "plus-darker"
     69    "plus-darker",
     70    "plus-lighter"
    7071};
    7172const int numCompositeOperatorNames = WTF_ARRAY_LENGTH(compositeOperatorNames);
  • trunk/Source/WebCore/platform/graphics/GraphicsTypes.h

    r178710 r181191  
    6565        BlendModeColor,
    6666        BlendModeLuminosity,
    67         BlendModePlusDarker
     67        BlendModePlusDarker,
     68        BlendModePlusLighter
    6869    };
    6970
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm

    r178710 r181191  
    581581            filter = [CAFilter filterWithType:kCAFilterPlusD];
    582582            break;
     583        case BlendModePlusLighter:
     584            filter = [CAFilter filterWithType:kCAFilterPlusL];
     585            break;
    583586        default:
    584587            ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r180511 r181191  
    15381538            target = kCGBlendModePlusDarker;
    15391539            break;
     1540        case BlendModePlusLighter:
     1541            target = kCGBlendModePlusLighter;
     1542            break;
    15401543        default:
    15411544            break;
  • trunk/Source/WebKit2/ChangeLog

    r181176 r181191  
     12015-03-06  Dean Jackson  <dino@apple.com>
     2
     3        Support "plus-lighter" in mix-blend mode
     4        https://bugs.webkit.org/show_bug.cgi?id=142416
     5        <rdar://problem/19993979>
     6
     7        Reviewed by Darin Adler and Sam Weinig.
     8
     9        Output the appropriate blending type when logging.
     10
     11        * Shared/mac/RemoteLayerTreeTransaction.mm:
     12        (WebKit::RemoteLayerTreeTextStream::operator<<):
     13
    1142015-03-06  Beth Dakin  <bdakin@apple.com>
    215
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm

    r180965 r181191  
    849849    case BlendModeLuminosity: ts << "luminosity"; break;
    850850    case BlendModePlusDarker: ts << "plus-darker"; break;
     851    case BlendModePlusLighter: ts << "plus-lighter"; break;
    851852    }
    852853    return ts;
Note: See TracChangeset for help on using the changeset viewer.