Changeset 226317 in webkit


Ignore:
Timestamp:
Jan 1, 2018 12:32:33 PM (6 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r225122): fePointLights don't work
https://bugs.webkit.org/show_bug.cgi?id=181142

Reviewed by Dan Bates.

Source/WebCore:

r225122 refactored the initialLightingData code, but failed to set the lighting
color in the return value of PointLightSource::computePixelLightingData, so fePointLights
always used black.

Also fix a spelling error in initialLightingData.

Tests: svg/filters/fePointLight-color.svg

  • platform/graphics/filters/DistantLightSource.cpp:

(WebCore::DistantLightSource::initPaintingData):
(WebCore::DistantLightSource::computePixelLightingData const):

  • platform/graphics/filters/FELighting.cpp:

(WebCore::FELighting::drawLighting):

  • platform/graphics/filters/LightSource.h:
  • platform/graphics/filters/PointLightSource.cpp:

(WebCore::PointLightSource::computePixelLightingData const):

  • platform/graphics/filters/SpotLightSource.cpp:

(WebCore::SpotLightSource::computePixelLightingData const):

LayoutTests:

Ref test that compares a point light with a flood color.

  • svg/filters/fePointLight-color-expected.svg: Added.
  • svg/filters/fePointLight-color.svg: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r226316 r226317  
     12017-12-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r225122): fePointLights don't work
     4        https://bugs.webkit.org/show_bug.cgi?id=181142
     5
     6        Reviewed by Dan Bates.
     7
     8        Ref test that compares a point light with a flood color.
     9
     10        * svg/filters/fePointLight-color-expected.svg: Added.
     11        * svg/filters/fePointLight-color.svg: Added.
     12
    1132017-12-31  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r226316 r226317  
     12017-12-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r225122): fePointLights don't work
     4        https://bugs.webkit.org/show_bug.cgi?id=181142
     5
     6        Reviewed by Dan Bates.
     7
     8        r225122 refactored the initialLightingData code, but failed to set the lighting
     9        color in the return value of PointLightSource::computePixelLightingData, so fePointLights
     10        always used black.
     11
     12        Also fix a spelling error in initialLightingData.
     13
     14        Tests: svg/filters/fePointLight-color.svg
     15
     16        * platform/graphics/filters/DistantLightSource.cpp:
     17        (WebCore::DistantLightSource::initPaintingData):
     18        (WebCore::DistantLightSource::computePixelLightingData const):
     19        * platform/graphics/filters/FELighting.cpp:
     20        (WebCore::FELighting::drawLighting):
     21        * platform/graphics/filters/LightSource.h:
     22        * platform/graphics/filters/PointLightSource.cpp:
     23        (WebCore::PointLightSource::computePixelLightingData const):
     24        * platform/graphics/filters/SpotLightSource.cpp:
     25        (WebCore::SpotLightSource::computePixelLightingData const):
     26
    1272017-12-31  Simon Fraser  <simon.fraser@apple.com>
    228
  • trunk/Source/WebCore/platform/graphics/filters/DistantLightSource.cpp

    r225122 r226317  
    4040    float azimuth = deg2rad(m_azimuth);
    4141    float elevation = deg2rad(m_elevation);
    42     paintingData.intialLightingData.lightVector = {
     42    paintingData.initialLightingData.lightVector = {
    4343        std::cos(azimuth) * std::cos(elevation),
    4444        std::sin(azimuth) * std::cos(elevation),
    4545        std::sin(elevation)
    4646    };
    47     paintingData.intialLightingData.lightVectorLength = 1;
     47    paintingData.initialLightingData.lightVectorLength = 1;
    4848}
    4949
    5050LightSource::ComputedLightingData DistantLightSource::computePixelLightingData(const PaintingData& paintingData, int, int, float) const
    5151{
    52     return paintingData.intialLightingData;
     52    return paintingData.initialLightingData;
    5353}
    5454
  • trunk/Source/WebCore/platform/graphics/filters/FELighting.cpp

    r226316 r226317  
    401401   
    402402    Color lightColor = (operatingColorSpace() == ColorSpaceLinearRGB) ? sRGBToLinearColor(m_lightingColor) : m_lightingColor;
    403     paintingData.intialLightingData.colorVector = FloatPoint3D(lightColor.red(), lightColor.green(), lightColor.blue());
     403    paintingData.initialLightingData.colorVector = FloatPoint3D(lightColor.red(), lightColor.green(), lightColor.blue());
    404404    m_lightSource->initPaintingData(paintingData);
    405405
  • trunk/Source/WebCore/platform/graphics/filters/LightSource.h

    r225122 r226317  
    4848
    4949    struct PaintingData {
    50         ComputedLightingData intialLightingData;
     50        ComputedLightingData initialLightingData;
    5151        FloatPoint3D directionVector;
    5252        float coneCutOffLimit;
  • trunk/Source/WebCore/platform/graphics/filters/PointLightSource.cpp

    r225122 r226317  
    4040}
    4141
    42 LightSource::ComputedLightingData PointLightSource::computePixelLightingData(const PaintingData&, int x, int y, float z) const
     42LightSource::ComputedLightingData PointLightSource::computePixelLightingData(const PaintingData& paintingData, int x, int y, float z) const
    4343{
    4444    FloatPoint3D lightVector = {
     
    4848    };
    4949
    50     return { lightVector, { }, lightVector.length() };
     50    return { lightVector, paintingData.initialLightingData.colorVector, lightVector.length() };
    5151}
    5252
  • trunk/Source/WebCore/platform/graphics/filters/SpotLightSource.cpp

    r225122 r226317  
    105105    return {
    106106        lightVector,
    107         paintingData.intialLightingData.colorVector * lightStrength,
     107        paintingData.initialLightingData.colorVector * lightStrength,
    108108        lightVectorLength
    109109    };
Note: See TracChangeset for help on using the changeset viewer.