Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: src/gpu/SkGr.cpp

Issue 2177193004: Always supply a color space (sRGB for now) with F16 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix uploading of F16 textures with color spaces Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | tests/TestConfigParsing.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | tests/TestConfigParsing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698