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

Unified Diff: src/core/SkMipMap.h

Issue 1639693002: Adding direct access to SkMipMap levels. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removing comparisons of ComputeLevelCoutn and Build's level coutn, since that comparison is already… Created 4 years, 10 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
« no previous file with comments | « no previous file | src/core/SkMipMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMipMap.h
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
index fe2018c670ceb83d89bce9f30c159578a7d2e64a..928c12d4369dd0a0e646c0fbe68ee276c373e251 100644
--- a/src/core/SkMipMap.h
+++ b/src/core/SkMipMap.h
@@ -23,12 +23,18 @@ public:
static SkMipMap* Build(const SkPixmap& src, SkDiscardableFactoryProc);
static SkMipMap* Build(const SkBitmap& src, SkDiscardableFactoryProc);
+ // This function lets you determine how many levels a SkMipMap will have without
+ // creating that mipmap.
+ static int ComputeLevelCount(int baseWidth, int baseHeight);
+
struct Level {
SkPixmap fPixmap;
SkSize fScale; // < 1.0
};
bool extractLevel(const SkSize& scale, Level*) const;
+ int countLevels() const;
+ bool getLevel(int index, Level*) const;
protected:
void onDataChange(void* oldData, void* newData) override {
« no previous file with comments | « no previous file | src/core/SkMipMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698