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

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: address comments from #4 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
« no previous file with comments | « src/core/SkPixmap.cpp ('k') | tests/MipMapTest.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 fb2916daff117fe697aa4633b5b50f70e2779272..0bb02691a58dd92820cdc2381d001341aa58430b 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -345,11 +345,10 @@ 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;
- }
+ /*
+ * TODO: determine when we want respect -vs- (compatible) ignore
Brian Osman 2016/06/07 16:10:30 gammaTreatment is now passed into this function, s
reed1 2016/06/07 19:43:37 Doh!
+ */
+ SkSourceGammaTreatment treatment = SkSourceGammaTreatment::kIgnore;
SkASSERT(sizeof(int) <= sizeof(uint32_t));
if (bitmap.width() < 0 || bitmap.height() < 0) {
@@ -366,7 +365,7 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
sk_throw();
}
- SkAutoTDelete<SkMipMap> mipmaps(SkMipMap::Build(pixmap, nullptr));
+ SkAutoTDelete<SkMipMap> mipmaps(SkMipMap::Build(pixmap, treatment, nullptr));
if (!mipmaps) {
return nullptr;
}
« no previous file with comments | « src/core/SkPixmap.cpp ('k') | tests/MipMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698