pull mipmap class into its own (private) header

BUG=
R=scroggo@google.com

Review URL: https://codereview.chromium.org/19462007

git-svn-id: http://skia.googlecode.com/svn/trunk@10161 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
new file mode 100644
index 0000000..77b18bb
--- /dev/null
+++ b/src/core/SkMipMap.h
@@ -0,0 +1,38 @@
+#ifndef SkMipMap_DEFINED
+#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