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

Unified Diff: src/effects/SkDropShadowImageFilter.cpp

Issue 277543002: Some small cleanups for image filter code. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 | « src/effects/SkBlurImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDropShadowImageFilter.cpp
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 66a4e8b68fb0b9656faf41459fed19b91606059a..032acec8c6c69dbce70e2ce5cec9a388b65fb676 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -81,8 +81,8 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
}
SkCanvas canvas(device.get());
- SkVector sigma, localSigma = SkVector::Make(fSigmaX, fSigmaY);
- ctx.ctm().mapVectors(&sigma, &localSigma, 1);
+ SkVector sigma = SkVector::Make(fSigmaX, fSigmaY);
+ ctx.ctm().mapVectors(&sigma, 1);
sigma.fX = SkMaxScalar(0, sigma.fX);
sigma.fY = SkMaxScalar(0, sigma.fY);
SkAutoTUnref<SkImageFilter> blurFilter(SkBlurImageFilter::Create(sigma.fX, sigma.fY));
@@ -92,8 +92,8 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
paint.setImageFilter(blurFilter.get());
paint.setColorFilter(colorFilter.get());
paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
- SkVector offsetVec, localOffsetVec = SkVector::Make(fDx, fDy);
- ctx.ctm().mapVectors(&offsetVec, &localOffsetVec, 1);
+ SkVector offsetVec = SkVector::Make(fDx, fDy);
+ ctx.ctm().mapVectors(&offsetVec, 1);
canvas.translate(SkIntToScalar(srcOffset.fX - bounds.fLeft),
SkIntToScalar(srcOffset.fY - bounds.fTop));
canvas.drawBitmap(src, offsetVec.fX, offsetVec.fY, &paint);
@@ -124,12 +124,12 @@ bool SkDropShadowImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix&
if (getInput(0) && !getInput(0)->filterBounds(src, ctm, &bounds)) {
return false;
}
- SkVector offsetVec, localOffsetVec = SkVector::Make(fDx, fDy);
- ctm.mapVectors(&offsetVec, &localOffsetVec, 1);
+ SkVector offsetVec = SkVector::Make(fDx, fDy);
+ ctm.mapVectors(&offsetVec, 1);
bounds.offset(-SkScalarCeilToInt(offsetVec.x()),
-SkScalarCeilToInt(offsetVec.y()));
- SkVector sigma, localSigma = SkVector::Make(fSigmaX, fSigmaY);
- ctm.mapVectors(&sigma, &localSigma, 1);
+ SkVector sigma = SkVector::Make(fSigmaX, fSigmaY);
+ ctm.mapVectors(&sigma, 1);
bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))),
SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
bounds.join(src);
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698