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

Unified Diff: src/effects/SkBlurImageFilter.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/SkBitmapSource.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurImageFilter.cpp
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index c5e3a78fbbf14f944d88169e01fe4f3f0134b4b4..adcb28f90d8f25ce2d5b3905eceaddacb799d424 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -134,11 +134,11 @@ static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo
}
bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
- const SkBitmap& source, const SkMatrix& ctm,
+ const SkBitmap& source, const Context& ctx,
SkBitmap* dst, SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
- if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctm, &src, &srcOffset)) {
+ if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcOffset)) {
return false;
}
@@ -154,7 +154,7 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
SkIRect srcBounds, dstBounds;
src.getBounds(&srcBounds);
srcBounds.offset(srcOffset);
- if (!this->applyCropRect(&srcBounds, ctm)) {
+ if (!this->applyCropRect(&srcBounds, ctx.ctm())) {
return false;
}
@@ -165,7 +165,7 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
}
SkVector sigma, localSigma = SkVector::Make(fSigma.width(), fSigma.height());
- ctm.mapVectors(&sigma, &localSigma, 1);
+ ctx.ctm().mapVectors(&sigma, &localSigma, 1);
int kernelSizeX, kernelSizeX3, lowOffsetX, highOffsetX;
int kernelSizeY, kernelSizeY3, lowOffsetY, highOffsetY;
@@ -250,23 +250,23 @@ bool SkBlurImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
return true;
}
-bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
+bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
SkBitmap* result, SkIPoint* offset) const {
#if SK_SUPPORT_GPU
SkBitmap input = src;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
- if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctm, &input, &srcOffset)) {
+ if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &input, &srcOffset)) {
return false;
}
GrTexture* source = input.getTexture();
SkIRect rect;
src.getBounds(&rect);
rect.offset(srcOffset);
- if (!this->applyCropRect(&rect, ctm)) {
+ if (!this->applyCropRect(&rect, ctx.ctm())) {
return false;
}
SkVector sigma, localSigma = SkVector::Make(fSigma.width(), fSigma.height());
- ctm.mapVectors(&sigma, &localSigma, 1);
+ ctx.ctm().mapVectors(&sigma, &localSigma, 1);
offset->fX = rect.fLeft;
offset->fY = rect.fTop;
rect.offset(-srcOffset);
« no previous file with comments | « src/effects/SkBitmapSource.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698