diff options
author | Brian Osman <brianosman@google.com> | 2017-02-07 11:23:28 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-07 16:58:07 +0000 |
commit | 041f7dfc577822f1e97721a865f86a9a02660cf9 (patch) | |
tree | e97779c04ea0d2059cbd6291de3cbfbf27c1cc61 /include | |
parent | 2bb94e814726cbe8e0a6a5763e262a5ccea9313c (diff) |
Bring back SkImage::makeTextureImage
Ensures that an image is GPU backed on the passed-in GrContxt. The new
version requires a destination color space (intended usage of the image),
so we can make a proper decision about decoded format.
This reverts commit d263413a2a92cafe3fd3b051c67d00206c9a0e4d.
BUG=skia:
Change-Id: Ibccddbafc301779559592045ed5a5fa9264e7432
Reviewed-on: https://skia-review.googlesource.com/8116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkImage.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h index 2e421c90d1..532708a3d0 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -323,6 +323,14 @@ public: sk_sp<SkImage> makeSubset(const SkIRect& subset) const; /** + * Ensures that an image is backed by a texture (when GrContext is non-null), suitable for use + * with surfaces that have the supplied destination color space. If no transformation is + * required, the returned image may be the same as this image. If this image is from a + * different GrContext, this will fail. + */ + sk_sp<SkImage> makeTextureImage(GrContext*, SkColorSpace* dstColorSpace) const; + + /** * If the image is texture-backed this will make a raster copy of it (or nullptr if reading back * the pixels fails). Otherwise, it returns the original image. */ |