Do not use GrBicubic effect when downscaling. Also, don't use glTexStorage as it interferes with deleyed mipmap generation.
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/105353002
git-svn-id: http://skia.googlecode.com/svn/trunk@12576 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 2555b41..f45572b 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1194,8 +1194,10 @@
tileFilterPad = 1;
textureFilterMode = GrTextureParams::kMipMap_FilterMode;
break;
- case SkPaint::kHigh_FilterLevel:
- if (flags & SkCanvas::kBleed_DrawBitmapRectFlag) {
+ case SkPaint::kHigh_FilterLevel: {
+ // Minification can look bad with the bicubic effect.
+ if (fContext->getMatrix().getMinStretch() >= SK_Scalar1 &&
+ (flags & SkCanvas::kBleed_DrawBitmapRectFlag)) {
// We will install an effect that does the filtering in the shader.
textureFilterMode = GrTextureParams::kNone_FilterMode;
tileFilterPad = GrBicubicEffect::kFilterTexelPad;
@@ -1207,6 +1209,7 @@
tileFilterPad = 1;
}
break;
+ }
default:
SkErrorInternals::SetError( kInvalidPaint_SkError,
"Sorry, I don't understand the filtering "