aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Base.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-11-14 15:09:56 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-15 15:27:14 +0000
commitc73a1ecbed64652b3d7aa8dc6face9a2205ce830 (patch)
tree59e66c879ca0d1ab68720ccae740cecb2d5660ef /src/image/SkImage_Base.h
parentfd01ce05ef7902c49b0272b3524a389693c72b35 (diff)
Support decoding images to multiple formats, depending on usage
Our codec generator will now preserve any asked-for color space, and convert the encoded data to that representation. Cacherator now allows decoding an image to both legacy (nullptr color space), and color-correct formats. In color-correct mode, we choose the best decoded format, based on the original properties, and our backend's capabilities. Preference is given to the native format, when it's already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer linear F16, and fall back to sRGB when that's not an option. BUG=skia:5907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4438 Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0 Reviewed-on: https://skia-review.googlesource.com/4438 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/image/SkImage_Base.h')
-rw-r--r--src/image/SkImage_Base.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index 7fbe97deac..94bf783ed4 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -52,7 +52,8 @@ public:
// return a read-only copy of the pixels. We promise to not modify them,
// but only inspect them (or encode them).
- virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0;
+ virtual bool getROPixels(SkBitmap*, SkDestinationSurfaceColorMode,
+ CachingHint = kAllow_CachingHint) const = 0;
// Caller must call unref when they are done.
virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&,