diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/core/SkMipMap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/core/SkMipMap.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,43 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#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; + float fScale; // < 1.0 + }; + + bool extractLevel(SkScalar scale, Level*) const; + + size_t getSize() const { return fSize; } + +private: + size_t fSize; + Level* fLevels; + int fCount; + + // we take ownership of levels, and will free it with sk_free() + SkMipMap(Level* levels, int count, size_t size); + virtual ~SkMipMap(); + + static Level* AllocLevels(int levelCount, size_t pixelSize); +}; + +#endif