aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2018-11-21 09:12:09 -0500
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2018-11-21 14:46:06 +0000
commit114bde830b88fab3d0240c34d0779ac4457c04db (patch)
tree2340e2860e0d3d6bdbeac8ca8d3032c04388364e /include
parent2aaae011459c9ab020ed70e0e68023ec3e4c406c (diff)
downloadskqp-114bde830b88fab3d0240c34d0779ac4457c04db.tar.gz
Revert "Revert "add rect-parameter to makeImageSnapshot""
This reverts commit 1e28e5d79e895e502afddecda2eb66a73a453d38. Bug: skia: Change-Id: I71c246885721c71de540e9079ecf7323234c8871 Reviewed-on: https://skia-review.googlesource.com/c/172302 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@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,