aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-26 20:16:17 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-26 20:16:17 +0000
commitfa35e3ddcc9d130ce87c927218bdf27879c38711 (patch)
tree5b15d2c18285d887e2b65fd824bb4afbeb758f71 /src/gpu
parenta23d04820955e2c459956a6610063545d3e8f1aa (diff)
plumb SkInstCnt to all subclasses of GrRefCnt
git-svn-id: http://skia.googlecode.com/svn/trunk@4353 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-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
10 files changed, 28 insertions, 5 deletions
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;
};
////////////////////////////////////////////////////////////////////////////////