Index: src/gpu/GrTextureParamsAdjuster.cpp |
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp |
index 336ab6b10c4a8f37d9bf96763be57f7144e6c3c7..0d36370d083327b804478cdbfef347e02fc53784 100644 |
--- a/src/gpu/GrTextureParamsAdjuster.cpp |
+++ b/src/gpu/GrTextureParamsAdjuster.cpp |
@@ -410,9 +410,15 @@ const GrFragmentProcessor* GrTextureAdjuster::createFragmentProcessor( |
GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) { |
CopyParams copyParams; |
+ bool willBeMipped = params.filterMode() == GrTextureParams::kMipMap_FilterMode; |
+ |
+ if (!fContext->caps()->mipMapSupport()) { |
+ willBeMipped = false; |
+ } |
+ |
if (!fContext->getGpu()->makeCopyForTextureParams(this->width(), this->height(), params, |
©Params)) { |
- return this->refOriginalTexture(); |
+ return this->refOriginalTexture(willBeMipped); |
} |
GrUniqueKey copyKey; |
this->makeCopyKey(copyParams, ©Key); |
@@ -423,7 +429,7 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) { |
} |
} |
- GrTexture* result = this->generateTextureForParams(copyParams); |
+ GrTexture* result = this->generateTextureForParams(copyParams, willBeMipped); |
if (!result) { |
return nullptr; |
} |
@@ -477,8 +483,9 @@ const GrFragmentProcessor* GrTextureMaker::createFragmentProcessor( |
filterOrNullForBicubic); |
} |
-GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams) { |
- SkAutoTUnref<GrTexture> original(this->refOriginalTexture()); |
+GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams, |
+ bool willBeMipped) { |
+ SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped)); |
if (!original) { |
return nullptr; |
} |