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

Unified 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, 2 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
Index: src/core/SkMipMap.cpp
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index 6e0aaed6973e174e0359d607e7305e299c3ed1cc..a01441369834e58bf9795f8eea0d61d62322f63c 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -351,3 +351,23 @@ bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const {
}
return true;
}
+
+int SkMipMap::getLevelsCount() const {
+ return fCount;
+}
+
+bool SkMipMap::getLevel(int levelIndex, Level* levelPtr) const {
+ if (NULL == fLevels) {
+ return false;
+ }
+ if (levelIndex <= 0) {
+ return false;
+ }
+ 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
+ levelIndex = fCount;
+ }
+ if (levelPtr) {
+ *levelPtr = fLevels[levelIndex - 1];
+ }
+ return true;
+}
« 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