diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-20 17:51:13 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-20 17:51:13 +0000 |
commit | 9927bd355fc1557aa2c98900266ba6f49f806889 (patch) | |
tree | fb8a1aa256031cfa3061cc35045e0e664a4a8295 /src/gpu/effects/GrBicubicEffect.h | |
parent | 97133ade536f6333a2dbaec8be6f8347bb12bd79 (diff) |
Centralize decision about whether to do bicubic filtering, and fallbacks to mip, bilerp, or nearest
R=robertphillips@google.com, humper@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/282293004
git-svn-id: http://skia.googlecode.com/svn/trunk@14809 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/effects/GrBicubicEffect.h')
-rw-r--r-- | src/gpu/effects/GrBicubicEffect.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h index cc8b120863..1998e68780 100644 --- a/src/gpu/effects/GrBicubicEffect.h +++ b/src/gpu/effects/GrBicubicEffect.h @@ -78,6 +78,16 @@ public: return CreateEffectRef(effect); } + /** + * Determines whether the bicubic effect should be used based on the transformation from the + * local coords to the device. Returns true if the bicubic effect should be used. filterMode + * is set to appropriate filtering mode to use regardless of the return result (e.g. when this + * returns false it may indicate that the best fallback is to use kMipMap, kBilerp, or + * kNearest). + */ + static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice, + GrTextureParams::FilterMode* filterMode); + private: GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], const SkMatrix &matrix, const SkShader::TileMode tileModes[2]); |