aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpecialImage.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-02-16 13:39:44 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-16 21:40:32 +0000
commit5df6db15dc04ea7f8c8fa7a7b58ecb881d7a70fe (patch)
tree1d6890cfcb244501f0886da024d6f777992a545e /src/core/SkSpecialImage.h
parentdc0cae19b4f84e9e91f48bdb132a1c4828a7b329 (diff)
Replace SkSpecialImage::makeTightSubset with asImage
This should allow the relanding of: https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)) Change-Id: I517af11036e3f44a280bbe6b9275f6c38f4a86a4 Reviewed-on: https://skia-review.googlesource.com/8498 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkSpecialImage.h')
-rw-r--r--src/core/SkSpecialImage.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/SkSpecialImage.h b/src/core/SkSpecialImage.h
index 1c9c5a1b4c..a837683143 100644
--- a/src/core/SkSpecialImage.h
+++ b/src/core/SkSpecialImage.h
@@ -117,11 +117,14 @@ public:
sk_sp<SkSpecialImage> makeSubset(const SkIRect& subset) const;
/**
- * Extract a subset of this special image and return it as an SkImage.
+ * Create an SkImage from the contents of this special image optionally extracting a subset.
* It may or may not point to the same backing memory.
- * TODO: switch this to makeSurface once we resolved the naming issue
+ * Note: when no 'subset' parameter is specified the the entire SkSpecialImage will be
+ * returned - including whatever extra padding may have resulted from a loose fit!
+ * When the 'subset' parameter is specified the returned image will be tight even if that
+ * entails a copy!
*/
- sk_sp<SkImage> makeTightSubset(const SkIRect& subset) const;
+ sk_sp<SkImage> asImage(const SkIRect* subset = nullptr) const;
// TODO: hide this when GrLayerHoister uses SkSpecialImages more fully (see skbug.com/5063)
/**