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

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: Making negative test assert SkMipMap::Build returned null 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
« no previous file with comments | « no previous file | src/core/SkMipMap.cpp » ('j') | src/core/SkMipMap.cpp » ('J')
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 bc6d154939a44c58cd4f0d3b8aa625f18ccfc5b8..51ceda5feb1c7c5f1de468384832efbbd4fd58ee 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 mipmap will have without
+ // creating that mipmap.
+ static int ComputeLevelCount(int baseWidth, int baseHeight);
reed1 2016/02/05 22:37:11 Its odd that this returns a different value (+1) f
cblume 2016/02/06 13:38:16 Done.
+
struct Level {
SkPixmap fPixmap;
SkSize fScale; // < 1.0
};
bool extractLevel(SkScalar scale, Level*) const;
+ int countLevels() const;
+ void 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') | src/core/SkMipMap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698