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

Unified Diff: src/effects/SkBicubicImageFilter.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/core/SkImageFilterUtils.cpp ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBicubicImageFilter.cpp
diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp
index 87ff046fc188895b7fcc6bf0eeac149114f80f4e..96d46aa7ce18a9f47b8052dd8f674998f67a29e3 100644
--- a/src/effects/SkBicubicImageFilter.cpp
+++ b/src/effects/SkBicubicImageFilter.cpp
@@ -84,9 +84,10 @@ bool SkBicubicImageFilter::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;
}
@@ -114,6 +115,7 @@ bool SkBicubicImageFilter::onFilterImage(Proxy* proxy,
SkRect srcRect;
src.getBounds(&srcRect);
+ srcRect.offset(SkPoint::Make(SkIntToScalar(srcOffset.fX), SkIntToScalar(srcOffset.fY)));
SkMatrix inverse;
inverse.setRectToRect(dstRect, srcRect, SkMatrix::kFill_ScaleToFit);
inverse.postTranslate(-0.5f, -0.5f);
@@ -158,6 +160,8 @@ bool SkBicubicImageFilter::onFilterImage(Proxy* proxy,
*dptr++ = cubicBlend(fCoefficients, fracty, s0, s1, s2, s3);
}
}
+ offset->fX = dstIRect.fLeft;
+ offset->fY = dstIRect.fTop;
return true;
}
« no previous file with comments | « src/core/SkImageFilterUtils.cpp ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698