commit | eb3429c6cdcf77ff24eaa74ab9fcf802abd160e2 | [log] [tgz] |
---|---|---|
author | brianosman <brianosman@google.com> | Fri Mar 25 13:03:03 2016 -0700 |
committer | Commit bot <commit-bot@chromium.org> | Fri Mar 25 13:03:03 2016 -0700 |
tree | d744e562de633a4e8b05b08cbd4a341a4bd9ae48 | |
parent | ec4d4d784dbb250e572f8e04d18d0fd2ebeee851 [diff] [blame] |
Re-enable CPU mipmap generation for Ganesh. Aniso mips were landed a while ago. However, the CPU builder fails when it sees Index8 (among other things), so change the code to fallback to GPU in that case. Additionally, if we're going to be mipping an sRGB image, don't use the CPU code (which is not yet gamma correct). Unfortunately, this means that we will often be using the GPU path, still - with recent codec changes, most images are coming in tagged as sRGB. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1835003002 Committed: https://skia.googlesource.com/skia/+/b0ac1af7fab467aacbc27d20d14a09bcb960472f Review URL: https://codereview.chromium.org/1835003002
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 701e763..71d9e62 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp
@@ -344,6 +344,12 @@ return texture; } + // SkMipMap::Build doesn't handle sRGB data correctly (yet). + // Failover to the GL code-path for now. + if (kLinear_SkColorProfileType != bitmap.profileType()) { + return nullptr; + } + SkASSERT(sizeof(int) <= sizeof(uint32_t)); if (bitmap.width() < 0 || bitmap.height() < 0) { return nullptr;