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

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

Issue 1862733002: Remove all use of crop edges from SkImageFilter::CropRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix FEMorphology bug Created 4 years, 8 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
Index: third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp b/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp
index 5d4f21572ce74fdedf6a7dacc1c960e06f3e2f56..56b93761837d6cd323d116e8d0651b88cc365734 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp
@@ -63,7 +63,7 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder&
if (!m_lightSource)
return createTransparentBlack(builder);
- SkImageFilter::CropRect rect = getCropRect();
+ SkImageFilter::CropRect rect;
Color lightColor = adaptColorToOperatingColorSpace(m_lightingColor);
RefPtr<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace()));
switch (m_lightSource->type()) {
@@ -73,16 +73,16 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder&
float elevationRad = deg2rad(distantLightSource->elevation());
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));
+ return adoptRef(SkLightingImageFilter::CreateDistantLitSpecular(direction, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), getCropRect(&rect)));
+ return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), getCropRect(&rect)));
}
case LS_POINT: {
PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
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));
+ return adoptRef(SkLightingImageFilter::CreatePointLitSpecular(skPosition, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), getCropRect(&rect)));
+ return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), getCropRect(&rect)));
}
case LS_SPOT: {
SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
@@ -93,8 +93,8 @@ PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder&
if (!limitingConeAngle || limitingConeAngle > 90 || limitingConeAngle < -90)
limitingConeAngle = 90;
if (m_specularConstant > 0)
- return adoptRef(SkLightingImageFilter::CreateSpotLitSpecular(location, target, specularExponent, limitingConeAngle, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
- return adoptRef(SkLightingImageFilter::CreateSpotLitDiffuse(location, target, specularExponent, limitingConeAngle, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
+ return adoptRef(SkLightingImageFilter::CreateSpotLitSpecular(location, target, specularExponent, limitingConeAngle, lightColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), getCropRect(&rect)));
+ return adoptRef(SkLightingImageFilter::CreateSpotLitDiffuse(location, target, specularExponent, limitingConeAngle, lightColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), getCropRect(&rect)));
}
default:
ASSERT_NOT_REACHED();

Powered by Google App Engine
This is Rietveld 408576698