Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: src/core/SkMipMap.h

Issue 617613003: Speculative revert to diagnose crash in chrome. Revert "Add SkCachedData and use it for SkMipMap" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCachedData.cpp ('k') | src/core/SkMipMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMipMap.h
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h
index 4e83b12b3ed0dbf29bb92d3f7b92b4668a6475de..ed912ba976956400f2e49daa89935808dd6f08db 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
« no previous file with comments | « src/core/SkCachedData.cpp ('k') | src/core/SkMipMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698