aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/core/SkAdvancedTypefaceMetrics.h5
-rw-r--r--include/core/SkBitmap.h4
-rw-r--r--include/core/SkBounder.h2
-rw-r--r--include/core/SkCanvas.h4
-rw-r--r--include/core/SkData.h4
-rw-r--r--include/core/SkDevice.h4
-rw-r--r--include/core/SkDeviceProfile.h4
-rw-r--r--include/core/SkDrawFilter.h3
-rw-r--r--include/core/SkFlattenable.h4
-rw-r--r--include/core/SkInstCnt.h11
-rw-r--r--include/core/SkPicture.h4
-rw-r--r--include/core/SkPtrRecorder.h2
-rw-r--r--include/core/SkStream.h5
-rw-r--r--include/core/SkWeakRefCnt.h2
-rw-r--r--include/gpu/GrCustomStage.h2
-rw-r--r--include/gpu/gl/GrGLInterface.h4
-rw-r--r--include/gpu/gl/SkGLContext.h4
-rw-r--r--include/images/SkImageDecoder.h14
-rw-r--r--include/images/SkMovie.h4
-rw-r--r--include/text/SkTextLayout.h4
20 files changed, 85 insertions, 5 deletions
diff --git a/include/core/SkAdvancedTypefaceMetrics.h b/include/core/SkAdvancedTypefaceMetrics.h
index 5ffdb459a8..d326379a50 100755
--- a/include/core/SkAdvancedTypefaceMetrics.h
+++ b/include/core/SkAdvancedTypefaceMetrics.h
@@ -26,6 +26,8 @@
class SkAdvancedTypefaceMetrics : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkAdvancedTypefaceMetrics)
+
SkString fFontName;
enum FontType {
@@ -112,6 +114,9 @@ public:
// The mapping from glyph to Unicode, only populated if
// kToUnicode_PerGlyphInfo is passed to GetAdvancedTypefaceMetrics.
SkTDArray<SkUnichar> fGlyphToUnicode;
+
+private:
+ typedef SkRefCnt INHERITED;
};
namespace skia_advanced_typeface_metrics_utils {
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 514357f6cc..8515b4601e 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -558,6 +558,8 @@ public:
class Allocator : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(Allocator)
+
/** Allocate the pixel memory for the bitmap, given its dimensions and
config. Return true on success, where success means either setPixels
or setPixelRef was called. The pixels need not be locked when this
@@ -566,6 +568,8 @@ public:
colortable should be left unchanged.
*/
virtual bool allocPixelRef(SkBitmap*, SkColorTable*) = 0;
+ private:
+ typedef SkRefCnt INHERITED;
};
/** Subclass of Allocator that returns a pixelref that allocates its pixel
diff --git a/include/core/SkBounder.h b/include/core/SkBounder.h
index 5bac358bfe..08cef2d59f 100644
--- a/include/core/SkBounder.h
+++ b/include/core/SkBounder.h
@@ -84,6 +84,8 @@ private:
friend class SkDrawIter;
friend struct Draw1Glyph;
friend class SkMaskFilter;
+
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index d942783a7f..fc95f9ae6c 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -44,6 +44,8 @@ class SkPicture;
*/
class SK_API SkCanvas : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkCanvas)
+
SkCanvas();
/** Construct a canvas with the specified device to draw into.
@@ -1058,6 +1060,8 @@ private:
#else
void validateClip() const {}
#endif
+
+ typedef SkRefCnt INHERITED;
};
/** Stack helper class to automatically call restoreToCount() on the canvas
diff --git a/include/core/SkData.h b/include/core/SkData.h
index 76b4457373..8bbe3c89a9 100644
--- a/include/core/SkData.h
+++ b/include/core/SkData.h
@@ -20,6 +20,8 @@
*/
class SkData : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkData)
+
/**
* Returns the number of bytes stored.
*/
@@ -91,6 +93,8 @@ private:
SkData(const void* ptr, size_t size, ReleaseProc, void* context);
~SkData();
+
+ typedef SkRefCnt INHERITED;
};
/**
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index b4d44bf7b6..688ce8ef40 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -27,6 +27,8 @@ class SkGpuRenderTarget;
class SK_API SkDevice : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkDevice)
+
/**
* Construct a new device with the specified bitmap as its backend. It is
* valid for the bitmap to have no pixels associated with it. In that case,
@@ -387,6 +389,8 @@ private:
SkBitmap fBitmap;
SkIPoint fOrigin;
SkMetaData* fMetaData;
+
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/core/SkDeviceProfile.h b/include/core/SkDeviceProfile.h
index 46b9781f93..49214c59ac 100644
--- a/include/core/SkDeviceProfile.h
+++ b/include/core/SkDeviceProfile.h
@@ -12,6 +12,8 @@
class SkDeviceProfile : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkDeviceProfile)
+
enum LCDConfig {
kNone_LCDConfig, // disables LCD text rendering, uses A8 instead
kRGB_Horizontal_LCDConfig,
@@ -89,6 +91,8 @@ private:
float fContrastScale;
LCDConfig fLCDConfig;
FontHintLevel fFontHintLevel;
+
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h
index 303b80ed80..39b1717617 100644
--- a/include/core/SkDrawFilter.h
+++ b/include/core/SkDrawFilter.h
@@ -38,6 +38,9 @@ public:
* The implementation may modify the paint as they wish.
*/
virtual void filter(SkPaint*, Type) = 0;
+
+private:
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 57019670fe..e6c56a330e 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -68,6 +68,8 @@ class SkString;
*/
class SK_API SkFlattenable : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkFlattenable)
+
typedef SkFlattenable* (*Factory)(SkFlattenableReadBuffer&);
SkFlattenable() {}
@@ -104,6 +106,8 @@ private:
friend class SkGraphics;
friend class SkFlattenableWriteBuffer;
+
+ typedef SkRefCnt INHERITED;
};
// helpers for matrix and region
diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h
index e5c44db11c..087d5a7431 100644
--- a/include/core/SkInstCnt.h
+++ b/include/core/SkInstCnt.h
@@ -31,7 +31,7 @@
#define SK_DECLARE_INST_COUNT_INTERNAL(className, initStep) \
class SkInstanceCountHelper { \
public: \
- typedef void (*PFCheckInstCnt)(); \
+ typedef void (*PFCheckInstCnt)(int level); \
SkInstanceCountHelper() { \
if (!gInited) { \
initStep \
@@ -57,13 +57,14 @@
return SkInstanceCountHelper::gInstanceCount; \
} \
\
- static void CheckInstanceCount() { \
+ static void CheckInstanceCount(int level = 0) { \
if (0 != SkInstanceCountHelper::gInstanceCount) { \
- SkDebugf("Leaked %s objects: %d\n", #className, \
+ SkDebugf("%*c Leaked %s objects: %d\n", \
+ 4*level, ' ', #className, \
SkInstanceCountHelper::gInstanceCount); \
} \
- for (int i = 0; i < SkInstanceCountHelper::gChildren.count(); ++i) { \
- (*SkInstanceCountHelper::gChildren[i])(); \
+ for (int i = 0; i < SkInstanceCountHelper::gChildren.count(); ++i) {\
+ (*SkInstanceCountHelper::gChildren[i])(level+1); \
} \
} \
\
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 21a4fcc492..51ed0d71ac 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -26,6 +26,8 @@ class SkWStream;
*/
class SK_API SkPicture : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkPicture)
+
/** The constructor prepares the picture to record.
@param width the width of the virtual device the picture records.
@param height the height of the virtual device the picture records.
@@ -130,6 +132,8 @@ private:
friend class SkFlatPicture;
friend class SkPicturePlayback;
+
+ typedef SkRefCnt INHERITED;
};
class SkAutoPictureRecord : SkNoncopyable {
diff --git a/include/core/SkPtrRecorder.h b/include/core/SkPtrRecorder.h
index 2df84b245a..360471fc0c 100644
--- a/include/core/SkPtrRecorder.h
+++ b/include/core/SkPtrRecorder.h
@@ -21,6 +21,8 @@
*/
class SkPtrSet : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkPtrSet)
+
/**
* Search for the specified ptr in the set. If it is found, return its
* 32bit ID [1..N], or if not found, return 0. Always returns 0 for NULL.
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 67512d7700..58f5443aff 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -17,6 +17,8 @@ class SkData;
class SK_API SkStream : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkStream)
+
virtual ~SkStream();
/** Called to rewind to the beginning of the stream. If this cannot be
done, return false.
@@ -63,6 +65,9 @@ public:
bool readBool() { return this->readU8() != 0; }
SkScalar readScalar();
size_t readPackedUInt();
+
+private:
+ typedef SkRefCnt INHERITED;
};
class SK_API SkWStream : SkNoncopyable {
diff --git a/include/core/SkWeakRefCnt.h b/include/core/SkWeakRefCnt.h
index 50760e2e2b..a407623068 100644
--- a/include/core/SkWeakRefCnt.h
+++ b/include/core/SkWeakRefCnt.h
@@ -150,6 +150,8 @@ private:
/* Invariant: fWeakCnt = #weak + (fRefCnt > 0 ? 1 : 0) */
mutable int32_t fWeakCnt;
+
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/gpu/GrCustomStage.h b/include/gpu/GrCustomStage.h
index 5eea9f4929..1c2cc9f5a6 100644
--- a/include/gpu/GrCustomStage.h
+++ b/include/gpu/GrCustomStage.h
@@ -22,6 +22,8 @@ class GrContext;
class GrCustomStage : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrCustomStage)
+
typedef GrProgramStageFactory::StageKey StageKey;
GrCustomStage();
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 1827dc2c1b..c627b90fd6 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -119,7 +119,11 @@ private:
FNPTR_TYPE fPtr;
};
+ typedef GrRefCnt INHERITED;
+
public:
+ SK_DECLARE_INST_COUNT(GrGLInterface)
+
GrGLInterface();
// Validates that the GrGLInterface supports a binding. This means that
diff --git a/include/gpu/gl/SkGLContext.h b/include/gpu/gl/SkGLContext.h
index e2ac7e0885..b8b6b6e85d 100644
--- a/include/gpu/gl/SkGLContext.h
+++ b/include/gpu/gl/SkGLContext.h
@@ -18,6 +18,8 @@
class SkGLContext : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkGLContext)
+
SkGLContext();
virtual ~SkGLContext();
@@ -54,6 +56,8 @@ private:
GrGLuint fColorBufferID;
GrGLuint fDepthStencilBufferID;
const GrGLInterface* fGL;
+
+ typedef SkRefCnt INHERITED;
};
/**
diff --git a/include/images/SkImageDecoder.h b/include/images/SkImageDecoder.h
index d0c4d21ddc..a8ec1c6518 100644
--- a/include/images/SkImageDecoder.h
+++ b/include/images/SkImageDecoder.h
@@ -56,10 +56,14 @@ public:
*/
class Peeker : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(Peeker)
+
/** Return true to continue decoding, or false to indicate an error, which
will cause the decoder to not return the image.
*/
virtual bool peek(const char tag[], const void* data, size_t length) = 0;
+ private:
+ typedef SkRefCnt INHERITED;
};
Peeker* getPeeker() const { return fPeeker; }
@@ -72,11 +76,16 @@ public:
*/
class Chooser : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(Chooser)
+
virtual void begin(int count) {}
virtual void inspect(int index, SkBitmap::Config config, int width, int height) {}
/** Return the index of the subimage you want, or -1 to choose none of them.
*/
virtual int choose() = 0;
+
+ private:
+ typedef SkRefCnt INHERITED;
};
Chooser* getChooser() const { return fChooser; }
@@ -321,7 +330,12 @@ private:
*/
class SkImageDecoderFactory : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkImageDecoderFactory)
+
virtual SkImageDecoder* newDecoder(SkStream*) = 0;
+
+private:
+ typedef SkRefCnt INHERITED;
};
class SkDefaultImageDecoderFactory : SkImageDecoderFactory {
diff --git a/include/images/SkMovie.h b/include/images/SkMovie.h
index f52a78638e..cecad29a31 100644
--- a/include/images/SkMovie.h
+++ b/include/images/SkMovie.h
@@ -17,6 +17,8 @@ class SkStream;
class SkMovie : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkMovie)
+
/** Try to create a movie from the stream. If the stream format is not
supported, return NULL.
*/
@@ -71,6 +73,8 @@ private:
bool fNeedBitmap;
void ensureInfo();
+
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/text/SkTextLayout.h b/include/text/SkTextLayout.h
index e1e3e563e8..3b123343e8 100644
--- a/include/text/SkTextLayout.h
+++ b/include/text/SkTextLayout.h
@@ -13,6 +13,8 @@
class SkTextStyle : public SkRefCnt {
public:
+ SK_DECLARE_INST_COUNT(SkTextStyle)
+
SkTextStyle();
SkTextStyle(const SkTextStyle&);
explicit SkTextStyle(const SkPaint&);
@@ -25,6 +27,8 @@ public:
private:
SkPaint fPaint;
+
+ typedef SkRefCnt INHERITED;
};
class SkTextLayout {