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

Unified Diff: include/core/SkImageFilter.h

Issue 1702683002: Image filters: change applyCropRect() to take a src rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 44231cc7eed089218ca5a042afa41e8ea619ca10..689d52b827aba34e818bb221e85def89a8a3922b 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -390,26 +390,25 @@ protected:
return false;
}
- /** 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).
+ /** Given a "srcBounds" rect, computes destination bounds for this
+ * destination bounds for this filter. "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* 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
- * bitmap in "result" and pads the edges with transparent black. In that
- * case, the srcOffset is modified to be the same as the bounds, since no
- * further adjustment is needed by the caller. This version should only
- * be used by filters which are not capable of processing a smaller
- * source bitmap into a larger destination.
+ bool applyCropRect(const Context&, const SkIRect& srcBounds, SkIRect* dstBounds) const;
+
+ /** A variant of the above call which takes the original source bitmap and
+ * source offset. If the resulting crop rect is not entirely contained by
+ * the source bitmap's bounds, it creates a new bitmap in "result" and
+ * pads the edges with transparent black. In that case, the srcOffset is
+ * modified to be the same as the bounds, since no further adjustment is
+ * needed by the caller. This version should only be used by filters
+ * which are not capable of processing a smaller source bitmap into a
+ * larger destination.
*/
bool applyCropRect(const Context&, Proxy* proxy, const SkBitmap& src, SkIPoint* srcOffset,
SkIRect* bounds, SkBitmap* result) const;
« 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