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

Unified Diff: src/gpu/SkGr.cpp

Issue 2037413002: Add SkSourceGammaTreatment enum so we know how to create mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove leftover comments 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/SkGpuDevice_drawTexture.cpp ('k') | src/gpu/SkGrPriv.h » ('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 60736da5723e430237c6d8b18b60d2831deaf759..5084e11d75d1056b13bad05d48f05c5f958babef 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -329,7 +329,8 @@ void GrInstallBitmapUniqueKeyInvalidator(const GrUniqueKey& key, SkPixelRef* pix
pixelRef->addGenIDChangeListener(new Invalidator(key));
}
-GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& bitmap)
+GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& bitmap,
+ bool gammaCorrect)
Brian Osman 2016/06/06 14:58:29 Here's the flag for the CPU mip-mapping call. We m
{
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps());
if (kIndex_8_SkColorType != bitmap.colorType() && !bitmap.readyToDraw()) {
@@ -403,11 +404,12 @@ GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
}
GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
- const GrTextureParams& params) {
+ const GrTextureParams& params, bool gammaCorrect) {
if (bitmap.getTexture()) {
- return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, nullptr);
+ return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, gammaCorrect,
+ nullptr);
}
- return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params);
+ return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaCorrect);
}
///////////////////////////////////////////////////////////////////////////////
@@ -520,7 +522,7 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
shaderFP = *shaderProcessor;
} else if (const SkShader* shader = skPaint.getShader()) {
aufp.reset(shader->asFragmentProcessor(context, viewM, nullptr,
- skPaint.getFilterQuality()));
+ skPaint.getFilterQuality(), allowSRGBInputs));
shaderFP = aufp;
if (!shaderFP) {
return false;
@@ -692,7 +694,8 @@ bool SkPaintToGrPaintWithTexture(GrContext* context,
shaderFP.reset(shader->asFragmentProcessor(context,
viewM,
nullptr,
- paint.getFilterQuality()));
+ paint.getFilterQuality(),
+ allowSRGBInputs));
if (!shaderFP) {
return false;
}
« no previous file with comments | « src/gpu/SkGpuDevice_drawTexture.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698