Index: Source/platform/graphics/filters/FELighting.cpp |
diff --git a/Source/platform/graphics/filters/FELighting.cpp b/Source/platform/graphics/filters/FELighting.cpp |
index 030feeb968bee5413919487b2b1de4d032ea4137..4301e3a108e988b056b1ca88936d8b24459f00cc 100644 |
--- a/Source/platform/graphics/filters/FELighting.cpp |
+++ b/Source/platform/graphics/filters/FELighting.cpp |
@@ -29,6 +29,7 @@ |
#include "platform/graphics/filters/FELighting.h" |
#include "SkLightingImageFilter.h" |
+#include "SkPoint3.h" |
#include "platform/graphics/filters/DistantLightSource.h" |
#include "platform/graphics/filters/PointLightSource.h" |
#include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
@@ -70,25 +71,23 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder* |
DistantLightSource* distantLightSource = static_cast<DistantLightSource*>(m_lightSource.get()); |
float azimuthRad = deg2rad(distantLightSource->azimuth()); |
float elevationRad = deg2rad(distantLightSource->elevation()); |
- SkPoint3 direction(cosf(azimuthRad) * cosf(elevationRad), |
- sinf(azimuthRad) * cosf(elevationRad), |
- sinf(elevationRad)); |
+ const SkPoint3 direction = SkPoint3::Make(cosf(azimuthRad) * cosf(elevationRad), sinf(azimuthRad) * cosf(elevationRad), sinf(elevationRad)); |
if (m_specularConstant > 0) |
return adoptRef(SkLightingImageFilter::CreateDistantLitSpecular(direction, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect)); |
return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect)); |
} |
case LS_POINT: { |
PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get()); |
- FloatPoint3D position = pointLightSource->position(); |
- SkPoint3 skPosition(position.x(), position.y(), position.z()); |
+ const FloatPoint3D position = pointLightSource->position(); |
+ const SkPoint3 skPosition = SkPoint3::Make(position.x(), position.y(), position.z()); |
if (m_specularConstant > 0) |
return adoptRef(SkLightingImageFilter::CreatePointLitSpecular(skPosition, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect)); |
return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect)); |
} |
case LS_SPOT: { |
SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get()); |
- SkPoint3 location(spotLightSource->position().x(), spotLightSource->position().y(), spotLightSource->position().z()); |
- SkPoint3 target(spotLightSource->direction().x(), spotLightSource->direction().y(), spotLightSource->direction().z()); |
+ const SkPoint3 location = SkPoint3::Make(spotLightSource->position().x(), spotLightSource->position().y(), spotLightSource->position().z()); |
+ const SkPoint3 target = SkPoint3::Make(spotLightSource->direction().x(), spotLightSource->direction().y(), spotLightSource->direction().z()); |
float specularExponent = spotLightSource->specularExponent(); |
float limitingConeAngle = spotLightSource->limitingConeAngle(); |
if (!limitingConeAngle || limitingConeAngle > 90 || limitingConeAngle < -90) |