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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 112803004: Make SkImageFilter crop rects relative to the primitive origin, instead of relative to their parent (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated to ToT Created 6 years, 12 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/SkLightingImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 3da27cef26e1b5697d37f094baa5428b44a2ef1c..a45004000054da41782202b286c4076f82b69769 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -252,9 +252,10 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* loc) {
+ SkIPoint* offset) {
SkBitmap src = source;
- if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, loc)) {
+ SkIPoint srcOffset = SkIPoint::Make(0, 0);
+ if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset)) {
return false;
}
@@ -264,6 +265,7 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
SkIRect bounds;
src.getBounds(&bounds);
+ bounds.offset(srcOffset);
if (!this->applyCropRect(&bounds, matrix)) {
return false;
}
@@ -283,6 +285,9 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
return false;
}
+ offset->fX = bounds.fLeft;
+ offset->fY = bounds.fTop;
+ bounds.offset(-srcOffset);
SkIRect interior = SkIRect::MakeXYWH(bounds.left() + fTarget.fX,
bounds.top() + fTarget.fY,
bounds.width() - fKernelSize.fWidth + 1,
@@ -299,8 +304,6 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy,
filterInteriorPixels(src, result, interior, bounds);
filterBorderPixels(src, result, right, bounds);
filterBorderPixels(src, result, bottom, bounds);
- loc->fX += bounds.fLeft;
- loc->fY += bounds.fTop;
return true;
}
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698