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

Unified Diff: src/gpu/SkGr.cpp

Issue 2058143002: Better (?) interface for controlling sRGB-ness of mipmaps on GrTexture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Set gamma treatment flag appropriately, after uploading CPU mips 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/gpu/GrTexturePriv.h ('k') | src/gpu/gl/GrGLGpu.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 cf50f6004edd6323909a761f5d5684ed6cdc1f2a..c2e284154a584dea54f71f323114a4e7391b5b12 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -14,6 +14,7 @@
#include "GrGpuResourcePriv.h"
#include "GrImageIDTextureAdjuster.h"
#include "GrTextureParamsAdjuster.h"
+#include "GrTexturePriv.h"
#include "GrTypes.h"
#include "GrXferProcessor.h"
#include "GrYUVProvider.h"
@@ -385,8 +386,14 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
texels[i].fRowBytes = generatedMipLevel.fPixmap.rowBytes();
}
- return ctx->textureProvider()->createMipMappedTexture(desc, SkBudgeted::kYes, texels.get(),
- mipLevelCount);
+ {
+ GrTexture* texture = ctx->textureProvider()->createMipMappedTexture(desc,
+ SkBudgeted::kYes,
+ texels.get(),
+ mipLevelCount);
+ texture->texturePriv().setGammaTreatment(gammaTreatment);
+ return texture;
+ }
}
GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
« no previous file with comments | « src/gpu/GrTexturePriv.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698