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

Unified Diff: src/core/SkMipMap.cpp

Issue 1617183004: Anisotropic mipmap fixes (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: SkIntToScalar Created 4 years, 11 months 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
« no previous file with comments | « src/core/SkMipMap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMipMap.cpp
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index 14e87a33a3ba996e362dc1ed3cba6c164d08b5cf..c037865fd49b3f25c555a1eb19d5aa217cd8c6bb 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -297,7 +297,13 @@ SkMipMap* SkMipMap::Build(const SkPixmap& src, SkDiscardableFactoryProc fact) {
rowBytes = SkToU32(SkColorTypeMinRowBytes(ct, width));
levels[i].fPixmap = SkPixmap(SkImageInfo::Make(width, height, ct, at), addr, rowBytes);
- levels[i].fScale = (float)width / src.width();
+#ifdef SK_SUPPORT_LEGACY_ANISOTROPIC_MIPMAPS
+ levels[i].fScale = SkSize::Make(SkIntToScalar(width) / src.width(),
+ SkIntToScalar(width) / src.width());
+#else
+ levels[i].fScale = SkSize::Make(SkIntToScalar(width) / src.width(),
+ SkIntToScalar(height) / src.height());
+#endif
const SkPixmap& dstPM = levels[i].fPixmap;
const void* srcBasePtr = srcPM.addr();
« no previous file with comments | « src/core/SkMipMap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698