Skip to content
  • cmarrin@apple.com's avatar
    Implement hardware accelerated Brightness and contrast filters · 0b88a94b
    cmarrin@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=75521
    https://bugs.webkit.org/show_bug.cgi?id=76719
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    Implemented hardware accelerated brightness and contrast filters. This also fixes
    the bug where grayscale filter was accidentally never getting hardware accelerated.
    It also complies with proposed spec changes for the brightness filter to be additive
    rather than multiplicative, according to https://bugs.webkit.org/show_bug.cgi?id=76719.
    Had to make both fixes in the same patch because I had to change the allowed brightness
    values for the hardware version, so I had to change the software version as well.
    
    Tests: css3/filters/effect-brightness-hw.html
           css3/filters/effect-contrast-hw.html
    
    * css/CSSParser.cpp:
    (WebCore::CSSParser::parseBuiltinFilterArguments):
    * css/CSSStyleSelector.cpp:
    (WebCore::CSSStyleSelector::createFilterOperations):
    * platform/graphics/ca/mac/PlatformCALayerMac.mm:
    (PlatformCALayer::setFilters):
    (PlatformCALayer::filtersCanBeComposited):
    * rendering/FilterEffectRenderer.cpp:
    (WebCore::FilterEffectRenderer::build):
    
    LayoutTests:
    
    New tests for hardware accelerated brightness and contrast filters. Also
    added brightness and contrast values to effect-combined-hw test. And changed
    brightness values in effect-brightness.html to reflect new spec.
    Also fixed parsing and computed style tests to reflect new brightness spec.
    
    * css3/filters/effect-brightness-expected.png:
    * css3/filters/effect-brightness-hw-expected.png: Added.
    * css3/filters/effect-brightness-hw-expected.txt: Added.
    * css3/filters/effect-brightness-hw.html: Added.
    * css3/filters/effect-brightness.html:
    * css3/filters/effect-combined-expected.png:
    * css3/filters/effect-combined-hw-expected.png:
    * css3/filters/effect-combined-hw-expected.txt:
    * css3/filters/effect-combined-hw.html:
    * css3/filters/effect-combined.html:
    * css3/filters/effect-contrast-hw-expected.png: Added.
    * css3/filters/effect-contrast-hw-expected.txt: Added.
    * css3/filters/effect-contrast-hw.html: Added.
    * css3/filters/filter-property-computed-style-expected.txt:
    * css3/filters/filter-property-parsing-expected.txt:
    * css3/filters/filter-property-parsing-invalid-expected.txt:
    * css3/filters/script-tests/filter-property-computed-style.js:
    * css3/filters/script-tests/filter-property-parsing-invalid.js:
    * css3/filters/script-tests/filter-property-parsing.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0b88a94b