diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-09 13:38:37 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-09 13:38:37 +0000 |
commit | a4de8c257ea0be8ff7081f645249b6afe5c48e7e (patch) | |
tree | 6d44deb55289b79e5462bd60a6b6a08fc6f950ce /src | |
parent | 18c7617a30b29c368477ca7df244cc39ea92aeb9 (diff) |
Remove GrRefCnt.h in favor of SkRefCnt.h
This removes GrRefCnt.h with all its tyepdefs and #defines and just switch them
to the Sk* equivalents.
GrSafeSetNull was promoted to SkSafeSetNull in SkRefCnt.h.
BUG=None
TEST=none, no functional changes.
R=bsalomon@google.com, robertphillips@google.com
Author: tfarina@chromium.org
Review URL: https://chromiumcodereview.appspot.com/23904003
git-svn-id: http://skia.googlecode.com/svn/trunk@11151 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrAARectRenderer.cpp | 5 | ||||
-rw-r--r-- | src/gpu/GrAARectRenderer.h | 7 | ||||
-rw-r--r-- | src/gpu/GrAtlas.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 12 | ||||
-rw-r--r-- | src/gpu/GrDrawState.h | 7 | ||||
-rw-r--r-- | src/gpu/GrDrawTarget.h | 11 | ||||
-rw-r--r-- | src/gpu/GrGpu.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrGpu.h | 1 | ||||
-rw-r--r-- | src/gpu/GrInOrderDrawBuffer.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrInOrderDrawBuffer.h | 2 | ||||
-rw-r--r-- | src/gpu/GrOvalRenderer.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrOvalRenderer.h | 5 | ||||
-rw-r--r-- | src/gpu/GrPathRenderer.h | 4 | ||||
-rw-r--r-- | src/gpu/GrTextContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrTextStrike.cpp | 2 | ||||
-rw-r--r-- | src/gpu/SkGrFontScaler.cpp | 2 | ||||
-rw-r--r-- | src/gpu/SkGrPixelRef.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/GrGLContext.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLContext.h | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLProgram.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLTexture.h | 4 |
21 files changed, 41 insertions, 49 deletions
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; }; //////////////////////////////////////////////////////////////////////////////// |