Chromium Code Reviews| Index: src/gpu/GrContext.cpp |
| diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
| index 3951d919e62f73939977a9c09beb6ba73d7c521b..72ecc59246537ca517e15b6e3d1e58670239ea4f 100644 |
| --- a/src/gpu/GrContext.cpp |
| +++ b/src/gpu/GrContext.cpp |
| @@ -306,7 +306,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc, |
| const GrCacheID& cacheID, |
| void* srcData, |
| size_t rowBytes, |
| - bool needsFiltering) { |
| + GrTextureParams::FilterMode filterMode) { |
| SkAutoTUnref<GrTexture> clampedTexture(this->findAndRefTexture(desc, cacheID, NULL)); |
| if (NULL == clampedTexture) { |
| clampedTexture.reset(this->createTexture(NULL, desc, cacheID, srcData, rowBytes)); |
| @@ -333,7 +333,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc, |
| // if filtering is not desired then we want to ensure all |
| // texels in the resampled image are copies of texels from |
| // the original. |
| - GrTextureParams params(SkShader::kClamp_TileMode, needsFiltering); |
| + GrTextureParams params(SkShader::kClamp_TileMode, filterMode); |
|
bsalomon
2013/07/25 17:41:48
Actually I think we just want to set knone or kbil
|
| drawState->addColorTextureEffect(clampedTexture, SkMatrix::I(), params); |
| drawState->setVertexAttribs<gVertexAttribs>(SK_ARRAY_COUNT(gVertexAttribs)); |
| @@ -382,9 +382,15 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params, |
| GrTexture* texture; |
| if (GrTexture::NeedsResizing(resourceKey)) { |
| + GrTextureParams::FilterMode textureFilterMode = GrTextureParams::kNone_FilterMode; |
| + if (GrTexture::NeedsBilerp(resourceKey)) { |
| + textureFilterMode = GrTextureParams::kBilerp_FilterMode; |
| + } else if (GrTexture::NeedsMipMap(resourceKey)) { |
| + textureFilterMode = GrTextureParams::kMipMap_FilterMode; |
| + } |
| texture = this->createResizedTexture(desc, cacheID, |
| srcData, rowBytes, |
| - GrTexture::NeedsFiltering(resourceKey)); |
| + textureFilterMode); |
| } else { |
| texture= fGpu->createTexture(desc, srcData, rowBytes); |
| } |