Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index cf36b3a7ccbcccf579465411fdebad0cab234bf7..7a5726f9509f3e25e7601186176f302da4b42394 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -243,8 +243,11 @@ GrTexture* GrUploadPixmapToTexture(GrContext* ctx, const SkPixmap& pixmap, SkBud |
const GrCaps* caps = ctx->caps(); |
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(pixmap.info(), *caps); |
- if (caps->srgbSupport() && !GrPixelConfigIsSRGB(desc.fConfig) && |
- pixmap.info().colorSpace() && pixmap.info().colorSpace()->gammaCloseToSRGB()) { |
+ if (caps->srgbSupport() && |
+ pixmap.info().colorSpace() && pixmap.info().colorSpace()->gammaCloseToSRGB() && |
+ !(GrPixelConfigIsSRGB(desc.fConfig) || |
+ kRGBA_half_GrPixelConfig == desc.fConfig || |
+ kRGBA_float_GrPixelConfig == desc.fConfig)) { |
// We were supplied an sRGB-like color space, but we don't have a suitable pixel config. |
// Convert to 8888 sRGB so we can handle the data correctly. The raster backend doesn't |
// handle sRGB Index8 -> sRGB 8888 correctly (yet), so lie about both the source and |