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

Side by Side Diff: src/core/SkMipMap.cpp

Issue 1135823003: Remove unused SK_SUPPORT_LEGACY_ROUND_MIPMAP_LEVEL_CHOICE guard (Closed) Base URL: https://chromium.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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMipMap.h" 8 #include "SkMipMap.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 if (scale >= SK_Scalar1 || scale <= 0 || !SkScalarIsFinite(scale)) { 328 if (scale >= SK_Scalar1 || scale <= 0 || !SkScalarIsFinite(scale)) {
329 return false; 329 return false;
330 } 330 }
331 331
332 SkScalar L = -SkScalarLog2(scale); 332 SkScalar L = -SkScalarLog2(scale);
333 if (!SkScalarIsFinite(L)) { 333 if (!SkScalarIsFinite(L)) {
334 return false; 334 return false;
335 } 335 }
336 SkASSERT(L >= 0); 336 SkASSERT(L >= 0);
337 #ifdef SK_SUPPORT_LEGACY_ROUND_MIPMAP_LEVEL_CHOICE
338 int level = SkScalarRoundToInt(L);
339 #else
340 // int rndLevel = SkScalarRoundToInt(L); 337 // int rndLevel = SkScalarRoundToInt(L);
341 int level = SkScalarFloorToInt(L); 338 int level = SkScalarFloorToInt(L);
342 #endif
343 // SkDebugf("mipmap scale=%g L=%g level=%d rndLevel=%d\n", scale, L, level, r ndLevel); 339 // SkDebugf("mipmap scale=%g L=%g level=%d rndLevel=%d\n", scale, L, level, r ndLevel);
344 340
345 SkASSERT(level >= 0); 341 SkASSERT(level >= 0);
346 if (level <= 0) { 342 if (level <= 0) {
347 return false; 343 return false;
348 } 344 }
349 345
350 if (level > fCount) { 346 if (level > fCount) {
351 level = fCount; 347 level = fCount;
352 } 348 }
353 if (levelPtr) { 349 if (levelPtr) {
354 *levelPtr = fLevels[level - 1]; 350 *levelPtr = fLevels[level - 1];
355 } 351 }
356 return true; 352 return true;
357 } 353 }
OLDNEW
« 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