aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMipMap.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-10-03 13:23:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-03 13:23:31 -0700
commit37c5a815d8ea33247968212ef4cc83394ceee1bc (patch)
tree549847a55767b6deea8428b66068e82b43af13c0 /src/core/SkMipMap.h
parent9e96aa07dbf1210fd35ae8e0c54d4d9822544e89 (diff)
Speculative revert to diagnose crash in chrome. Revert "Add SkCachedData and use it for SkMipMap"
Diffstat (limited to 'src/core/SkMipMap.h')
-rw-r--r--src/core/SkMipMap.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
index 4e83b12b3e..ed912ba976 100644
--- a/src/core/SkMipMap.h
+++ b/src/core/SkMipMap.h
@@ -8,17 +8,14 @@
#ifndef SkMipMap_DEFINED
#define SkMipMap_DEFINED
-#include "SkCachedData.h"
+#include "SkRefCnt.h"
#include "SkScalar.h"
class SkBitmap;
-class SkDiscardableMemory;
-typedef SkDiscardableMemory* (*SkDiscardableFactoryProc)(size_t bytes);
-
-class SkMipMap : public SkCachedData {
+class SkMipMap : public SkRefCnt {
public:
- static SkMipMap* Build(const SkBitmap& src, SkDiscardableFactoryProc);
+ static SkMipMap* Build(const SkBitmap& src);
struct Level {
void* fPixels;
@@ -29,22 +26,18 @@ public:
bool extractLevel(SkScalar scale, Level*) const;
-protected:
- virtual void onDataChange(void* oldData, void* newData) SK_OVERRIDE {
- fLevels = (Level*)newData; // could be NULL
- }
+ 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(void* malloc, size_t size) : INHERITED(malloc, size) {}
- SkMipMap(size_t size, SkDiscardableMemory* dm) : INHERITED(size, dm) {}
-
- static size_t AllocLevelsSize(int levelCount, size_t pixelSize);
+ SkMipMap(Level* levels, int count, size_t size);
+ virtual ~SkMipMap();
- typedef SkCachedData INHERITED;
+ static Level* AllocLevels(int levelCount, size_t pixelSize);
};
#endif