aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrImageIDTextureAdjuster.cpp
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-06 13:10:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-06 13:10:58 -0700
commit982eb7f377a0c771345276558072deb2fcea0d3e (patch)
tree02ae878610160d6b6c91629424aaf895e5f17497 /src/gpu/GrImageIDTextureAdjuster.cpp
parentdc27a648d2ff23b2e96232c00c15976c46e1d48d (diff)
Add new SkSourceGammaTreatment enum, used in situations like mipmap construction, where we need to know if we should respect (vs. ignore) the gamma encoding of sRGB tagged images. Plumb that extensively.
Diffstat (limited to 'src/gpu/GrImageIDTextureAdjuster.cpp')
-rw-r--r--src/gpu/GrImageIDTextureAdjuster.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/GrImageIDTextureAdjuster.cpp b/src/gpu/GrImageIDTextureAdjuster.cpp
index 21c2f33358..4ff3ed5d95 100644
--- a/src/gpu/GrImageIDTextureAdjuster.cpp
+++ b/src/gpu/GrImageIDTextureAdjuster.cpp
@@ -81,7 +81,8 @@ GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& b
}
}
-GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped) {
+GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped,
+ SkSourceGammaTreatment gammaTreatment) {
GrTexture* tex = nullptr;
if (fOriginalKey.isValid()) {
@@ -91,7 +92,7 @@ GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped) {
}
}
if (willBeMipped) {
- tex = GrGenerateMipMapsAndUploadToTexture(this->context(), fBitmap);
+ tex = GrGenerateMipMapsAndUploadToTexture(this->context(), fBitmap, gammaTreatment);
}
if (!tex) {
tex = GrUploadBitmapToTexture(this->context(), fBitmap);
@@ -130,8 +131,10 @@ GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator*
}
}
-GrTexture* GrImageTextureMaker::refOriginalTexture(bool willBeMipped) {
- return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint, willBeMipped);
+GrTexture* GrImageTextureMaker::refOriginalTexture(bool willBeMipped,
+ SkSourceGammaTreatment gammaTreatment) {
+ return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint, willBeMipped,
+ gammaTreatment);
}
void GrImageTextureMaker::makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) {