Index: src/effects/SkLightingImageFilter.cpp |
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp |
index c63b2ebe50b81a7eb67f606713e57c3621b2e015..59479212311af483f7424252641f9089a6028b01 100644 |
--- a/src/effects/SkLightingImageFilter.cpp |
+++ b/src/effects/SkLightingImageFilter.cpp |
@@ -1217,7 +1217,9 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, |
return false; |
} |
- SkAutoTUnref<SkImageFilterLight> transformedLight(light()->transform(ctx.ctm())); |
+ SkMatrix matrix(ctx.ctm()); |
+ matrix.postTranslate(SkIntToScalar(-srcOffset.x()), SkIntToScalar(-srcOffset.y())); |
+ SkAutoTUnref<SkImageFilterLight> transformedLight(light()->transform(matrix)); |
DiffuseLightingType lightingType(fKD); |
offset->fX = bounds.left(); |
@@ -1362,8 +1364,10 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy, |
SpecularLightingType lightingType(fKS, fShininess); |
offset->fX = bounds.left(); |
offset->fY = bounds.top(); |
+ SkMatrix matrix(ctx.ctm()); |
+ matrix.postTranslate(SkIntToScalar(-srcOffset.x()), SkIntToScalar(-srcOffset.y())); |
+ SkAutoTUnref<SkImageFilterLight> transformedLight(light()->transform(matrix)); |
bounds.offset(-srcOffset); |
- SkAutoTUnref<SkImageFilterLight> transformedLight(light()->transform(ctx.ctm())); |
switch (transformedLight->type()) { |
case SkImageFilterLight::kDistant_LightType: |
lightBitmap<SpecularLightingType, SkDistantLight>(lightingType, |