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

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

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fixing bad rebase. Created 5 years, 1 month 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
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 345
346 if (level > fCount) { 346 if (level > fCount) {
347 level = fCount; 347 level = fCount;
348 } 348 }
349 if (levelPtr) { 349 if (levelPtr) {
350 *levelPtr = fLevels[level - 1]; 350 *levelPtr = fLevels[level - 1];
351 } 351 }
352 return true; 352 return true;
353 } 353 }
354
355 int SkMipMap::getLevelsCount() const {
356 return fCount;
357 }
358
359 bool SkMipMap::getLevel(int levelIndex, Level* levelPtr) const {
360 if (NULL == fLevels) {
361 return false;
362 }
363 if (levelIndex <= 0) {
364 return false;
365 }
366 if (levelIndex > fCount) {
bsalomon 2015/10/28 16:40:44 Is there a caller that relies on this clamping beh
cblume 2015/10/28 22:49:40 There is no caller that relies on this. I was mimi
367 levelIndex = fCount;
368 }
369 if (levelPtr) {
370 *levelPtr = fLevels[levelIndex - 1];
371 }
372 return true;
373 }
OLDNEW
« no previous file with comments | « src/core/SkMipMap.h ('k') | src/core/SkMipMapLevel.cpp » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698