aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-02-16 09:11:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 09:11:18 -0800
commitafec27f13b28d900232cb1825c63cab2d6e4e103 (patch)
treef16414c3118f2b0eb50a19b10fce60554fee7d33 /include
parent944c2d901c5118abae2262f38414ccb939111355 (diff)
Image filters: change applyCropRect() to take a src rect.
Instead of taking the source bitmap and offset, we simply take the source rect bounds, and make the caller responsible for computing it. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1702683002 Review URL: https://codereview.chromium.org/1702683002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkImageFilter.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 44231cc7ee..689d52b827 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;