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

Unified Diff: src/effects/SkDropShadowImageFilter.cpp

Issue 189913021: Implement support for a Context parameter in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert all but the Context changes. Created 6 years, 9 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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.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 7c9631c3935ebcfaabe53dc52ff9d32a4af4ce88..94055ce8ae0a44281560d86f8bf54df36e89cb2d 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -58,17 +58,17 @@ void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const
buffer.writeColor(fColor);
}
-bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const SkMatrix& matrix, SkBitmap* result, SkIPoint* offset) const
+bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, const Context& ctx, SkBitmap* result, SkIPoint* offset) const
{
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
- if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset))
+ if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcOffset))
return false;
SkIRect bounds;
src.getBounds(&bounds);
bounds.offset(srcOffset);
- if (!this->applyCropRect(&bounds, matrix)) {
+ if (!this->applyCropRect(&bounds, ctx.ctm())) {
return false;
}
@@ -79,7 +79,7 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
SkCanvas canvas(device.get());
SkVector sigma, localSigma = SkVector::Make(fSigmaX, fSigmaY);
- matrix.mapVectors(&sigma, &localSigma, 1);
+ ctx.ctm().mapVectors(&sigma, &localSigma, 1);
sigma.fX = SkMaxScalar(0, sigma.fX);
sigma.fY = SkMaxScalar(0, sigma.fY);
SkAutoTUnref<SkImageFilter> blurFilter(SkBlurImageFilter::Create(sigma.fX, sigma.fY));
@@ -89,7 +89,7 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
paint.setColorFilter(colorFilter.get());
paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
SkVector offsetVec, localOffsetVec = SkVector::Make(fDx, fDy);
- matrix.mapVectors(&offsetVec, &localOffsetVec, 1);
+ ctx.ctm().mapVectors(&offsetVec, &localOffsetVec, 1);
canvas.translate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop));
canvas.drawBitmap(src, offsetVec.fX, offsetVec.fY, &paint);
canvas.drawBitmap(src, 0, 0);
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698