aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrContext.h4
-rw-r--r--include/gpu/GrFontScaler.h5
-rw-r--r--include/gpu/GrKey.h4
-rw-r--r--include/gpu/GrTextContext.h2
-rw-r--r--src/gpu/GrContext.cpp3
-rw-r--r--src/gpu/GrDrawState.h4
-rw-r--r--src/gpu/GrDrawTarget.cpp2
-rw-r--r--src/gpu/GrDrawTarget.h5
-rw-r--r--src/gpu/GrPathRenderer.cpp2
-rw-r--r--src/gpu/GrPathRenderer.h1
-rw-r--r--src/gpu/GrTextStrike.cpp5
-rw-r--r--src/gpu/SkGpuDevice.cpp2
-rw-r--r--src/gpu/gl/GrGLTexture.cpp4
-rw-r--r--src/gpu/gl/GrGLTexture.h5
14 files changed, 43 insertions, 5 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 6a6b0841d1..f5b44bf628 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -36,6 +36,8 @@ class GrSoftwarePathRenderer;
class GR_API GrContext : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrContext)
+
/**
* Creates a GrContext from within a 3D context.
*/
@@ -787,6 +789,8 @@ private:
// Add an existing texture to the texture cache. This is intended solely
// for use with textures released from an GrAutoScratchTexture.
void addExistingTextureToCache(GrTexture* texture);
+
+ typedef GrRefCnt INHERITED;
};
/**
diff --git a/include/gpu/GrFontScaler.h b/include/gpu/GrFontScaler.h
index 657647dea5..a69e91248d 100644
--- a/include/gpu/GrFontScaler.h
+++ b/include/gpu/GrFontScaler.h
@@ -25,12 +25,17 @@ class SkPath;
*/
class GrFontScaler : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrFontScaler)
+
virtual const GrKey* getKey() = 0;
virtual GrMaskFormat getMaskFormat() = 0;
virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
int rowBytes, void* image) = 0;
virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
+
+private:
+ typedef GrRefCnt INHERITED;
};
#endif
diff --git a/include/gpu/GrKey.h b/include/gpu/GrKey.h
index 813d82d920..17d00de1b5 100644
--- a/include/gpu/GrKey.h
+++ b/include/gpu/GrKey.h
@@ -15,6 +15,8 @@
class GrKey : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrKey)
+
typedef intptr_t Hash;
explicit GrKey(Hash hash) : fHash(hash) {}
@@ -34,6 +36,8 @@ protected:
private:
const Hash fHash;
+
+ typedef GrRefCnt INHERITED;
};
#endif
diff --git a/include/gpu/GrTextContext.h b/include/gpu/GrTextContext.h
index ab1a344539..f48b8233e9 100644
--- a/include/gpu/GrTextContext.h
+++ b/include/gpu/GrTextContext.h
@@ -32,6 +32,8 @@ protected:
GrContext* fContext;
public:
+ SK_DECLARE_INST_COUNT(GrTextContext)
+
/**
* To use a text context it must be wrapped in an AutoFinish. AutoFinish's
* destructor ensures all drawing is flushed to the GrContext.
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index a7d9b67026..076079928b 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -27,6 +27,9 @@
#include "SkTLS.h"
#include "SkTrace.h"
+SK_DEFINE_INST_COUNT(GrContext)
+SK_DEFINE_INST_COUNT(GrDrawState)
+
#define DEFER_TEXT_RENDERING 1
#define DEFER_PATHS 1
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 61925cdad7..e4a748fe85 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -21,8 +21,9 @@
class GrDrawState : public GrRefCnt {
-
public:
+ SK_DECLARE_INST_COUNT(GrDrawState)
+
/**
* Number of texture stages. Each stage takes as input a color and
* 2D texture coordinates. The color input to the first enabled stage is the
@@ -879,6 +880,7 @@ private:
// only compared if the color matrix enable flag is set
float fColorMatrix[20]; // 5 x 4 matrix
+ typedef GrRefCnt INHERITED;
};
#endif
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 39ea5bfe39..64dc815277 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -15,6 +15,8 @@
#include "GrTexture.h"
#include "GrVertexBuffer.h"
+SK_DEFINE_INST_COUNT(GrDrawTarget)
+
namespace {
/**
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index f619469f34..d42a1f9bf8 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -27,6 +27,8 @@ class GrVertexBuffer;
class GrDrawTarget : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrDrawTarget)
+
/**
* Represents the draw target capabilities.
*/
@@ -1065,7 +1067,8 @@ private:
};
SkSTArray<kPreallocGeoSrcStateStackCnt,
GeometrySrcState, true> fGeoSrcStateStack;
-
+
+ typedef GrRefCnt INHERITED;
};
GR_MAKE_BITFIELD_OPS(GrDrawTarget::BlendOptFlags);
diff --git a/src/gpu/GrPathRenderer.cpp b/src/gpu/GrPathRenderer.cpp
index 31e06a6b02..1daa6c9f2f 100644
--- a/src/gpu/GrPathRenderer.cpp
+++ b/src/gpu/GrPathRenderer.cpp
@@ -8,6 +8,8 @@
#include "GrPathRenderer.h"
+SK_DEFINE_INST_COUNT(GrPathRenderer)
+
GrPathRenderer::GrPathRenderer() {
}
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 4439f6c3ca..32985be4ab 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -28,6 +28,7 @@ struct GrPoint;
*/
class GR_API GrPathRenderer : public GrRefCnt {
public:
+ SK_DECLARE_INST_COUNT(GrPathRenderer)
/**
* This is called to install custom path renderers in every GrContext at
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index b8762adc11..e61c46e3b8 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -15,6 +15,11 @@
#include "GrTextStrike_impl.h"
#include "GrRect.h"
+SK_DEFINE_INST_COUNT(GrFontScaler)
+SK_DEFINE_INST_COUNT(GrKey)
+
+///////////////////////////////////////////////////////////////////////////////
+
GrFontCache::GrFontCache(GrGpu* gpu) : fGpu(gpu) {
gpu->ref();
fAtlasMgr = NULL;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index d3ca0b5005..c033f01e15 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -23,6 +23,8 @@
#include "SkTLazy.h"
#include "SkUtils.h"
+SK_DEFINE_INST_COUNT(GrTextContext)
+
#define CACHE_COMPATIBLE_DEVICE_TEXTURES 1
#if 0
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index 476d3e7e41..9c6743a3b8 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -5,11 +5,11 @@
* found in the LICENSE file.
*/
-
#include "GrGLTexture.h"
-
#include "GrGpuGL.h"
+SK_DEFINE_INST_COUNT(GrGLTexID)
+
#define GPUGL static_cast<GrGpuGL*>(getGpu())
#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index e408e5db94..8e8c8c5da4 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -16,8 +16,9 @@
* A ref counted tex id that deletes the texture in its destructor.
*/
class GrGLTexID : public GrRefCnt {
-
public:
+ SK_DECLARE_INST_COUNT(GrGLTexID)
+
GrGLTexID(const GrGLInterface* gl, GrGLuint texID, bool ownsID)
: fGL(gl)
, fTexID(texID)
@@ -37,6 +38,8 @@ private:
const GrGLInterface* fGL;
GrGLuint fTexID;
bool fOwnsID;
+
+ typedef GrRefCnt INHERITED;
};
////////////////////////////////////////////////////////////////////////////////