Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: Source/platform/graphics/filters/FELighting.cpp

Issue 1274673002: Remove reliance on legacy Skia SkPoint3 ctors in FELighting.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rm extra line Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698