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

Unified Diff: src/core/SkMipMap.h

Issue 19462007: pull mipmap class into its own (private) header (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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.h
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
new file mode 100644
index 0000000000000000000000000000000000000000..77b18bbe8986f9942f2a86679156e33287f8b1ef
--- /dev/null
+++ b/src/core/SkMipMap.h
@@ -0,0 +1,38 @@
+#ifndef SkMipMap_DEFINED
tfarina 2013/07/18 21:02:07 copyright
+#define SkMipMap_DEFINED
+
+#include "SkRefCnt.h"
+#include "SkScalar.h"
+
+class SkBitmap;
+
+class SkMipMap : public SkRefCnt {
+public:
+ static SkMipMap* Build(const SkBitmap& src);
+
+ struct Level {
+ void* fPixels;
+ uint32_t fRowBytes;
+ uint32_t fWidth, fHeight;
+ };
+
+ bool extractLevel(SkScalar scale, Level*) const;
+
+private:
+ Level* fLevels;
+ int fCount;
+
+ // we take ownership of levels, and will free it with sk_free()
+ SkMipMap(Level* levels, int count) : fLevels(levels), fCount(count) {
+ SkASSERT(levels);
+ SkASSERT(count > 0);
+ }
+
+ virtual ~SkMipMap() {
+ sk_free(fLevels);
+ }
+
+ static Level* AllocLevels(int levelCount, size_t pixelSize);
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698