Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 103913012: Tweaks in how to apply bitmap filter levels in GPU. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: upload again, rietveld diff failed. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/core/SkBitmapProcShader.cpp ('K') | « src/core/SkBitmapProcShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a0692d09b248ada7608d70774b61c5241c48d301..71d0ebf29e0081ae7030aee9ea988ed1f5f65b4c 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 "
« src/core/SkBitmapProcShader.cpp ('K') | « src/core/SkBitmapProcShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698