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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1410553007: Make SkImageFilter::applyCropRect() optionally compute srcBounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Tweak comment per review Created 5 years, 2 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 | « include/core/SkImageFilter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 95793025e8a0015cbc1133541156684ba54dd576..25eecb0b5d67b4dbeea15391541be513f15e29e4 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -391,11 +391,15 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
}
bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src,
- const SkIPoint& srcOffset, SkIRect* bounds) const {
- SkIRect srcBounds;
- src.getBounds(&srcBounds);
- srcBounds.offset(srcOffset);
- return fCropRect.applyTo(srcBounds, ctx, bounds);
+ const SkIPoint& srcOffset, SkIRect* dstBounds,
+ SkIRect* srcBounds) const {
+ SkIRect storage;
+ if (!srcBounds) {
+ srcBounds = &storage;
+ }
+ src.getBounds(srcBounds);
+ srcBounds->offset(srcOffset);
+ return fCropRect.applyTo(*srcBounds, ctx, dstBounds) && srcBounds->intersect(*dstBounds);
}
bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitmap& src,
« no previous file with comments | « include/core/SkImageFilter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698