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

Unified Diff: include/core/SkImageFilter.h

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 | « no previous file | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 0c3d4c2ddf4f66a2081591edd42f8b535807236d..d90df29c8bfeaabfba887417c17b6e7f8447e83b 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -368,14 +368,18 @@ protected:
return false;
}
- /** Computes source bounds as the src bitmap bounds offset by srcOffset.
- * Apply the transformed crop rect to the bounds if any of the
- * corresponding edge flags are set. Intersects the result against the
- * context's clipBounds, and returns the result in "bounds". If there is
- * no intersection, returns false and leaves "bounds" unchanged.
+ /** Given a "src" bitmap and its "srcOffset", computes source and
+ * destination bounds for this filter. Initial bounds are the
+ * "src" bitmap bounds offset by "srcOffset". "dstBounds" are
+ * computed by transforming the crop rect by the context's CTM,
+ * applying it to the initial bounds, and intersecting the result
+ * with the context's clip bounds. "srcBounds" (if non-null) are
+ * computed by intersecting the initial bounds with "dstBounds", to
+ * ensure that we never sample outside of the crop rect (this restriction
+ * may be relaxed in the future).
*/
bool applyCropRect(const Context&, const SkBitmap& src, const SkIPoint& srcOffset,
- SkIRect* bounds) const;
+ SkIRect* dstBounds, SkIRect* srcBounds = nullptr) const;
/** Same as the above call, except that if the resulting crop rect is not
* entirely contained by the source bitmap's bounds, it creates a new
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698