diff options
author | 2016-03-17 12:26:37 -0700 | |
---|---|---|
committer | 2016-03-17 12:26:37 -0700 | |
commit | 9e3f1bf4e5cd8fc59554f986f36d6b034e99f9eb (patch) | |
tree | 15fc5d36dc3c97fbcb8e634d23f3a87fe48685bc /include/gpu/SkGr.h | |
parent | 0e3129d734212089f872f0e7de8f2537861a3f89 (diff) |
sRGB support in Ganesh. Several pieces:
sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows
us to disable sRGB -> Linear conversion when reading textures. This gives
us an easy way to support "legacy" L32 mode. We disable decoding based on
the pixel config of the render target. Textures can override that behavior
(specifically for format-conversion draws where we want that behavior).
Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA
internally, and the external format is BGR order, so TexImage calls will
swizzle correctly. This lets us interact with sRGB raster surfaces on BGR
platforms.
Devices without sRGB support behave like they always have: conversion from
color type and profile type ignores sRGB and always returns linear pixel
configs.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789663002
Review URL: https://codereview.chromium.org/1789663002
Diffstat (limited to 'include/gpu/SkGr.h')
-rw-r--r-- | include/gpu/SkGr.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h index aacc5d25db..6a73636c69 100644 --- a/include/gpu/SkGr.h +++ b/include/gpu/SkGr.h @@ -15,6 +15,7 @@ #include "SkFilterQuality.h" #include "SkImageInfo.h" +class GrCaps; class GrContext; class GrTexture; class GrTextureParams; @@ -70,10 +71,10 @@ static inline GrColor SkPMColorToGrColor(SkPMColor c) { GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTextureParams&); // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWindow its subclasses). -GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfileType); +GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfileType, const GrCaps&); -static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) { - return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.profileType()); +static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info, const GrCaps& caps) { + return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.profileType(), caps); } GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality, |