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

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: Created 5 years, 5 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 032a60d0f1f6b420cc674b389f0ae7db8f178cb7..69c58547af6b20de53a46c8eb246c2aa6d01d619 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) {
+ levelIndex = fCount;
+ }
+ if (levelPtr) {
+ *levelPtr = fLevels[levelIndex - 1];
+ }
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698