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

Changeset 120467 in webkit


Ignore:
Timestamp:
Jun 15, 2012, 8:56:18 AM (14 years ago)
Author:
fmalita@chromium.org
Message:

Specular light filters produce dark results
https://bugs.webkit.org/show_bug.cgi?id=89116

Reviewed by Dirk Schulze.

Source/WebCore:

Tests: svg/filters/feSpecularLight-premultiplied-expected.svg

svg/filters/feSpecularLight-premultiplied.svg

Per spec (http://www.w3.org/TR/SVG/filters.html#feSpecularLightingElement),
light filters should operate on pre-multiplied RGBA. Currently, the results
are stored in the unmultiplied buffer but the alpha channel is calculated
for premultiplied values (which causes a darkening of the result upon the
subsequent unmultiplied->premultiplied conversion). This patch updates
FELighting to generate premultiplied results.

  • platform/graphics/filters/FELighting.cpp:

(WebCore::FELighting::platformApplySoftware):

LayoutTests:

  • platform/chromium-linux/svg/W3C-SVG-1.1/filters-specular-01-f-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-in-attr-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularConstant-attr-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularExponent-attr-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-in-prop-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularConstant-prop-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularExponent-prop-expected.png:
  • platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop-expected.png:
  • platform/chromium-linux/svg/filters/feLighting-crash-expected.png:
  • platform/chromium/TestExpectations:
  • platform/mac/TestExpectations:
  • svg/filters/feSpecularLight-premultiplied-expected.svg: Added.
  • svg/filters/feSpecularLight-premultiplied.svg: Added.
Location:
trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120464 r120467  
     12012-06-15  Florin Malita  <fmalita@chromium.org>
     2
     3        Specular light filters produce dark results
     4        https://bugs.webkit.org/show_bug.cgi?id=89116
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * platform/chromium-linux/svg/W3C-SVG-1.1/filters-specular-01-f-expected.png:
     9        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-in-attr-expected.png:
     10        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularConstant-attr-expected.png:
     11        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularExponent-attr-expected.png:
     12        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr-expected.png:
     13        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop-expected.png:
     14        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop-expected.png:
     15        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-in-prop-expected.png:
     16        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularConstant-prop-expected.png:
     17        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularExponent-prop-expected.png:
     18        * platform/chromium-linux/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop-expected.png:
     19        * platform/chromium-linux/svg/filters/feLighting-crash-expected.png:
     20        * platform/chromium/TestExpectations:
     21        * platform/mac/TestExpectations:
     22        * svg/filters/feSpecularLight-premultiplied-expected.svg: Added.
     23        * svg/filters/feSpecularLight-premultiplied.svg: Added.
     24
    1252012-06-15  Stephen Chenney  <schenney@chromium.org>
    226
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r120446 r120467  
    12361236BUGWK81217 : svg/hixie/perf/003.xml = PASS IMAGE
    12371237
     1238// Need rebaseline after https://bugs.webkit.org/show_bug.cgi?id=89116
     1239BUGWK89116 WIN MAC : svg/W3C-SVG-1.1/filters-specular-01-f.svg = PASS IMAGE
     1240BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-dom-in-attr.html = PASS IMAGE
     1241BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularConstant-attr.html = PASS IMAGE
     1242BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularExponent-attr.html = PASS IMAGE
     1243BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html = PASS IMAGE
     1244BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop.html = PASS IMAGE
     1245BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop.html = PASS IMAGE
     1246BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-in-prop.html = PASS IMAGE
     1247BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularConstant-prop.html = PASS IMAGE
     1248BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularExponent-prop.html = PASS IMAGE
     1249BUGWK89116 WIN MAC : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html = PASS IMAGE
     1250BUGWK89116 WIN MAC : svg/filters/feLighting-crash.svg = PASS IMAGE
     1251
    12381252BUGWK81240 MAC : svg/text/bidi-reorder-value-lists.svg = PASS IMAGE+TEXT
    12391253
  • trunk/LayoutTests/platform/mac/TestExpectations

    r120371 r120467  
    212212BUGWK85408 : svg/batik/text/longTextOnPath.svg = TEXT PASS
    213213
     214// Need rebaseline after https://bugs.webkit.org/show_bug.cgi?id=89116
     215BUGWK89116 : svg/W3C-SVG-1.1/filters-specular-01-f.svg = PASS IMAGE
     216BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-dom-in-attr.html = PASS IMAGE
     217BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularConstant-attr.html = PASS IMAGE
     218BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularExponent-attr.html = PASS IMAGE
     219BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html = PASS IMAGE
     220BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-inherit-lighting-color-css-prop.html = PASS IMAGE
     221BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-lighting-color-css-prop.html = PASS IMAGE
     222BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-in-prop.html = PASS IMAGE
     223BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularConstant-prop.html = PASS IMAGE
     224BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularExponent-prop.html = PASS IMAGE
     225BUGWK89116 : svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html = PASS IMAGE
     226BUGWK89116 : svg/filters/feLighting-crash.svg = PASS IMAGE
     227
    214228// Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=79682
    215229BUGWK79682 : svg/repaint/text-mask-update.svg = MISSING IMAGE+TEXT IMAGE TEXT PASS
  • trunk/Source/WebCore/ChangeLog

    r120465 r120467  
     12012-06-15  Florin Malita  <fmalita@chromium.org>
     2
     3        Specular light filters produce dark results
     4        https://bugs.webkit.org/show_bug.cgi?id=89116
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Tests: svg/filters/feSpecularLight-premultiplied-expected.svg
     9               svg/filters/feSpecularLight-premultiplied.svg
     10
     11        Per spec (http://www.w3.org/TR/SVG/filters.html#feSpecularLightingElement),
     12        light filters should operate on pre-multiplied RGBA. Currently, the results
     13        are stored in the unmultiplied buffer but the alpha channel is calculated
     14        for premultiplied values (which causes a darkening of the result upon the
     15        subsequent unmultiplied->premultiplied conversion). This patch updates
     16        FELighting to generate premultiplied results.
     17
     18        * platform/graphics/filters/FELighting.cpp:
     19        (WebCore::FELighting::platformApplySoftware):
     20
    1212012-06-15  Andrey Kosyakov  <caseq@chromium.org>
    222
  • trunk/Source/WebCore/platform/graphics/filters/FELighting.cpp

    r117048 r120467  
    389389    FilterEffect* in = inputEffect(0);
    390390
    391     Uint8ClampedArray* srcPixelArray = createUnmultipliedImageResult();
     391    Uint8ClampedArray* srcPixelArray = createPremultipliedImageResult();
    392392    if (!srcPixelArray)
    393393        return;
     
    396396
    397397    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    398     in->copyUnmultipliedImage(srcPixelArray, effectDrawingRect);
     398    in->copyPremultipliedImage(srcPixelArray, effectDrawingRect);
    399399
    400400    // FIXME: support kernelUnitLengths other than (1,1). The issue here is that the W3
Note: See TracChangeset for help on using the changeset viewer.