aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gm/texdata.cpp2
-rw-r--r--gyp/gpu.gypi1
-rw-r--r--gyp/public_headers.gypi1
-rw-r--r--include/core/SkRefCnt.h7
-rw-r--r--include/gpu/GrContext.h11
-rw-r--r--include/gpu/GrEffect.h7
-rw-r--r--include/gpu/GrFontScaler.h4
-rw-r--r--include/gpu/GrKey.h9
-rw-r--r--include/gpu/GrPathRendererChain.h6
-rw-r--r--include/gpu/GrRefCnt.h33
-rw-r--r--include/gpu/GrResource.h9
-rw-r--r--include/gpu/gl/GrGLInterface.h8
-rw-r--r--src/gpu/GrAARectRenderer.cpp5
-rw-r--r--src/gpu/GrAARectRenderer.h7
-rw-r--r--src/gpu/GrAtlas.cpp2
-rw-r--r--src/gpu/GrContext.cpp12
-rw-r--r--src/gpu/GrDrawState.h7
-rw-r--r--src/gpu/GrDrawTarget.h11
-rw-r--r--src/gpu/GrGpu.cpp4
-rw-r--r--src/gpu/GrGpu.h1
-rw-r--r--src/gpu/GrInOrderDrawBuffer.cpp2
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h2
-rw-r--r--src/gpu/GrOvalRenderer.cpp2
-rw-r--r--src/gpu/GrOvalRenderer.h5
-rw-r--r--src/gpu/GrPathRenderer.h4
-rw-r--r--src/gpu/GrTextContext.cpp2
-rw-r--r--src/gpu/GrTextStrike.cpp2
-rw-r--r--src/gpu/SkGrFontScaler.cpp2
-rw-r--r--src/gpu/SkGrPixelRef.cpp6
-rw-r--r--src/gpu/gl/GrGLContext.cpp4
-rw-r--r--src/gpu/gl/GrGLContext.h2
-rw-r--r--src/gpu/gl/GrGLProgram.h4
-rw-r--r--src/gpu/gl/GrGLTexture.h4
-rw-r--r--tests/ClipCacheTest.cpp2
-rw-r--r--tests/ReadWriteAlphaTest.cpp2
35 files changed, 70 insertions, 122 deletions
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 0e2d7fdeae..b2c7139d85 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -93,7 +93,7 @@ protected:
if (!texture) {
return;
}
- GrAutoUnref au(texture);
+ SkAutoUnref au(texture);
GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S));
diff --git a/gyp/gpu.gypi b/gyp/gpu.gypi
index 810a367ca9..1714759335 100644
--- a/gyp/gpu.gypi
+++ b/gyp/gpu.gypi
@@ -25,7 +25,6 @@
'<(skia_include_path)/gpu/GrPathRendererChain.h',
'<(skia_include_path)/gpu/GrPoint.h',
'<(skia_include_path)/gpu/GrRect.h',
- '<(skia_include_path)/gpu/GrRefCnt.h',
'<(skia_include_path)/gpu/GrRenderTarget.h',
'<(skia_include_path)/gpu/GrResource.h',
'<(skia_include_path)/gpu/GrSurface.h',
diff --git a/gyp/public_headers.gypi b/gyp/public_headers.gypi
index d77034991b..022f679902 100644
--- a/gyp/public_headers.gypi
+++ b/gyp/public_headers.gypi
@@ -34,7 +34,6 @@
'gpu/GrTypes.h',
'gpu/GrFontScaler.h',
'gpu/GrResource.h',
- 'gpu/GrRefCnt.h',
'gpu/GrKey.h',
'gpu/GrOvalRenderer.h',
'gpu/GrEffectUnitTest.h',
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 87ff7dba9f..35f7349778 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -160,6 +160,13 @@ template <typename T> static inline void SkSafeUnref(T* obj) {
}
}
+template<typename T> static inline void SkSafeSetNull(T*& obj) {
+ if (NULL != obj) {
+ obj->unref();
+ obj = NULL;
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
/**
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index ae549b62a2..42413fb13c 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -15,7 +15,6 @@
#include "GrPathRendererChain.h"
#include "GrPoint.h"
#include "GrRenderTarget.h"
-#include "GrRefCnt.h"
#include "GrTexture.h"
class GrAARectRenderer;
@@ -40,7 +39,7 @@ class GrVertexBufferAllocPool;
class GrSoftwarePathRenderer;
class SkStrokeRec;
-class SK_API GrContext : public GrRefCnt {
+class SK_API GrContext : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrContext)
@@ -635,20 +634,20 @@ public:
public:
AutoRenderTarget(GrContext* context, GrRenderTarget* target) {
fPrevTarget = context->getRenderTarget();
- GrSafeRef(fPrevTarget);
+ SkSafeRef(fPrevTarget);
context->setRenderTarget(target);
fContext = context;
}
AutoRenderTarget(GrContext* context) {
fPrevTarget = context->getRenderTarget();
- GrSafeRef(fPrevTarget);
+ SkSafeRef(fPrevTarget);
fContext = context;
}
~AutoRenderTarget() {
if (NULL != fContext) {
fContext->setRenderTarget(fPrevTarget);
}
- GrSafeUnref(fPrevTarget);
+ SkSafeUnref(fPrevTarget);
}
private:
GrContext* fContext;
@@ -934,7 +933,7 @@ private:
*/
static bool OverbudgetCB(void* data);
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
/**
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index a84810c094..b0d336bc00 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -11,7 +11,6 @@
#include "GrColor.h"
#include "GrEffectUnitTest.h"
#include "GrNoncopyable.h"
-#include "GrRefCnt.h"
#include "GrTexture.h"
#include "GrTextureAccess.h"
#include "GrTypesPriv.h"
@@ -74,13 +73,13 @@ private:
member function of a GrEffect subclass.
Because almost no code should ever handle a GrEffect directly outside of a GrEffectRef, we
- privately inherit from GrRefCnt to help prevent accidental direct ref'ing/unref'ing of effects.
+ privately inherit from SkRefCnt to help prevent accidental direct ref'ing/unref'ing of effects.
Dynamically allocated GrEffects and their corresponding GrEffectRefs are managed by a per-thread
memory pool. The ref count of an effect must reach 0 before the thread terminates and the pool
is destroyed. To create a static effect use the macro GR_CREATE_STATIC_EFFECT declared below.
*/
-class GrEffect : private GrRefCnt {
+class GrEffect : private SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrEffect)
@@ -317,7 +316,7 @@ private:
bool fWillReadFragmentPosition;
GrEffectRef* fEffectRef;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
inline GrEffectRef::GrEffectRef(GrEffect* effect) {
diff --git a/include/gpu/GrFontScaler.h b/include/gpu/GrFontScaler.h
index f5dcf53a34..e51c4ac9a5 100644
--- a/include/gpu/GrFontScaler.h
+++ b/include/gpu/GrFontScaler.h
@@ -20,7 +20,7 @@ class SkPath;
* The client is responsible for subclassing, and instantiating this. The
* instance is create for a specific font+size+matrix.
*/
-class GrFontScaler : public GrRefCnt {
+class GrFontScaler : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrFontScaler)
@@ -32,7 +32,7 @@ public:
virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
private:
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/gpu/GrKey.h b/include/gpu/GrKey.h
index 80eb537ca4..e9d6feb453 100644
--- a/include/gpu/GrKey.h
+++ b/include/gpu/GrKey.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,14 +5,10 @@
* found in the LICENSE file.
*/
-
-
#ifndef GrKey_DEFINED
#define GrKey_DEFINED
-#include "GrRefCnt.h"
-
-class GrKey : public GrRefCnt {
+class GrKey : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrKey)
@@ -37,7 +32,7 @@ protected:
private:
const Hash fHash;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/gpu/GrPathRendererChain.h b/include/gpu/GrPathRendererChain.h
index d51a4bbf15..ca8c35bdeb 100644
--- a/include/gpu/GrPathRendererChain.h
+++ b/include/gpu/GrPathRendererChain.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,11 +5,10 @@
* found in the LICENSE file.
*/
-
#ifndef GrPathRendererChain_DEFINED
#define GrPathRendererChain_DEFINED
-#include "GrRefCnt.h"
+#include "SkRefCnt.h"
#include "SkTArray.h"
class GrContext;
@@ -64,7 +62,6 @@ public:
StencilSupport* stencilSupport);
private:
-
GrPathRendererChain();
void init();
@@ -79,5 +76,4 @@ private:
typedef SkRefCnt INHERITED;
};
-
#endif
diff --git a/include/gpu/GrRefCnt.h b/include/gpu/GrRefCnt.h
deleted file mode 100644
index 31aa80dacd..0000000000
--- a/include/gpu/GrRefCnt.h
+++ /dev/null
@@ -1,33 +0,0 @@
-
-/*
- * Copyright 2010 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-
-#ifndef GrRefCnt_DEFINED
-#define GrRefCnt_DEFINED
-
-#include "GrTypes.h"
-#include "SkRefCnt.h"
-
-typedef SkRefCnt GrRefCnt;
-typedef SkAutoRef GrAutoRef;
-typedef SkAutoUnref GrAutoUnref;
-
-#define GrSafeRef SkSafeRef
-#define GrSafeUnref SkSafeUnref
-#define GrSafeAssign(a, b) SkRefCnt_SafeAssign(a, b)
-
-template<typename T>
-static inline void GrSafeSetNull(T*& obj) {
- if (NULL != obj) {
- obj->unref();
- obj = NULL;
- }
-}
-
-#endif
diff --git a/include/gpu/GrResource.h b/include/gpu/GrResource.h
index c52fa044f2..836c21546b 100644
--- a/include/gpu/GrResource.h
+++ b/include/gpu/GrResource.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,12 +5,10 @@
* found in the LICENSE file.
*/
-
#ifndef GrResource_DEFINED
#define GrResource_DEFINED
-#include "GrRefCnt.h"
-
+#include "SkRefCnt.h"
#include "SkTInternalLList.h"
class GrGpu;
@@ -21,7 +18,7 @@ class GrResourceEntry;
/**
* Base class for the GPU resources created by a GrContext.
*/
-class GrResource : public GrRefCnt {
+class GrResource : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrResource)
@@ -111,7 +108,7 @@ private:
};
uint32_t fFlags;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index b4d3f793fd..44a9c7ca2a 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,12 +5,11 @@
* found in the LICENSE file.
*/
-
#ifndef GrGLInterface_DEFINED
#define GrGLInterface_DEFINED
#include "GrGLFunctions.h"
-#include "GrRefCnt.h"
+#include "SkRefCnt.h"
////////////////////////////////////////////////////////////////////////////////
@@ -110,7 +108,7 @@ typedef intptr_t GrGLInterfaceCallbackData;
* non-NULL or GrContext creation will fail. This can be tested with the
* validate() method when the OpenGL context has been made current.
*/
-struct SK_API GrGLInterface : public GrRefCnt {
+struct SK_API GrGLInterface : public SkRefCnt {
private:
// simple wrapper class that exists only to initialize a pointer to NULL
template <typename FNPTR_TYPE> class GLPtr {
@@ -122,7 +120,7 @@ private:
FNPTR_TYPE fPtr;
};
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
public:
SK_DECLARE_INST_COUNT(GrGLInterface)
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index b104df5d24..8d5851fa0f 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -6,7 +6,6 @@
*/
#include "GrAARectRenderer.h"
-#include "GrRefCnt.h"
#include "GrGpu.h"
#include "gl/GrGLEffect.h"
#include "GrTBackendEffectFactory.h"
@@ -295,8 +294,8 @@ static void set_inset_fan(GrPoint* pts, size_t stride,
};
void GrAARectRenderer::reset() {
- GrSafeSetNull(fAAFillRectIndexBuffer);
- GrSafeSetNull(fAAStrokeRectIndexBuffer);
+ SkSafeSetNull(fAAFillRectIndexBuffer);
+ SkSafeSetNull(fAAStrokeRectIndexBuffer);
}
static const uint16_t gFillAARectIdx[] = {
diff --git a/src/gpu/GrAARectRenderer.h b/src/gpu/GrAARectRenderer.h
index 607329a720..2e705ca801 100644
--- a/src/gpu/GrAARectRenderer.h
+++ b/src/gpu/GrAARectRenderer.h
@@ -5,13 +5,12 @@
* found in the LICENSE file.
*/
-
#ifndef GrAARectRenderer_DEFINED
#define GrAARectRenderer_DEFINED
-#include "GrRefCnt.h"
#include "SkMatrix.h"
#include "SkRect.h"
+#include "SkRefCnt.h"
class GrGpu;
class GrDrawTarget;
@@ -20,7 +19,7 @@ class GrIndexBuffer;
/*
* This class wraps helper functions that draw AA rects (filled & stroked)
*/
-class GrAARectRenderer : public GrRefCnt {
+class GrAARectRenderer : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrAARectRenderer)
@@ -108,7 +107,7 @@ private:
const SkRect& devInside,
bool useVertexCoverage);
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif // GrAARectRenderer_DEFINED
diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp
index 865478bf06..ca46e8a8c4 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -170,7 +170,7 @@ GrAtlasMgr::GrAtlasMgr(GrGpu* gpu) {
GrAtlasMgr::~GrAtlasMgr() {
for (size_t i = 0; i < GR_ARRAY_COUNT(fTexture); i++) {
- GrSafeUnref(fTexture[i]);
+ SkSafeUnref(fTexture[i]);
}
delete fPlotMgr;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 5145b29373..d931de5ff1 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -167,8 +167,8 @@ GrContext::~GrContext() {
fOvalRenderer->unref();
fGpu->unref();
- GrSafeUnref(fPathRendererChain);
- GrSafeUnref(fSoftwarePathRenderer);
+ SkSafeUnref(fPathRendererChain);
+ SkSafeUnref(fSoftwarePathRenderer);
fDrawState->unref();
--THREAD_INSTANCE_COUNT;
@@ -186,8 +186,8 @@ void GrContext::contextDestroyed() {
// a path renderer may be holding onto resources that
// are now unusable
- GrSafeSetNull(fPathRendererChain);
- GrSafeSetNull(fSoftwarePathRenderer);
+ SkSafeSetNull(fPathRendererChain);
+ SkSafeSetNull(fSoftwarePathRenderer);
delete fDrawBuffer;
fDrawBuffer = NULL;
@@ -221,8 +221,8 @@ void GrContext::freeGpuResources() {
fTextureCache->purgeAllUnlocked();
fFontCache->freeAll();
// a path renderer may be holding onto resources
- GrSafeSetNull(fPathRendererChain);
- GrSafeSetNull(fSoftwarePathRenderer);
+ SkSafeSetNull(fPathRendererChain);
+ SkSafeSetNull(fSoftwarePathRenderer);
}
size_t GrContext::getGpuTextureCacheBytes() const {
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index ef6cc46497..bfc15b01cd 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -14,7 +14,6 @@
#include "GrEffectStage.h"
#include "GrPaint.h"
#include "GrPoint.h"
-#include "GrRefCnt.h"
#include "GrRenderTarget.h"
#include "GrStencil.h"
#include "GrTemplates.h"
@@ -25,7 +24,7 @@
#include "SkMatrix.h"
#include "SkXfermode.h"
-class GrDrawState : public GrRefCnt {
+class GrDrawState : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrDrawState)
@@ -675,7 +674,7 @@ public:
fDrawState->setRenderTarget(fSavedTarget);
fDrawState = NULL;
}
- GrSafeSetNull(fSavedTarget);
+ SkSafeSetNull(fSavedTarget);
}
void set(GrDrawState* ds, GrRenderTarget* newTarget) {
@@ -1077,7 +1076,7 @@ private:
*/
void setVertexAttribs(const GrVertexAttrib attribs[], int count);
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags);
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index d242797db9..5b1954609c 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 Google Inc.
*
@@ -6,20 +5,18 @@
* found in the LICENSE file.
*/
-
#ifndef GrDrawTarget_DEFINED
#define GrDrawTarget_DEFINED
#include "GrClipData.h"
#include "GrDrawState.h"
#include "GrIndexBuffer.h"
-#include "SkMatrix.h"
-#include "GrRefCnt.h"
#include "SkClipStack.h"
+#include "SkMatrix.h"
#include "SkPath.h"
-#include "SkTLazy.h"
#include "SkTArray.h"
+#include "SkTLazy.h"
#include "SkXfermode.h"
class GrClipData;
@@ -28,7 +25,7 @@ class GrPath;
class GrVertexBuffer;
class SkStrokeRec;
-class GrDrawTarget : public GrRefCnt {
+class GrDrawTarget : public SkRefCnt {
protected:
class DrawInfo;
@@ -869,7 +866,7 @@ private:
// The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTarget.
GrContext* fContext;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index adcc3a3017..a4aa00eac1 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -66,7 +66,7 @@ void GrGpu::abandonResources() {
}
SkASSERT(NULL == fQuadIndexBuffer || !fQuadIndexBuffer->isValid());
- GrSafeSetNull(fQuadIndexBuffer);
+ SkSafeSetNull(fQuadIndexBuffer);
delete fVertexPool;
fVertexPool = NULL;
delete fIndexPool;
@@ -82,7 +82,7 @@ void GrGpu::releaseResources() {
}
SkASSERT(NULL == fQuadIndexBuffer || !fQuadIndexBuffer->isValid());
- GrSafeSetNull(fQuadIndexBuffer);
+ SkSafeSetNull(fQuadIndexBuffer);
delete fVertexPool;
fVertexPool = NULL;
delete fIndexPool;
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 2b3608df18..239ae6bd83 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -9,7 +9,6 @@
#define GrGpu_DEFINED
#include "GrDrawTarget.h"
-#include "GrRefCnt.h"
#include "GrClipMaskManager.h"
#include "SkPath.h"
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index d04538dc23..1cd04d9e1b 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -431,7 +431,7 @@ void GrInOrderDrawBuffer::reset() {
// we always have a VB, but not always an IB
SkASSERT(NULL != fDraws[d].fVertexBuffer);
fDraws[d].fVertexBuffer->unref();
- GrSafeUnref(fDraws[d].fIndexBuffer);
+ SkSafeUnref(fDraws[d].fIndexBuffer);
}
fCmds.reset();
fDraws.reset();
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 507be826fc..dcc5ab7e0b 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -108,7 +108,7 @@ private:
struct Clear : GrNoncopyable {
Clear() : fRenderTarget(NULL) {}
- ~Clear() { GrSafeUnref(fRenderTarget); }
+ ~Clear() { SkSafeUnref(fRenderTarget); }
SkIRect fRect;
GrColor fColor;
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 79c8e832fd..4f41ae9e3a 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -464,7 +464,7 @@ GrEffectRef* DIEllipseEdgeEffect::TestCreate(SkMWCRandom* random,
///////////////////////////////////////////////////////////////////////////////
void GrOvalRenderer::reset() {
- GrSafeSetNull(fRRectIndexBuffer);
+ SkSafeSetNull(fRRectIndexBuffer);
}
bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bool useAA,
diff --git a/src/gpu/GrOvalRenderer.h b/src/gpu/GrOvalRenderer.h
index 8c47e9a350..b58abb7989 100644
--- a/src/gpu/GrOvalRenderer.h
+++ b/src/gpu/GrOvalRenderer.h
@@ -10,7 +10,6 @@
#include "GrContext.h"
#include "GrPaint.h"
-#include "GrRefCnt.h"
class GrContext;
class GrDrawTarget;
@@ -21,7 +20,7 @@ class SkStrokeRec;
/*
* This class wraps helper functions that draw ovals and roundrects (filled & stroked)
*/
-class GrOvalRenderer : public GrRefCnt {
+class GrOvalRenderer : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrOvalRenderer)
@@ -52,7 +51,7 @@ private:
GrIndexBuffer* fRRectIndexBuffer;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif // GrOvalRenderer_DEFINED
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index c49dd482f8..f86eb9fe54 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -27,7 +27,7 @@ struct GrPoint;
* stages before GrPaint::kTotalStages are reserved for setting up the draw (i.e., textures and
* filter masks).
*/
-class SK_API GrPathRenderer : public GrRefCnt {
+class SK_API GrPathRenderer : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrPathRenderer)
@@ -192,7 +192,7 @@ protected:
private:
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 646ad02802..e4303c1d7c 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -67,7 +67,7 @@ void GrTextContext::flushGlyphs() {
fVertices = NULL;
fMaxVertices = 0;
fCurrVertex = 0;
- GrSafeSetNull(fCurrTexture);
+ SkSafeSetNull(fCurrTexture);
}
}
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index 9ef9a54889..d3214a7012 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -231,7 +231,7 @@ bool GrTextStrike::getGlyphAtlas(GrGlyph* glyph, GrFontScaler* scaler,
return true;
}
- GrAutoRef ar(scaler);
+ SkAutoRef ar(scaler);
int bytesPerPixel = GrMaskFormatBytesPerPixel(fMaskFormat);
size_t size = glyph->fBounds.area() * bytesPerPixel;
diff --git a/src/gpu/SkGrFontScaler.cpp b/src/gpu/SkGrFontScaler.cpp
index c48e633fd0..3c42af83df 100644
--- a/src/gpu/SkGrFontScaler.cpp
+++ b/src/gpu/SkGrFontScaler.cpp
@@ -73,7 +73,7 @@ SkGrFontScaler::SkGrFontScaler(SkGlyphCache* strike) {
}
SkGrFontScaler::~SkGrFontScaler() {
- GrSafeUnref(fKey);
+ SkSafeUnref(fKey);
}
GrMaskFormat SkGrFontScaler::getMaskFormat() {
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index 98819bfd73..dc5d7558f0 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -94,7 +94,7 @@ static SkGrPixelRef* copyToTexturePixelRef(GrTexture* texture, SkBitmap::Config
#endif
SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (dst));
- GrSafeUnref(dst);
+ SkSafeUnref(dst);
return pixelRef;
}
@@ -114,7 +114,7 @@ SkGrPixelRef::SkGrPixelRef(GrSurface* surface, bool transferCacheLock) {
fSurface = surface;
}
fUnlock = transferCacheLock;
- GrSafeRef(surface);
+ SkSafeRef(surface);
}
SkGrPixelRef::~SkGrPixelRef() {
@@ -125,7 +125,7 @@ SkGrPixelRef::~SkGrPixelRef() {
context->unlockScratchTexture(texture);
}
}
- GrSafeUnref(fSurface);
+ SkSafeUnref(fSurface);
}
GrTexture* SkGrPixelRef::getTexture() {
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index 1d0a01fc87..93f369109a 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -73,13 +73,13 @@ GrGLContext::GrGLContext(const GrGLContext& ctx) {
}
GrGLContext& GrGLContext::operator = (const GrGLContext& ctx) {
- GrSafeAssign(fInterface, ctx.fInterface);
+ SkRefCnt_SafeAssign(fInterface, ctx.fInterface);
fInfo = ctx.fInfo;
return *this;
}
void GrGLContext::reset() {
- GrSafeSetNull(fInterface);
+ SkSafeSetNull(fInterface);
fInfo.reset();
}
diff --git a/src/gpu/gl/GrGLContext.h b/src/gpu/gl/GrGLContext.h
index 34f2190fba..ac9e9ed900 100644
--- a/src/gpu/gl/GrGLContext.h
+++ b/src/gpu/gl/GrGLContext.h
@@ -101,7 +101,7 @@ public:
*/
GrGLContext(const GrGLContext& ctx);
- ~GrGLContext() { GrSafeUnref(fInterface); }
+ ~GrGLContext() { SkSafeUnref(fInterface); }
/**
* Copies a GrGLContext
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index bef2ecf544..b18b8ae31d 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -33,7 +33,7 @@ class GrGLShaderBuilder;
* Uniforms are program-local so we can't rely on fHWState to hold the
* previous uniform state after a program change.
*/
-class GrGLProgram : public GrRefCnt {
+class GrGLProgram : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrGLProgram)
@@ -235,7 +235,7 @@ private:
GrGLUniformManager fUniformManager;
UniformHandles fUniformHandles;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
#endif
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index e41ebc87ab..62052fd16a 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -15,7 +15,7 @@
/**
* A ref counted tex id that deletes the texture in its destructor.
*/
-class GrGLTexID : public GrRefCnt {
+class GrGLTexID : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrGLTexID)
@@ -39,7 +39,7 @@ private:
GrGLuint fTexID;
bool fIsWrapped;
- typedef GrRefCnt INHERITED;
+ typedef SkRefCnt INHERITED;
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/ClipCacheTest.cpp b/tests/ClipCacheTest.cpp
index c3801d74c5..9407688f2d 100644
--- a/tests/ClipCacheTest.cpp
+++ b/tests/ClipCacheTest.cpp
@@ -58,7 +58,7 @@ static void test_clip_bounds(skiatest::Reporter* reporter, GrContext* context) {
return;
}
- GrAutoUnref au(texture);
+ SkAutoUnref au(texture);
SkIRect intScreen = SkIRect::MakeWH(kXSize, kYSize);
SkRect screen;
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 8ae936e97b..fb177df8b5 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -46,7 +46,7 @@ static void ReadWriteAlphaTest(skiatest::Reporter* reporter, GrContextFactory* f
return;
}
- GrAutoUnref au(texture);
+ SkAutoUnref au(texture);
// create a distinctive texture
for (int y = 0; y < Y_SIZE; ++y) {