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

Unified Diff: src/gpu/SkGr.cpp

Issue 2029373004: respect srgb gamma when building mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Need to know when we're in L32 compatibility mode !!!? Created 4 years, 6 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
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 2127c367444cf86e7e58584556187d6e4368a3d9..4906cbbdcfc5bcbce1d2a0d2adfe9102dcb4780f 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -344,10 +344,9 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
return texture.release();
}
- // SkMipMap::Build doesn't handle sRGB data correctly (yet).
- // Failover to the GL code-path for now.
- if (kLinear_SkColorProfileType != bitmap.profileType()) {
- return nullptr;
+ SkMipMap::SrcGammaMode mode = SkMipMap::kRespect_SrcGammaMode;
+ if (/* we're in compatibility-mode-for-L32*/true) {
+ mode = SkMipMap::kIgnore_SrcGammaMode;
}
SkASSERT(sizeof(int) <= sizeof(uint32_t));
@@ -365,7 +364,7 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
sk_throw();
}
- SkAutoTDelete<SkMipMap> mipmaps(SkMipMap::Build(pixmap, nullptr));
+ SkAutoTDelete<SkMipMap> mipmaps(SkMipMap::Build(pixmap, mode, nullptr));
if (!mipmaps) {
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698