Chromium Code Reviews| 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 |