| Index: Source/platform/graphics/filters/FELighting.cpp
|
| diff --git a/Source/core/platform/graphics/filters/FELighting.cpp b/Source/platform/graphics/filters/FELighting.cpp
|
| similarity index 96%
|
| rename from Source/core/platform/graphics/filters/FELighting.cpp
|
| rename to Source/platform/graphics/filters/FELighting.cpp
|
| index 4c721bdf7b5b986455f40bc56824dcd431e0ebe4..4b1b44d75222e53c02d98e580a76f7ad4b20e5f6 100644
|
| --- a/Source/core/platform/graphics/filters/FELighting.cpp
|
| +++ b/Source/platform/graphics/filters/FELighting.cpp
|
| @@ -26,12 +26,11 @@
|
| */
|
|
|
| #include "config.h"
|
| -
|
| -#include "core/platform/graphics/filters/FELighting.h"
|
| +#include "platform/graphics/filters/FELighting.h"
|
|
|
| #include "SkLightingImageFilter.h"
|
| -#include "core/platform/graphics/cpu/arm/filters/FELightingNEON.h"
|
| -#include "core/platform/graphics/filters/DistantLightSource.h"
|
| +#include "platform/graphics/cpu/arm/filters/FELightingNEON.h"
|
| +#include "platform/graphics/filters/DistantLightSource.h"
|
| #include "platform/graphics/filters/ParallelJobs.h"
|
| #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
|
| #include "platform/graphics/skia/NativeImageSkia.h"
|
| @@ -185,9 +184,9 @@ inline void FELighting::inlineSetPixel(int offset, LightingData& data, LightSour
|
| float lightStrength;
|
| if (!normal2DVector.x() && !normal2DVector.y()) {
|
| // Normal vector is (0, 0, 1). This is a quite frequent case.
|
| - if (m_lightingType == FELighting::DiffuseLighting)
|
| + if (m_lightingType == FELighting::DiffuseLighting) {
|
| lightStrength = m_diffuseConstant * paintingData.lightVector.z() / paintingData.lightVectorLength;
|
| - else {
|
| + } else {
|
| FloatPoint3D halfwayVector = paintingData.lightVector;
|
| halfwayVector.setZ(halfwayVector.z() + paintingData.lightVectorLength);
|
| float halfwayVectorLength = halfwayVector.length();
|
| @@ -203,9 +202,9 @@ inline void FELighting::inlineSetPixel(int offset, LightingData& data, LightSour
|
| normalVector.setZ(1);
|
| float normalVectorLength = normalVector.length();
|
|
|
| - if (m_lightingType == FELighting::DiffuseLighting)
|
| + if (m_lightingType == FELighting::DiffuseLighting) {
|
| lightStrength = m_diffuseConstant * (normalVector * paintingData.lightVector) / (normalVectorLength * paintingData.lightVectorLength);
|
| - else {
|
| + } else {
|
| FloatPoint3D halfwayVector = paintingData.lightVector;
|
| halfwayVector.setZ(halfwayVector.z() + paintingData.lightVectorLength);
|
| float halfwayVectorLength = halfwayVector.length();
|
| @@ -425,8 +424,7 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder*
|
| sinf(elevationRad));
|
| if (m_specularConstant > 0)
|
| return adoptRef(SkLightingImageFilter::CreateDistantLitSpecular(direction, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
|
| - else
|
| - return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
| + return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
| }
|
| case LS_POINT: {
|
| PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
|
| @@ -434,8 +432,7 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder*
|
| SkPoint3 skPosition(position.x(), position.y(), position.z());
|
| if (m_specularConstant > 0)
|
| return adoptRef(SkLightingImageFilter::CreatePointLitSpecular(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
|
| - else
|
| - return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
| + return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
| }
|
| case LS_SPOT: {
|
| SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
|
| @@ -447,8 +444,7 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder*
|
| limitingConeAngle = 90;
|
| if (m_specularConstant > 0)
|
| return adoptRef(SkLightingImageFilter::CreateSpotLitSpecular(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
|
| - else
|
| - return adoptRef(SkLightingImageFilter::CreateSpotLitDiffuse(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
| + return adoptRef(SkLightingImageFilter::CreateSpotLitDiffuse(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
|
| }
|
| default:
|
| ASSERT_NOT_REACHED();
|
|
|