| Index: src/gpu/SkGpuDevice.cpp
|
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
|
| index 406dedb0a7601d8f491510cc5dcb8bd63d2b97ae..ecc18f56582d470c05ce890b7de8afaf3132a32e 100644
|
| --- a/src/gpu/SkGpuDevice.cpp
|
| +++ b/src/gpu/SkGpuDevice.cpp
|
| @@ -80,21 +80,23 @@ public:
|
| AutoBitmapTexture(GrContext* context,
|
| const SkBitmap& bitmap,
|
| const GrTextureParams& params,
|
| + bool gammaCorrect,
|
| GrTexture** texture) {
|
| SkASSERT(texture);
|
| - *texture = this->set(context, bitmap, params);
|
| + *texture = this->set(context, bitmap, params, gammaCorrect);
|
| }
|
|
|
| GrTexture* set(GrContext* context,
|
| const SkBitmap& bitmap,
|
| - const GrTextureParams& params) {
|
| + const GrTextureParams& params,
|
| + bool gammaCorrect) {
|
| // Either get the texture directly from the bitmap, or else use the cache and
|
| // remember to unref it.
|
| if (GrTexture* bmpTexture = bitmap.getTexture()) {
|
| fTexture.reset(nullptr);
|
| return bmpTexture;
|
| } else {
|
| - fTexture.reset(GrRefCachedBitmapTexture(context, bitmap, params));
|
| + fTexture.reset(GrRefCachedBitmapTexture(context, bitmap, params, gammaCorrect));
|
| return fTexture.get();
|
| }
|
| }
|
| @@ -260,7 +262,7 @@ void SkGpuDevice::drawSpriteWithFilter(const SkDraw& draw, const SkBitmap& bitma
|
|
|
| GrTexture* texture;
|
| // draw sprite neither filters nor tiles.
|
| - AutoBitmapTexture abt(fContext, bitmap, GrTextureParams::ClampNoFilter(), &texture);
|
| + AutoBitmapTexture abt(fContext, bitmap, GrTextureParams::ClampNoFilter(), false, &texture);
|
| if (!texture) {
|
| return;
|
| }
|
| @@ -1165,7 +1167,8 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
|
| bitmap.height() <= fContext->caps()->maxTileSize()));
|
|
|
| GrTexture* texture;
|
| - AutoBitmapTexture abt(fContext, bitmap, params, &texture);
|
| + AutoBitmapTexture abt(fContext, bitmap, params, this->surfaceProps().isGammaCorrect(),
|
| + &texture);
|
| if (nullptr == texture) {
|
| return;
|
| }
|
| @@ -1264,7 +1267,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
|
|
|
| GrTexture* texture;
|
| // draw sprite neither filters nor tiles.
|
| - AutoBitmapTexture abt(fContext, bitmap, GrTextureParams::ClampNoFilter(), &texture);
|
| + AutoBitmapTexture abt(fContext, bitmap, GrTextureParams::ClampNoFilter(), false, &texture);
|
| if (!texture) {
|
| return;
|
| }
|
| @@ -1520,15 +1523,15 @@ void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* produc
|
| }
|
|
|
| static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_FilterMode;
|
| + bool gammaCorrect = this->surfaceProps().isGammaCorrect();
|
| SkAutoTUnref<const GrFragmentProcessor> fp(
|
| producer->createFragmentProcessor(SkMatrix::I(),
|
| SkRect::MakeIWH(producer->width(), producer->height()),
|
| GrTextureProducer::kNo_FilterConstraint, true,
|
| - &kMode));
|
| + &kMode, gammaCorrect));
|
| GrPaint grPaint;
|
| if (!SkPaintToGrPaintWithTexture(this->context(), paint, *draw.fMatrix, fp,
|
| - producer->isAlphaOnly(),
|
| - this->surfaceProps().isGammaCorrect(), &grPaint)) {
|
| + producer->isAlphaOnly(), gammaCorrect, &grPaint)) {
|
| return;
|
| }
|
|
|
|
|