Chromium Code Reviews| 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; |
| } |