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

Unified Diff: src/core/SkMipMap.cpp

Issue 1131613002: use floor for mip-level choice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | 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 1b410856e4ed07d7a134897f4bb43fdae6327d52..8f38ede7f3d72a8a770f6421433613888b90763c 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -334,8 +334,13 @@ bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const {
return false;
}
SkASSERT(L >= 0);
+#ifdef SK_SUPPORT_LEGACY_ROUND_MIPMAP_LEVEL_CHOICE
int level = SkScalarRoundToInt(L);
-// SkDebugf("mipmap scale=%g L=%g level=%d\n", scale, L, level);
+#else
+// int rndLevel = SkScalarRoundToInt(L);
+ int level = SkScalarFloorToInt(L);
+#endif
+// SkDebugf("mipmap scale=%g L=%g level=%d rndLevel=%d\n", scale, L, level, rndLevel);
SkASSERT(level >= 0);
if (level <= 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698