Index: src/core/SkMipMap.cpp |
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp |
index 7266dc6b21192c16019c0277ea4387244033d209..aaf9fdb055066b2b31e2d967cf1e1659b31c8c31 100644 |
--- a/src/core/SkMipMap.cpp |
+++ b/src/core/SkMipMap.cpp |
@@ -326,6 +326,16 @@ bool SkMipMap::extractLevel(const SkSize& scaleSize, Level* levelPtr) const { |
} |
SkASSERT(scaleSize.width() >= 0 && scaleSize.height() >= 0); |
+ |
+#ifndef SK_SUPPORT_LEGACY_ANISOTROPIC_MIPMAPS |
+ const SkScalar kMaxScaleRatio = 0.25f; |
+ if (SkScalarAbs(scaleSize.width() / scaleSize.height() - 1) > kMaxScaleRatio) { |
reed1
2016/02/16 16:41:31
- The minus-1 is a little confusing
I would have
|
+ // Mipmaps produce bad results for extremely anisotropic scales |
+ // (https://bugs.chromium.org/p/skia/issues/detail?id=4863). Fall back to lerp. |
+ return false; |
+ } |
+#endif |
+ |
// Use the smallest scale to match the GPU impl. |
const SkScalar scale = SkTMin(scaleSize.width(), scaleSize.height()); |