Replace uses of GrNoncopyable by SkNoncopyable.

BUG=None
TEST=None, no functional changes.
R=bsalomon@google.com, robertphillips@google.com

Author: tfarina@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23483042

git-svn-id: http://skia.googlecode.com/svn/trunk@11341 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-09-18 13:00:55 +00:00
Родитель 0694ea7f6a
Коммит a0b40280a4
27 изменённых файлов: 78 добавлений и 127 удалений

Просмотреть файл

@ -20,7 +20,6 @@
'<(skia_include_path)/gpu/GrFontScaler.h',
'<(skia_include_path)/gpu/GrGlyph.h',
'<(skia_include_path)/gpu/GrKey.h',
'<(skia_include_path)/gpu/GrNoncopyable.h',
'<(skia_include_path)/gpu/GrPaint.h',
'<(skia_include_path)/gpu/GrPathRendererChain.h',
'<(skia_include_path)/gpu/GrPoint.h',

Просмотреть файл

@ -44,7 +44,6 @@
'gpu/GrDrawEffect.h',
'gpu/GrTextContext.h',
'gpu/GrEffect.h',
'gpu/GrNoncopyable.h',
'gpu/SkGrTexturePixelRef.h',
'gpu/GrTextureAccess.h',
'gpu/GrRect.h',

Просмотреть файл

@ -11,7 +11,7 @@
#include "GrTypes.h"
#include "SkTemplates.h"
#include "SkThread_platform.h"
#include "GrNoncopyable.h"
#include "SkTypes.h"
/** Given a GrEffect of a particular type, creates the corresponding graphics-backend-specific
effect object. Also tracks equivalence of shaders generated via a key. Each factory instance
@ -28,7 +28,7 @@ class GrGLEffect;
class GrGLCaps;
class GrDrawEffect;
class GrBackendEffectFactory : public GrNoncopyable {
class GrBackendEffectFactory : public SkNoncopyable {
public:
typedef uint32_t EffectKey;
enum {

Просмотреть файл

@ -8,14 +8,15 @@
#ifndef GrContext_DEFINED
#define GrContext_DEFINED
#include "GrColor.h"
#include "GrClipData.h"
#include "SkMatrix.h"
#include "GrColor.h"
#include "GrPaint.h"
#include "GrPathRendererChain.h"
#include "GrPoint.h"
#include "GrRenderTarget.h"
#include "GrTexture.h"
#include "SkMatrix.h"
#include "SkTypes.h"
class GrAARectRenderer;
class GrAutoScratchTexture;
@ -630,7 +631,7 @@ public:
///////////////////////////////////////////////////////////////////////////
// Helpers
class AutoRenderTarget : public ::GrNoncopyable {
class AutoRenderTarget : public ::SkNoncopyable {
public:
AutoRenderTarget(GrContext* context, GrRenderTarget* target) {
fPrevTarget = context->getRenderTarget();
@ -668,7 +669,7 @@ public:
* paint if necessary. Hint: use SkTCopyOnFirstWrite if the AutoMatrix is conditionally
* initialized.
*/
class AutoMatrix : GrNoncopyable {
class AutoMatrix : public ::SkNoncopyable {
public:
AutoMatrix() : fContext(NULL) {}
@ -761,7 +762,7 @@ public:
SkMatrix fMatrix;
};
class AutoClip : GrNoncopyable {
class AutoClip : public ::SkNoncopyable {
public:
// This enum exists to require a caller of the constructor to acknowledge that the clip will
// initially be wide open. It also could be extended if there are other desirable initial
@ -940,7 +941,7 @@ private:
* Gets and locks a scratch texture from a descriptor using either exact or approximate criteria.
* Unlocks texture in the destructor.
*/
class GrAutoScratchTexture : ::GrNoncopyable {
class GrAutoScratchTexture : public ::SkNoncopyable {
public:
GrAutoScratchTexture()
: fContext(NULL)

Просмотреть файл

@ -28,7 +28,7 @@
* factory is destroyed (though the caller can always grab a ref on the returned
* GrContext to make it outlive the factory).
*/
class GrContextFactory : GrNoncopyable {
class GrContextFactory : public SkNoncopyable {
public:
/**
* Types of GL contexts supported.

Просмотреть файл

@ -10,7 +10,6 @@
#include "GrColor.h"
#include "GrEffectUnitTest.h"
#include "GrNoncopyable.h"
#include "GrTexture.h"
#include "GrTextureAccess.h"
#include "GrTypesPriv.h"

Просмотреть файл

@ -8,9 +8,9 @@
#ifndef GrEffectUnitTest_DEFINED
#define GrEffectUnitTest_DEFINED
#include "GrNoncopyable.h"
#include "SkRandom.h"
#include "SkTArray.h"
#include "SkTypes.h"
class SkMatrix;
class GrDrawTargetCaps;
@ -35,7 +35,7 @@ class GrContext;
class GrEffectRef;
class GrTexture;
class GrEffectTestFactory : GrNoncopyable {
class GrEffectTestFactory : public SkNoncopyable {
public:
typedef GrEffectRef* (*CreateProc)(SkRandom*,

Просмотреть файл

@ -1,28 +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 GrNoncopyable_DEFINED
#define GrNoncopyable_DEFINED
#include "GrTypes.h"
/**
* Base for classes that want to disallow copying themselves. It makes its
* copy-constructor and assignment operators private (and unimplemented).
*/
class SK_API GrNoncopyable {
public:
GrNoncopyable() {}
private:
// illegal
GrNoncopyable(const GrNoncopyable&);
GrNoncopyable& operator=(const GrNoncopyable&);
};
#endif

Просмотреть файл

@ -8,9 +8,9 @@
#ifndef GrTextureAccess_DEFINED
#define GrTextureAccess_DEFINED
#include "GrNoncopyable.h"
#include "SkRefCnt.h"
#include "SkShader.h"
#include "SkTypes.h"
class GrTexture;
@ -112,7 +112,7 @@ private:
* key. However, if a GrEffect uses different swizzles based on its input then it must
* consider that variation in its key-generation.
*/
class GrTextureAccess : GrNoncopyable {
class GrTextureAccess : public SkNoncopyable {
public:
/**
* A default GrTextureAccess must have reset() called on it in a GrEffect subclass's
@ -182,7 +182,7 @@ private:
uint32_t fSwizzleMask;
char fSwizzle[5];
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
#endif

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2010 Google Inc.
*
@ -6,10 +5,10 @@
* found in the LICENSE file.
*/
#include "GrAllocPool.h"
#include "GrTypes.h"
#define GrAllocPool_MIN_BLOCK_SIZE ((size_t)128)
struct GrAllocPool::Block {

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2010 Google Inc.
*
@ -6,14 +5,12 @@
* found in the LICENSE file.
*/
#ifndef GrAllocPool_DEFINED
#define GrAllocPool_DEFINED
#include "GrNoncopyable.h"
#include "SkTypes.h"
class GrAllocPool : GrNoncopyable {
class GrAllocPool : public SkNoncopyable {
public:
GrAllocPool(size_t blockSize = 0);
~GrAllocPool();

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2010 Google Inc.
*
@ -6,16 +5,15 @@
* found in the LICENSE file.
*/
#ifndef GrAllocator_DEFINED
#define GrAllocator_DEFINED
#include "GrNoncopyable.h"
#include "GrConfig.h"
#include "GrTypes.h"
#include "SkTArray.h"
#include "SkTypes.h"
class GrAllocator : GrNoncopyable {
class GrAllocator : public SkNoncopyable {
public:
~GrAllocator() {
reset();
@ -135,12 +133,11 @@ private:
bool fOwnFirstBlock;
int fCount;
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
template <typename T>
class GrTAllocator : GrNoncopyable {
class GrTAllocator : public SkNoncopyable {
public:
virtual ~GrTAllocator() { this->reset(); };
@ -232,7 +229,7 @@ protected:
private:
GrAllocator fAllocator;
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
template <int N, typename T> class GrSTAllocator : public GrTAllocator<T> {

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2010 Google Inc.
*
@ -6,15 +5,12 @@
* found in the LICENSE file.
*/
#ifndef GrBufferAllocPool_DEFINED
#define GrBufferAllocPool_DEFINED
#include "GrNoncopyable.h"
#include "SkTArray.h"
#include "SkTDArray.h"
#include "SkTypes.h"
class GrGeometryBuffer;
class GrGpu;
@ -31,8 +27,7 @@ class GrGpu;
* a number of buffers to preallocate can be specified. These will
* be allocated at the min size and kept around until the pool is destroyed.
*/
class GrBufferAllocPool : GrNoncopyable {
class GrBufferAllocPool : public SkNoncopyable {
public:
/**
* Ensures all buffers are unlocked and have all data written to them.

Просмотреть файл

@ -9,8 +9,8 @@
#define GrClipMaskCache_DEFINED
#include "GrContext.h"
#include "GrNoncopyable.h"
#include "SkClipStack.h"
#include "SkTypes.h"
class GrTexture;
@ -18,7 +18,7 @@ class GrTexture;
* The stencil buffer stores the last clip path - providing a single entry
* "cache". This class provides similar functionality for AA clip paths
*/
class GrClipMaskCache : public GrNoncopyable {
class GrClipMaskCache : public SkNoncopyable {
public:
GrClipMaskCache();
@ -233,7 +233,7 @@ private:
GrContext* fContext;
SkDeque fStack;
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
#endif // GrClipMaskCache_DEFINED

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2012 Google Inc.
*
@ -9,9 +8,9 @@
#ifndef GrClipMaskManager_DEFINED
#define GrClipMaskManager_DEFINED
#include "GrClipMaskCache.h"
#include "GrContext.h"
#include "GrDrawState.h"
#include "GrNoncopyable.h"
#include "GrReducedClip.h"
#include "GrStencil.h"
#include "GrTexture.h"
@ -21,14 +20,13 @@
#include "SkPath.h"
#include "SkRefCnt.h"
#include "SkTLList.h"
#include "GrClipMaskCache.h"
#include "SkTypes.h"
class GrGpu;
class GrPathRenderer;
class GrPathRendererChain;
class SkPath;
class GrTexture;
class SkPath;
/**
* The clip mask creator handles the generation of the clip mask. If anti
@ -38,7 +36,7 @@ class GrTexture;
* mask can be represented as a rectangle then scissoring is used. In all
* cases scissoring is used to bound the range of the clip mask.
*/
class GrClipMaskManager : public GrNoncopyable {
class GrClipMaskManager : public SkNoncopyable {
public:
GrClipMaskManager()
: fGpu(NULL)
@ -164,7 +162,7 @@ private:
StencilClipMode mode,
int stencilBitCnt);
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
#endif // GrClipMaskManager_DEFINED

Просмотреть файл

@ -22,6 +22,7 @@
#include "effects/GrSimpleTextureEffect.h"
#include "SkMatrix.h"
#include "SkTypes.h"
#include "SkXfermode.h"
class GrDrawState : public SkRefCnt {
@ -279,7 +280,7 @@ public:
/**
* Constructor sets the color to be 'color' which is undone by the destructor.
*/
class AutoColorRestore : public ::GrNoncopyable {
class AutoColorRestore : public ::SkNoncopyable {
public:
AutoColorRestore() : fDrawState(NULL), fOldColor(0) {}
@ -400,7 +401,7 @@ public:
* When this object is destroyed it will remove any effects from the draw state that were added
* after its constructor.
*/
class AutoRestoreEffects : public ::GrNoncopyable {
class AutoRestoreEffects : public ::SkNoncopyable {
public:
AutoRestoreEffects() : fDrawState(NULL), fColorEffectCnt(0), fCoverageEffectCnt(0) {}
@ -605,7 +606,7 @@ public:
* Preconcats the current view matrix and restores the previous view matrix in the destructor.
* Effect matrices are automatically adjusted to compensate and adjusted back in the destructor.
*/
class AutoViewMatrixRestore : public ::GrNoncopyable {
class AutoViewMatrixRestore : public ::SkNoncopyable {
public:
AutoViewMatrixRestore() : fDrawState(NULL) {}
@ -659,7 +660,7 @@ public:
const GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); }
GrRenderTarget* getRenderTarget() { return fRenderTarget.get(); }
class AutoRenderTargetRestore : public ::GrNoncopyable {
class AutoRenderTargetRestore : public ::SkNoncopyable {
public:
AutoRenderTargetRestore() : fDrawState(NULL), fSavedTarget(NULL) {}
AutoRenderTargetRestore(GrDrawState* ds, GrRenderTarget* newTarget) {

Просмотреть файл

@ -17,6 +17,7 @@
#include "SkPath.h"
#include "SkTArray.h"
#include "SkTLazy.h"
#include "SkTypes.h"
#include "SkXfermode.h"
class GrClipData;
@ -472,7 +473,7 @@ public:
* // destructor rather than target's current
* // GrDrawState.
*/
class AutoStateRestore : ::GrNoncopyable {
class AutoStateRestore : public ::SkNoncopyable {
public:
/**
* Default ASR will have no effect unless set() is subsequently called.
@ -525,7 +526,7 @@ public:
////////////////////////////////////////////////////////////////////////////
class AutoReleaseGeometry : ::GrNoncopyable {
class AutoReleaseGeometry : public ::SkNoncopyable {
public:
AutoReleaseGeometry(GrDrawTarget* target,
int vertexCount,
@ -552,7 +553,7 @@ public:
////////////////////////////////////////////////////////////////////////////
class AutoClipRestore : ::GrNoncopyable {
class AutoClipRestore : public ::SkNoncopyable {
public:
AutoClipRestore(GrDrawTarget* target) {
fTarget = target;
@ -577,7 +578,7 @@ public:
* Saves the geometry src state at construction and restores in the destructor. It also saves
* and then restores the vertex attrib state.
*/
class AutoGeometryPush : ::GrNoncopyable {
class AutoGeometryPush : public ::SkNoncopyable {
public:
AutoGeometryPush(GrDrawTarget* target)
: fAttribRestore(target->drawState()) {
@ -597,7 +598,7 @@ public:
* Combination of AutoGeometryPush and AutoStateRestore. The vertex attribs will be in default
* state regardless of ASRInit value.
*/
class AutoGeometryAndStatePush : ::GrNoncopyable {
class AutoGeometryAndStatePush : public ::SkNoncopyable {
public:
AutoGeometryAndStatePush(GrDrawTarget* target,
ASRInit init,

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2011 Google Inc.
*
@ -6,8 +5,6 @@
* found in the LICENSE file.
*/
#ifndef GrInOrderDrawBuffer_DEFINED
#define GrInOrderDrawBuffer_DEFINED
@ -19,6 +16,7 @@
#include "SkClipStack.h"
#include "SkStrokeRec.h"
#include "SkTemplates.h"
#include "SkTypes.h"
class GrGpu;
class GrIndexBufferAllocPool;
@ -98,7 +96,7 @@ private:
const GrIndexBuffer* fIndexBuffer;
};
struct StencilPath : GrNoncopyable {
struct StencilPath : public ::SkNoncopyable {
StencilPath();
SkAutoTUnref<const GrPath> fPath;
@ -106,7 +104,7 @@ private:
SkPath::FillType fFill;
};
struct Clear : GrNoncopyable {
struct Clear : public ::SkNoncopyable {
Clear() : fRenderTarget(NULL) {}
~Clear() { SkSafeUnref(fRenderTarget); }
@ -115,7 +113,7 @@ private:
GrRenderTarget* fRenderTarget;
};
struct CopySurface : GrNoncopyable {
struct CopySurface : public ::SkNoncopyable {
SkAutoTUnref<GrSurface> fDst;
SkAutoTUnref<GrSurface> fSrc;
SkIRect fSrcRect;

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2010 Google Inc.
*
@ -6,15 +5,14 @@
* found in the LICENSE file.
*/
#ifndef GrPlotMgr_DEFINED
#define GrPlotMgr_DEFINED
#include "GrTypes.h"
#include "GrPoint.h"
#include "SkTypes.h"
class GrPlotMgr : GrNoncopyable {
class GrPlotMgr : public SkNoncopyable {
public:
GrPlotMgr(int width, int height) {
fDim.set(width, height);

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2011 Google Inc.
*
@ -6,11 +5,10 @@
* found in the LICENSE file.
*/
#ifndef GrRedBlackTree_DEFINED
#define GrRedBlackTree_DEFINED
#include "GrNoncopyable.h"
#include "SkTypes.h"
template <typename T>
class GrLess {
@ -36,7 +34,7 @@ public:
* will be created and used for all comparisons.
*/
template <typename T, typename C = GrLess<T> >
class GrRedBlackTree : public GrNoncopyable {
class GrRedBlackTree : public SkNoncopyable {
public:
/**
* Creates an empty tree.

Просмотреть файл

@ -9,13 +9,13 @@
#define GrSWMaskHelper_DEFINED
#include "GrColor.h"
#include "SkMatrix.h"
#include "GrNoncopyable.h"
#include "GrDrawState.h"
#include "SkBitmap.h"
#include "SkDraw.h"
#include "SkMatrix.h"
#include "SkRasterClip.h"
#include "SkRegion.h"
#include "GrDrawState.h"
#include "SkTypes.h"
class GrAutoScratchTexture;
class GrContext;
@ -38,7 +38,7 @@ class GrDrawTarget;
* The result of this process will be the final mask (on the GPU) in the
* upper left hand corner of the texture.
*/
class GrSWMaskHelper : public GrNoncopyable {
class GrSWMaskHelper : public SkNoncopyable {
public:
GrSWMaskHelper(GrContext* context)
: fContext(context) {
@ -101,7 +101,7 @@ private:
SkDraw fDraw;
SkRasterClip fRasterClip;
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
#endif // GrSWMaskHelper_DEFINED

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2010 Google Inc.
*
@ -6,11 +5,10 @@
* found in the LICENSE file.
*/
#ifndef GrTemplates_DEFINED
#define GrTemplates_DEFINED
#include "GrNoncopyable.h"
#include "SkTypes.h"
/**
* Use to cast a ptr to a different type, and maintain strict-aliasing
@ -37,7 +35,7 @@ template <typename Dst, typename Src> Dst GrTCast(Src src) {
* ...
* } // fCount is restored
*/
template <typename T> class GrAutoTRestore : public GrNoncopyable {
template <typename T> class GrAutoTRestore : public SkNoncopyable {
public:
GrAutoTRestore() : fPtr(NULL), fVal() {}

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2012 Google Inc.
*
@ -9,11 +8,12 @@
#ifndef GrTextureStripAtlas_DEFINED
#define GrTextureStripAtlas_DEFINED
#include "SkBitmap.h"
#include "GrBinHashKey.h"
#include "GrTHashCache.h"
#include "SkBitmap.h"
#include "SkGr.h"
#include "SkTDArray.h"
#include "GrBinHashKey.h"
#include "SkTypes.h"
/**
* Maintains a single large texture whose rows store many textures of a small fixed height,
@ -79,7 +79,7 @@ private:
* The state of a single row in our cache, next/prev pointers allow these to be chained
* together to represent LRU status
*/
struct AtlasRow : public GrNoncopyable {
struct AtlasRow : public SkNoncopyable {
AtlasRow() : fKey(kEmptyAtlasRowKey), fLocks(0), fNext(NULL), fPrev(NULL) { }
// GenerationID of the bitmap that is represented by this row, 0xffffffff means "empty"
uint32_t fKey;
@ -137,7 +137,7 @@ private:
// Hash table entry for atlases
class AtlasEntry;
typedef GrTBinHashKey<AtlasEntry, sizeof(GrTextureStripAtlas::Desc)> AtlasHashKey;
class AtlasEntry : public ::GrNoncopyable {
class AtlasEntry : public ::SkNoncopyable {
public:
AtlasEntry() : fAtlas(NULL) {}
~AtlasEntry() { SkDELETE(fAtlas); }

Просмотреть файл

@ -8,7 +8,7 @@
#ifndef GrGLBufferImpl_DEFINED
#define GrGLBufferImpl_DEFINED
#include "GrNoncopyable.h"
#include "SkTypes.h"
#include "gl/GrGLFunctions.h"
class GrGpuGL;
@ -17,7 +17,7 @@ class GrGpuGL;
* This class serves as the implementation of GrGL*Buffer classes. It was written to avoid code
* duplication in those classes.
*/
class GrGLBufferImpl : public GrNoncopyable {
class GrGLBufferImpl : public SkNoncopyable {
public:
struct Desc {
bool fIsWrapped;
@ -54,7 +54,7 @@ private:
void* fCPUData;
void* fLockPtr;
typedef GrNoncopyable INHERITED;
typedef SkNoncopyable INHERITED;
};
#endif

Просмотреть файл

@ -12,6 +12,7 @@
#include "GrBackendEffectFactory.h"
#include "GrColor.h"
#include "GrEffect.h"
#include "SkTypes.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLUniformManager.h"
@ -386,7 +387,7 @@ private:
GrGLUniformManager::BuilderUniformArray fUniforms;
private:
class CodeStage : GrNoncopyable {
class CodeStage : public SkNoncopyable {
public:
CodeStage() : fNextIndex(0), fCurrentIndex(-1), fEffect(NULL) {}
@ -405,7 +406,7 @@ private:
return fCurrentIndex;
}
class AutoStageRestore : GrNoncopyable {
class AutoStageRestore : public SkNoncopyable {
public:
AutoStageRestore(CodeStage* codeStage, const GrEffectRef* effect) {
SkASSERT(NULL != codeStage);

Просмотреть файл

@ -10,15 +10,16 @@
#include "GrBinHashKey.h"
#include "GrDrawState.h"
#include "GrGpu.h"
#include "GrGLContext.h"
#include "GrGLIndexBuffer.h"
#include "GrGLIRect.h"
#include "GrGLIndexBuffer.h"
#include "GrGLProgram.h"
#include "GrGLStencilBuffer.h"
#include "GrGLTexture.h"
#include "GrGLVertexArray.h"
#include "GrGLVertexBuffer.h"
#include "GrGpu.h"
#include "SkTypes.h"
#include "../GrTHashCache.h"
#ifdef SK_DEVELOPER
@ -170,7 +171,7 @@ private:
static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff);
class ProgramCache : public ::GrNoncopyable {
class ProgramCache : public ::SkNoncopyable {
public:
ProgramCache(GrGpuGL* gpu);
~ProgramCache();

Просмотреть файл

@ -1,4 +1,3 @@
/*
* Copyright 2012 Google Inc.
*
@ -9,8 +8,8 @@
#ifndef GrFakeRefObj_DEFINED
#define GrFakeRefObj_DEFINED
#include "SkTypes.h"
#include "gl/GrGLInterface.h"
#include "GrNoncopyable.h"
////////////////////////////////////////////////////////////////////////////////
// This object is used to track the OpenGL objects. We don't use real
@ -19,7 +18,7 @@
// are tracking in this class are actually OpenGL's references to the objects
// not "ours"
// Each object also gets a unique globally identifying ID
class GrFakeRefObj : public GrNoncopyable {
class GrFakeRefObj : public SkNoncopyable {
public:
GrFakeRefObj()
: fRef(0)