diff options
author | 2017-02-18 16:58:09 -0500 | |
---|---|---|
committer | 2017-02-18 23:26:20 +0000 | |
commit | a5fdc974a996dca79be8388e61db68043001760b (patch) | |
tree | 979055d0a831b72a9cc0ca1e2b71a56e6e0696f0 /src/core/SkSpecialImage.h | |
parent | bae888e652dfe5c2ce840eff7760c8ab7317b7d6 (diff) |
Replace SkSpecialImage::makeTightSubset with asImage (take 2)
This is a reland of https://skia-review.googlesource.com/c/8498/ (Replace SkSpecialImage::makeTightSubset with asImage)
It must wait on https://codereview.chromium.org/2702703002/ (Add suppressions for upcoming Skia DEPS roll) due to minor layout test changes
This should allow the relanding of:
https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2))
Change-Id: I7086a419869dbeb62d9b9e9714c796d54e75ee49
Reviewed-on: https://skia-review.googlesource.com/8701
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkSpecialImage.h')
-rw-r--r-- | src/core/SkSpecialImage.h | 9 |
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) /** |