gfx/skia/trunk/src/core/SkMipMap.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/core/SkMipMap.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +/*
     1.5 + * Copyright 2013 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef SkMipMap_DEFINED
    1.12 +#define SkMipMap_DEFINED
    1.13 +
    1.14 +#include "SkRefCnt.h"
    1.15 +#include "SkScalar.h"
    1.16 +
    1.17 +class SkBitmap;
    1.18 +
    1.19 +class SkMipMap : public SkRefCnt {
    1.20 +public:
    1.21 +    static SkMipMap* Build(const SkBitmap& src);
    1.22 +
    1.23 +    struct Level {
    1.24 +        void*       fPixels;
    1.25 +        uint32_t    fRowBytes;
    1.26 +        uint32_t    fWidth, fHeight;
    1.27 +        float       fScale; // < 1.0
    1.28 +    };
    1.29 +
    1.30 +    bool extractLevel(SkScalar scale, Level*) const;
    1.31 +
    1.32 +    size_t getSize() const { return fSize; }
    1.33 +
    1.34 +private:
    1.35 +    size_t  fSize;
    1.36 +    Level*  fLevels;
    1.37 +    int     fCount;
    1.38 +
    1.39 +    // we take ownership of levels, and will free it with sk_free()
    1.40 +    SkMipMap(Level* levels, int count, size_t size);
    1.41 +    virtual ~SkMipMap();
    1.42 +
    1.43 +    static Level* AllocLevels(int levelCount, size_t pixelSize);
    1.44 +};
    1.45 +
    1.46 +#endif

mercurial