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

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: Refactoring the mipmap level count out. Cleaning includes. Created 4 years, 11 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 14e87a33a3ba996e362dc1ed3cba6c164d08b5cf..262fbafab6e3bdfb83acd42c71cdb689f0888f61 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -351,7 +351,7 @@ bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const {
return true;
}
-// Helper which extacts a pixmap from the src bitmap
+// Helper which extracts a pixmap from the src bitmap
//
SkMipMap* SkMipMap::Build(const SkBitmap& src, SkDiscardableFactoryProc fact) {
SkAutoPixmapUnlock srcUnlocker;
@@ -366,3 +366,22 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src, SkDiscardableFactoryProc fact) {
return Build(srcPixmap, fact);
}
+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) {
+ return false;
+ }
+ if (levelPtr) {
+ *levelPtr = fLevels[levelIndex - 1];
+ }
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698