aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-16 21:02:29 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-16 21:02:29 +0000
commit79b7eeebdff3bfae8a517dc2e4763bc2c7f81557 (patch)
treec0e228fbd5146132ad52aaa7c134c9f2d502ede8 /src/gpu
parent02076831575a6d4706e1aa0c14a25508f173de88 (diff)
Tweaks in how to apply bitmap filter levels in GPU.
Fix fallback to MIP from bicubic for bitmap shaders Skip MIP level generation on GPU when not minifying Add medium quality and mixed up/down matrix test cases to filterbitmap tests R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/103913012 git-svn-id: http://skia.googlecode.com/svn/trunk@12697 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGpuDevice.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a0692d09b2..71d0ebf29e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1204,9 +1204,14 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw,
break;
case SkPaint::kMedium_FilterLevel:
tileFilterPad = 1;
- textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ if (fContext->getMatrix().getMinStretch() < SK_Scalar1) {
+ textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ } else {
+ // Don't trigger MIP level generation unnecessarily.
+ textureFilterMode = GrTextureParams::kBilerp_FilterMode;
+ }
break;
- case SkPaint::kHigh_FilterLevel: {
+ case SkPaint::kHigh_FilterLevel:
// Minification can look bad with the bicubic effect.
if (fContext->getMatrix().getMinStretch() >= SK_Scalar1) {
// We will install an effect that does the filtering in the shader.
@@ -1214,13 +1219,10 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw,
tileFilterPad = GrBicubicEffect::kFilterTexelPad;
doBicubic = true;
} else {
- // We don't yet support doing bicubic filtering with an interior clamp. Fall back
- // to MIPs
textureFilterMode = GrTextureParams::kMipMap_FilterMode;
tileFilterPad = 1;
}
break;
- }
default:
SkErrorInternals::SetError( kInvalidPaint_SkError,
"Sorry, I don't understand the filtering "