aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2018-11-20 21:26:41 -0500
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2018-11-21 02:58:28 +0000
commite195d1c22e4f40dd3c2fa06303291aff5158c30c (patch)
tree8f7940364a777f9ecf101588e45f56c1c75f4d51 /include
parentef3f9bef86609559f382bf1f688fe9874f17006d (diff)
downloadskqp-e195d1c22e4f40dd3c2fa06303291aff5158c30c.tar.gz
add rect-parameter to makeImageSnapshot
Bug: skia: Change-Id: I56044fb1f21b959993d69fc587f95e3dbf30c371 Reviewed-on: https://skia-review.googlesource.com/c/171905 Commit-Queue: Mike Reed <reed@google.com> Auto-Submit: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkSurface.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 0c7d36a264..23c3b6a235 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -495,6 +495,17 @@ public:
*/
sk_sp<SkImage> makeImageSnapshot();
+ /**
+ * Like the no-parameter version, this returns an image of the current surface contents.
+ * This variant takes a rectangle specifying the subset of the surface that is of interest.
+ * These bounds will be sanitized before being used.
+ * - If bounds extends beyond the surface, it will be trimmed to just the intersection of
+ * it and the surface.
+ * - If bounds does not intersect the surface, then this returns nullptr.
+ * - If bounds == the surface, then this is the same as calling the no-parameter variant.
+ */
+ sk_sp<SkImage> makeImageSnapshot(const SkIRect& bounds);
+
/** Draws SkSurface contents to canvas, with its top-left corner at (x, y).
If SkPaint paint is not nullptr, apply SkColorFilter, alpha, SkImageFilter,