| Index: src/gpu/GrTextureParamsAdjuster.cpp
|
| diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
|
| index a91ba8a5e37e65199944393bc30767d60c919cbc..62b2912e0585bef54442b4afa58529c78d6f0b87 100644
|
| --- a/src/gpu/GrTextureParamsAdjuster.cpp
|
| +++ b/src/gpu/GrTextureParamsAdjuster.cpp
|
| @@ -158,7 +158,7 @@ GrTexture* GrTextureAdjuster::refCopy(const CopyParams& copyParams) {
|
| }
|
|
|
| GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrTextureParams& params,
|
| - SkIPoint* outOffset) {
|
| + bool gammaCorrect, SkIPoint* outOffset) {
|
| GrTexture* texture = this->originalTexture();
|
| GrContext* context = texture->getContext();
|
| CopyParams copyParams;
|
| @@ -373,7 +373,8 @@ const GrFragmentProcessor* GrTextureAdjuster::createFragmentProcessor(
|
| const SkRect& origConstraintRect,
|
| FilterConstraint filterConstraint,
|
| bool coordsLimitedToConstraintRect,
|
| - const GrTextureParams::FilterMode* filterOrNullForBicubic) {
|
| + const GrTextureParams::FilterMode* filterOrNullForBicubic,
|
| + bool gammaCorrect) {
|
|
|
| SkMatrix textureMatrix = origTextureMatrix;
|
| const SkIRect* contentArea = this->contentAreaOrNull();
|
| @@ -392,7 +393,7 @@ const GrFragmentProcessor* GrTextureAdjuster::createFragmentProcessor(
|
| if (filterOrNullForBicubic) {
|
| params.setFilterMode(*filterOrNullForBicubic);
|
| }
|
| - SkAutoTUnref<GrTexture> texture(this->refTextureSafeForParams(params, nullptr));
|
| + SkAutoTUnref<GrTexture> texture(this->refTextureSafeForParams(params, gammaCorrect, nullptr));
|
| if (!texture) {
|
| return nullptr;
|
| }
|
| @@ -431,7 +432,7 @@ const GrFragmentProcessor* GrTextureAdjuster::createFragmentProcessor(
|
|
|
| //////////////////////////////////////////////////////////////////////////////
|
|
|
| -GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) {
|
| +GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params, bool gammaCorrect) {
|
| CopyParams copyParams;
|
| bool willBeMipped = params.filterMode() == GrTextureParams::kMipMap_FilterMode;
|
|
|
| @@ -441,7 +442,7 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) {
|
|
|
| if (!fContext->getGpu()->makeCopyForTextureParams(this->width(), this->height(), params,
|
| ©Params)) {
|
| - return this->refOriginalTexture(willBeMipped);
|
| + return this->refOriginalTexture(willBeMipped, gammaCorrect);
|
| }
|
| GrUniqueKey copyKey;
|
| this->makeCopyKey(copyParams, ©Key);
|
| @@ -452,7 +453,7 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) {
|
| }
|
| }
|
|
|
| - GrTexture* result = this->generateTextureForParams(copyParams, willBeMipped);
|
| + GrTexture* result = this->generateTextureForParams(copyParams, willBeMipped, gammaCorrect);
|
| if (!result) {
|
| return nullptr;
|
| }
|
| @@ -469,7 +470,8 @@ const GrFragmentProcessor* GrTextureMaker::createFragmentProcessor(
|
| const SkRect& constraintRect,
|
| FilterConstraint filterConstraint,
|
| bool coordsLimitedToConstraintRect,
|
| - const GrTextureParams::FilterMode* filterOrNullForBicubic) {
|
| + const GrTextureParams::FilterMode* filterOrNullForBicubic,
|
| + bool gammaCorrect) {
|
|
|
| const GrTextureParams::FilterMode* fmForDetermineDomain = filterOrNullForBicubic;
|
| if (filterOrNullForBicubic && GrTextureParams::kMipMap_FilterMode == *filterOrNullForBicubic &&
|
| @@ -490,7 +492,7 @@ const GrFragmentProcessor* GrTextureMaker::createFragmentProcessor(
|
| // Bicubic doesn't use filtering for it's texture accesses.
|
| params.reset(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
|
| }
|
| - SkAutoTUnref<GrTexture> texture(this->refTextureForParams(params));
|
| + SkAutoTUnref<GrTexture> texture(this->refTextureForParams(params, gammaCorrect));
|
| if (!texture) {
|
| return nullptr;
|
| }
|
| @@ -507,8 +509,8 @@ const GrFragmentProcessor* GrTextureMaker::createFragmentProcessor(
|
| }
|
|
|
| GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams,
|
| - bool willBeMipped) {
|
| - SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped));
|
| + bool willBeMipped, bool gammaCorrect) {
|
| + SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gammaCorrect));
|
| if (!original) {
|
| return nullptr;
|
| }
|
|
|