diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-28 14:17:03 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-28 14:17:03 +0000 |
commit | 515dcd36032997ce335daa0163c6d67e851bcad1 (patch) | |
tree | a2f8bf979ed20e575e763d94ddea4cf7e89ce18c /src/gpu | |
parent | 4d213ab944d96ad60a243ac1ad21c793c1acc80a (diff) |
Replace uses of GR_DEBUG by SK_DEBUG.
BUG=None
R=bsalomon@google.com, robertphillips@google.com
Author: tfarina@chromium.org
Review URL: https://chromiumcodereview.appspot.com/23137022
git-svn-id: http://skia.googlecode.com/svn/trunk@10978 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
33 files changed, 80 insertions, 77 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp index 4825d767ac..750ffefbf9 100644 --- a/src/gpu/GrAAConvexPathRenderer.cpp +++ b/src/gpu/GrAAConvexPathRenderer.cpp @@ -670,7 +670,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath, devBounds.outset(SK_Scalar1, SK_Scalar1); // Check devBounds -#if GR_DEBUG +#ifdef SK_DEBUG SkRect tolDevBounds = devBounds; tolDevBounds.outset(SK_Scalar1 / 10000, SK_Scalar1 / 10000); SkRect actualBounds; diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp index e4ee8a850d..60992fd806 100644 --- a/src/gpu/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/GrAAHairLinePathRenderer.cpp @@ -166,7 +166,7 @@ namespace { // Takes 178th time of logf on Z600 / VC2010 int get_float_exp(float x) { GR_STATIC_ASSERT(sizeof(int) == sizeof(float)); -#if GR_DEBUG +#ifdef SK_DEBUG static bool tested; if (!tested) { tested = true; diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp index 3f268809b9..2e86fb7048 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -363,7 +363,7 @@ GrIndexBuffer* GrAARectRenderer::aaStrokeRectIndexBuffer(GrGpu* gpu) { fAAStrokeRectIndexBuffer = gpu->createIndexBuffer(sizeof(gStrokeAARectIdx), false); if (NULL != fAAStrokeRectIndexBuffer) { -#if GR_DEBUG +#ifdef SK_DEBUG bool updated = #endif fAAStrokeRectIndexBuffer->updateData(gStrokeAARectIdx, diff --git a/src/gpu/GrAllocPool.cpp b/src/gpu/GrAllocPool.cpp index e8381b034a..1d8dc45b97 100644 --- a/src/gpu/GrAllocPool.cpp +++ b/src/gpu/GrAllocPool.cpp @@ -102,8 +102,7 @@ void GrAllocPool::release(size_t bytes) { } } - -#if GR_DEBUG +#ifdef SK_DEBUG void GrAllocPool::validate() const { Block* block = fBlock; diff --git a/src/gpu/GrAllocPool.h b/src/gpu/GrAllocPool.h index 4f58f006df..cf969fe23c 100644 --- a/src/gpu/GrAllocPool.h +++ b/src/gpu/GrAllocPool.h @@ -41,7 +41,7 @@ private: Block* fBlock; size_t fMinBlockSize; -#if GR_DEBUG +#ifdef SK_DEBUG int fBlocksAllocated; void validate() const; #else diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp index 9776326f95..865478bf06 100644 --- a/src/gpu/GrAtlas.cpp +++ b/src/gpu/GrAtlas.cpp @@ -40,7 +40,7 @@ #define BORDER 1 -#if GR_DEBUG +#ifdef SK_DEBUG static int gCounter; #endif @@ -63,7 +63,7 @@ GrAtlas::GrAtlas(GrAtlasMgr* mgr, int plotX, int plotY, GrMaskFormat format) : fMaskFormat = format; -#if GR_DEBUG +#ifdef SK_DEBUG // GrPrintf(" GrAtlas %p [%d %d] %d\n", this, plotX, plotY, gCounter); gCounter += 1; #endif @@ -74,7 +74,7 @@ GrAtlas::~GrAtlas() { delete fRects; -#if GR_DEBUG +#ifdef SK_DEBUG --gCounter; // GrPrintf("~GrAtlas %p [%d %d] %d\n", this, fPlot.fX, fPlot.fY, gCounter); #endif diff --git a/src/gpu/GrBinHashKey.h b/src/gpu/GrBinHashKey.h index 5bbea072af..7d4aa0fbe8 100644 --- a/src/gpu/GrBinHashKey.h +++ b/src/gpu/GrBinHashKey.h @@ -46,7 +46,7 @@ public: void reset() { fHash = 0; -#if GR_DEBUG +#ifdef SK_DEBUG fIsValid = false; #endif } @@ -66,7 +66,7 @@ public: hash += (fHash << 3); hash ^= (fHash >> 11); hash += (fHash << 15); -#if GR_DEBUG +#ifdef SK_DEBUG fIsValid = true; #endif fHash = hash; @@ -101,7 +101,7 @@ private: uint32_t fHash; uint8_t fData[KEY_SIZE]; // Buffer for key storage -#if GR_DEBUG +#ifdef SK_DEBUG public: bool fIsValid; #endif diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp index b503e24f1e..887f8cdfe1 100644 --- a/src/gpu/GrBufferAllocPool.cpp +++ b/src/gpu/GrBufferAllocPool.cpp @@ -14,7 +14,7 @@ #include "GrTypes.h" #include "GrVertexBuffer.h" -#if GR_DEBUG +#ifdef SK_DEBUG #define VALIDATE validate #else static void VALIDATE(bool = false) {} @@ -117,7 +117,7 @@ void GrBufferAllocPool::unlock() { VALIDATE(); } -#if GR_DEBUG +#ifdef SK_DEBUG void GrBufferAllocPool::validate(bool unusedBlockAllowed) const { if (NULL != fBufferPtr) { SkASSERT(!fBlocks.empty()); diff --git a/src/gpu/GrBufferAllocPool.h b/src/gpu/GrBufferAllocPool.h index ffd8c34092..9758137f4e 100644 --- a/src/gpu/GrBufferAllocPool.h +++ b/src/gpu/GrBufferAllocPool.h @@ -161,7 +161,7 @@ private: bool createBlock(size_t requestSize); void destroyBlock(); void flushCpuData(GrGeometryBuffer* buffer, size_t flushSize); -#if GR_DEBUG +#ifdef SK_DEBUG void validate(bool unusedBlockAllowed = false) const; #endif diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 4bd8098218..4be77f8da2 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -46,7 +46,7 @@ SK_CONF_DECLARE(bool, c_Defer, "gpu.deferContext", true, // limitations) should we disable AA or draw wrong? #define DISABLE_COVERAGE_AA_FOR_BLEND 1 -#if GR_DEBUG +#ifdef SK_DEBUG // change this to a 1 to see notifications when partial coverage fails #define GR_DEBUG_PARTIAL_COVERAGE_CHECK 0 #else @@ -695,7 +695,7 @@ static bool apply_aa_to_rect(GrDrawTarget* target, *useVertexCoverage = false; if (!target->getDrawState().canTweakAlphaForCoverage()) { if (disable_coverage_aa_for_blend(target)) { -#if GR_DEBUG +#ifdef SK_DEBUG //GrPrintf("Turning off AA to correctly apply blend.\n"); #endif return false; @@ -1122,7 +1122,7 @@ void GrContext::internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& // aa. If we have some future driver-mojo path AA that can do the right // thing WRT to the blend then we'll need some query on the PR. if (disable_coverage_aa_for_blend(target)) { -#if GR_DEBUG +#ifdef SK_DEBUG //GrPrintf("Turning off AA to correctly apply blend.\n"); #endif useAA = false; @@ -1155,7 +1155,7 @@ void GrContext::internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& } if (NULL == pr) { -#if GR_DEBUG +#ifdef SK_DEBUG GrPrintf("Unable to find path renderer compatible with path.\n"); #endif return; diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp index 0f9a2703c9..0aa4215d0d 100644 --- a/src/gpu/GrDrawState.cpp +++ b/src/gpu/GrDrawState.cpp @@ -67,7 +67,7 @@ void GrDrawState::setFromPaint(const GrPaint& paint, const SkMatrix& vm, GrRende static size_t vertex_size(const GrVertexAttrib* attribs, int count) { // this works as long as we're 4 byte-aligned -#if GR_DEBUG +#ifdef SK_DEBUG uint32_t overlapCheck = 0; #endif SkASSERT(count <= GrDrawState::kMaxVertexAttribCnt); @@ -75,7 +75,7 @@ static size_t vertex_size(const GrVertexAttrib* attribs, int count) { for (int index = 0; index < count; ++index) { size_t attribSize = GrVertexAttribTypeSize(attribs[index].fType); size += attribSize; -#if GR_DEBUG +#ifdef SK_DEBUG size_t dwordCount = attribSize >> 2; uint32_t mask = (1 << dwordCount)-1; size_t offsetShift = attribs[index].fOffset >> 2; @@ -102,7 +102,7 @@ void GrDrawState::setVertexAttribs(const GrVertexAttrib* attribs, int count) { memset(fCommon.fFixedFunctionVertexAttribIndices, 0xff, sizeof(fCommon.fFixedFunctionVertexAttribIndices)); -#if GR_DEBUG +#ifdef SK_DEBUG uint32_t overlapCheck = 0; #endif for (int i = 0; i < count; ++i) { @@ -113,7 +113,7 @@ void GrDrawState::setVertexAttribs(const GrVertexAttrib* attribs, int count) { GrVertexAttribTypeVectorCount(attribs[i].fType)); fCommon.fFixedFunctionVertexAttribIndices[attribs[i].fBinding] = i; } -#if GR_DEBUG +#ifdef SK_DEBUG size_t dwordCount = GrVertexAttribTypeSize(attribs[i].fType) >> 2; uint32_t mask = (1 << dwordCount)-1; size_t offsetShift = attribs[i].fOffset >> 2; diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index e9b257e8a2..25c8cb1d2a 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -469,7 +469,7 @@ public: void setBlendFunc(GrBlendCoeff srcCoeff, GrBlendCoeff dstCoeff) { fCommon.fSrcBlend = srcCoeff; fCommon.fDstBlend = dstCoeff; - #if GR_DEBUG + #ifdef SK_DEBUG if (GrBlendCoeffRefsDst(dstCoeff)) { GrPrintf("Unexpected dst blend coeff. Won't work correctly with coverage stages.\n"); } diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index 26097a5f2a..c2256a84d8 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -45,7 +45,7 @@ GrDrawTarget::DrawInfo& GrDrawTarget::DrawInfo::operator =(const DrawInfo& di) { return *this; } -#if GR_DEBUG +#ifdef SK_DEBUG bool GrDrawTarget::DrawInfo::isInstanced() const { if (fInstanceCount > 0) { SkASSERT(0 == fIndexCount % fIndicesPerInstance); @@ -96,7 +96,7 @@ GrDrawTarget::GrDrawTarget(GrContext* context) // We assume that fDrawState always owns a ref to the object it points at. fDefaultDrawState.ref(); GeometrySrcState& geoSrc = fGeoSrcStateStack.push_back(); -#if GR_DEBUG +#ifdef SK_DEBUG geoSrc.fVertexCount = DEBUG_INVAL_START_IDX; geoSrc.fVertexBuffer = (GrVertexBuffer*)DEBUG_INVAL_BUFFER; geoSrc.fIndexCount = DEBUG_INVAL_START_IDX; @@ -239,7 +239,7 @@ void GrDrawTarget::releasePreviousVertexSource() { break; case kBuffer_GeometrySrcType: geoSrc.fVertexBuffer->unref(); -#if GR_DEBUG +#ifdef SK_DEBUG geoSrc.fVertexBuffer = (GrVertexBuffer*)DEBUG_INVAL_BUFFER; #endif break; @@ -262,7 +262,7 @@ void GrDrawTarget::releasePreviousIndexSource() { break; case kBuffer_GeometrySrcType: geoSrc.fIndexBuffer->unref(); -#if GR_DEBUG +#ifdef SK_DEBUG geoSrc.fIndexBuffer = (GrIndexBuffer*)DEBUG_INVAL_BUFFER; #endif break; @@ -325,7 +325,7 @@ void GrDrawTarget::pushGeometrySource() { GeometrySrcState& newState = fGeoSrcStateStack.push_back(); newState.fIndexSrc = kNone_GeometrySrcType; newState.fVertexSrc = kNone_GeometrySrcType; -#if GR_DEBUG +#ifdef SK_DEBUG newState.fVertexCount = ~0; newState.fVertexBuffer = (GrVertexBuffer*)~0; newState.fIndexCount = ~0; @@ -349,7 +349,7 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex, int startIndex, int vertexCount, int indexCount) const { const GrDrawState& drawState = this->getDrawState(); -#if GR_DEBUG +#ifdef SK_DEBUG const GeometrySrcState& geoSrc = fGeoSrcStateStack.back(); int maxVertex = startVertex + vertexCount; int maxValidVertex; @@ -425,13 +425,13 @@ bool GrDrawTarget::setupDstReadIfNecessary(DrawInfo* info) { SkIRect drawIBounds; if (info->getDevIBounds(&drawIBounds)) { if (!copyRect.intersect(drawIBounds)) { -#if GR_DEBUG +#ifdef SK_DEBUG GrPrintf("Missed an early reject. Bailing on draw from setupDstReadIfNecessary.\n"); #endif return false; } } else { -#if GR_DEBUG +#ifdef SK_DEBUG //GrPrintf("No dev bounds when dst copy is made.\n"); #endif } diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h index 7594278d42..d242797db9 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -744,7 +744,7 @@ protected: int instanceCount() const { return fInstanceCount; } bool isIndexed() const { return fIndexCount > 0; } -#if GR_DEBUG +#ifdef SK_DEBUG bool isInstanced() const; // this version is longer because of asserts #else bool isInstanced() const { return fInstanceCount > 0; } diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 3172ce96b3..adcc3a3017 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -40,7 +40,7 @@ GrGpu::GrGpu(GrContext* context) fClipMaskManager.setGpu(this); fGeomPoolStateStack.push_back(); -#if GR_DEBUG +#ifdef SK_DEBUG GeometryPoolState& poolState = fGeomPoolStateStack.back(); poolState.fPoolVertexBuffer = (GrVertexBuffer*)DEBUG_INVAL_BUFFER; poolState.fPoolStartVertex = DEBUG_INVAL_START_IDX; @@ -105,7 +105,7 @@ void GrGpu::removeResource(GrResource* resource) { void GrGpu::unimpl(const char msg[]) { -#if GR_DEBUG +#ifdef SK_DEBUG GrPrintf("--- GrGpu unimplemented(\"%s\")\n", msg); #endif } @@ -319,7 +319,7 @@ void GrGpu::geometrySourceWillPush() { this->finalizeReservedIndices(); } GeometryPoolState& newState = fGeomPoolStateStack.push_back(); -#if GR_DEBUG +#ifdef SK_DEBUG newState.fPoolVertexBuffer = (GrVertexBuffer*)DEBUG_INVAL_BUFFER; newState.fPoolStartVertex = DEBUG_INVAL_START_IDX; newState.fPoolIndexBuffer = (GrIndexBuffer*)DEBUG_INVAL_BUFFER; @@ -455,7 +455,7 @@ void GrGpu::releaseReservedIndexSpace() { void GrGpu::onSetVertexSourceToArray(const void* vertexArray, int vertexCount) { this->prepareVertexPool(); GeometryPoolState& geomPoolState = fGeomPoolStateStack.back(); -#if GR_DEBUG +#ifdef SK_DEBUG bool success = #endif fVertexPool->appendVertices(this->getVertexSize(), @@ -470,7 +470,7 @@ void GrGpu::onSetVertexSourceToArray(const void* vertexArray, int vertexCount) { void GrGpu::onSetIndexSourceToArray(const void* indexArray, int indexCount) { this->prepareIndexPool(); GeometryPoolState& geomPoolState = fGeomPoolStateStack.back(); -#if GR_DEBUG +#ifdef SK_DEBUG bool success = #endif fIndexPool->appendIndices(indexCount, diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp index a3c8eba452..16405b488d 100644 --- a/src/gpu/GrGpuFactory.cpp +++ b/src/gpu/GrGpuFactory.cpp @@ -29,7 +29,7 @@ GrGpu* GrGpu::Create(GrBackend backend, GrBackendContext backendContext, GrConte glInterfaceUnref.reset(glInterface); } if (NULL == glInterface) { -#if GR_DEBUG +#ifdef SK_DEBUG GrPrintf("No GL interface provided!\n"); #endif return NULL; diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index 0b7a4880a6..d04538dc23 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -39,7 +39,7 @@ GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrGpu* gpu, GeometryPoolState& poolState = fGeoPoolStateStack.push_back(); poolState.fUsedPoolVertexBytes = 0; poolState.fUsedPoolIndexBytes = 0; -#if GR_DEBUG +#ifdef SK_DEBUG poolState.fPoolVertexBuffer = (GrVertexBuffer*)~0; poolState.fPoolStartVertex = ~0; poolState.fPoolIndexBuffer = (GrIndexBuffer*)~0; @@ -704,7 +704,7 @@ void GrInOrderDrawBuffer::onSetVertexSourceToArray(const void* vertexArray, GeometryPoolState& poolState = fGeoPoolStateStack.back(); SkASSERT(0 == poolState.fUsedPoolVertexBytes); -#if GR_DEBUG +#ifdef SK_DEBUG bool success = #endif fVertexPool.appendVertices(this->getVertexSize(), @@ -719,7 +719,7 @@ void GrInOrderDrawBuffer::onSetIndexSourceToArray(const void* indexArray, int indexCount) { GeometryPoolState& poolState = fGeoPoolStateStack.back(); SkASSERT(0 == poolState.fUsedPoolIndexBytes); -#if GR_DEBUG +#ifdef SK_DEBUG bool success = #endif fIndexPool.appendIndices(indexCount, @@ -745,7 +745,7 @@ void GrInOrderDrawBuffer::geometrySourceWillPush() { GeometryPoolState& poolState = fGeoPoolStateStack.push_back(); poolState.fUsedPoolVertexBytes = 0; poolState.fUsedPoolIndexBytes = 0; -#if GR_DEBUG +#ifdef SK_DEBUG poolState.fPoolVertexBuffer = (GrVertexBuffer*)~0; poolState.fPoolStartVertex = ~0; poolState.fPoolIndexBuffer = (GrIndexBuffer*)~0; diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp index a770792962..83119db98e 100644 --- a/src/gpu/GrMemoryPool.cpp +++ b/src/gpu/GrMemoryPool.cpp @@ -7,7 +7,7 @@ #include "GrMemoryPool.h" -#if GR_DEBUG +#ifdef SK_DEBUG #define VALIDATE this->validate() #else #define VALIDATE diff --git a/src/gpu/GrMemoryPool.h b/src/gpu/GrMemoryPool.h index b33ee82471..5ab8958a8a 100644 --- a/src/gpu/GrMemoryPool.h +++ b/src/gpu/GrMemoryPool.h @@ -72,7 +72,7 @@ private: size_t fMinAllocSize; BlockHeader* fHead; BlockHeader* fTail; -#if GR_DEBUG +#ifdef SK_DEBUG int fAllocationCnt; #endif }; diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index 0addaeda95..4055d2fcf2 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -588,7 +588,7 @@ GrIndexBuffer* GrOvalRenderer::rRectIndexBuffer(GrGpu* gpu) { fRRectIndexBuffer = gpu->createIndexBuffer(sizeof(gRRectIndices), false); if (NULL != fRRectIndexBuffer) { -#if GR_DEBUG +#ifdef SK_DEBUG bool updated = #endif fRRectIndexBuffer->updateData(gRRectIndices, diff --git a/src/gpu/GrRedBlackTree.h b/src/gpu/GrRedBlackTree.h index d9f2d76250..1287d6a3bf 100644 --- a/src/gpu/GrRedBlackTree.h +++ b/src/gpu/GrRedBlackTree.h @@ -158,7 +158,7 @@ private: int onCountOf(const Node* n, const T& t) const; -#if GR_DEBUG +#ifdef SK_DEBUG void validate() const; int checkNode(Node* n, int* blackHeight) const; // checks relationship between a node and its children. allowRedRed means @@ -843,7 +843,7 @@ void GrRedBlackTree<T,C>::RecursiveDelete(Node* x) { } } -#if GR_DEBUG +#ifdef SK_DEBUG template <typename T, typename C> void GrRedBlackTree<T,C>::validate() const { if (fCount) { diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp index 480e0966d0..210cbf8d78 100644 --- a/src/gpu/GrResourceCache.cpp +++ b/src/gpu/GrResourceCache.cpp @@ -37,7 +37,7 @@ GrResourceEntry::~GrResourceEntry() { fResource->unref(); } -#if GR_DEBUG +#ifdef SK_DEBUG void GrResourceEntry::validate() const { SkASSERT(fResource); SkASSERT(fResource->getCacheEntry() == this); @@ -227,7 +227,7 @@ void GrResourceCache::makeExclusive(GrResourceEntry* entry) { this->internalDetach(entry, kIgnore_BudgetBehavior); fCache.remove(entry->key(), entry); -#if GR_DEBUG +#ifdef SK_DEBUG fExclusiveList.addToHead(entry); #endif } @@ -248,7 +248,7 @@ void GrResourceCache::removeInvalidResource(GrResourceEntry* entry) { void GrResourceCache::makeNonExclusive(GrResourceEntry* entry) { GrAutoResourceCacheValidate atcv(this); -#if GR_DEBUG +#ifdef SK_DEBUG fExclusiveList.remove(entry); #endif @@ -360,7 +360,7 @@ void GrResourceCache::purgeAllUnlocked() { fMaxCount = 0; this->purgeAsNeeded(); -#if GR_DEBUG +#ifdef SK_DEBUG SkASSERT(fExclusiveList.countEntries() == fClientDetachedCount); SkASSERT(countBytes(fExclusiveList) == fClientDetachedBytes); if (!fCache.count()) { @@ -379,7 +379,7 @@ void GrResourceCache::purgeAllUnlocked() { /////////////////////////////////////////////////////////////////////////////// -#if GR_DEBUG +#ifdef SK_DEBUG size_t GrResourceCache::countBytes(const EntryList& list) { size_t bytes = 0; @@ -441,7 +441,7 @@ void GrResourceCache::validate() const { SkASSERT(fExclusiveList.countEntries() == fClientDetachedCount); } -#endif // GR_DEBUG +#endif // SK_DEBUG #if GR_CACHE_STATS diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h index 4338d4ade7..5df17defa3 100644 --- a/src/gpu/GrResourceCache.h +++ b/src/gpu/GrResourceCache.h @@ -148,7 +148,7 @@ public: GrResource* resource() const { return fResource; } const GrResourceKey& key() const { return fKey; } -#if GR_DEBUG +#ifdef SK_DEBUG void validate() const; #else void validate() const {} @@ -340,7 +340,7 @@ public: */ void purgeAsNeeded(int extraCount = 0, size_t extraBytes = 0); -#if GR_DEBUG +#ifdef SK_DEBUG void validate() const; #else void validate() const {} @@ -367,7 +367,7 @@ private: typedef SkTInternalLList<GrResourceEntry> EntryList; EntryList fList; -#if GR_DEBUG +#ifdef SK_DEBUG // These objects cannot be returned by a search EntryList fExclusiveList; #endif @@ -397,14 +397,14 @@ private: void internalPurge(int extraCount, size_t extraBytes); -#if GR_DEBUG +#ifdef SK_DEBUG static size_t countBytes(const SkTInternalLList<GrResourceEntry>& list); #endif }; /////////////////////////////////////////////////////////////////////////////// -#if GR_DEBUG +#ifdef SK_DEBUG class GrAutoResourceCacheValidate { public: GrAutoResourceCacheValidate(GrResourceCache* cache) : fCache(cache) { diff --git a/src/gpu/GrTHashCache.h b/src/gpu/GrTHashCache.h index 01b08e7a0c..c614b1dd7c 100644 --- a/src/gpu/GrTHashCache.h +++ b/src/gpu/GrTHashCache.h @@ -53,7 +53,7 @@ public: */ int slowFindIndex(T* elem) const { return fSorted.find(elem); } -#if GR_DEBUG +#ifdef SK_DEBUG void validate() const; bool contains(T*) const; #endif @@ -225,7 +225,7 @@ void GrTHashTable<T, Key, kHashBits>::unrefAll() { Gr_bzero(fHash, sizeof(fHash)); } -#if GR_DEBUG +#ifdef SK_DEBUG template <typename T, typename Key, size_t kHashBits> void GrTHashTable<T, Key, kHashBits>::validate() const { int count = fSorted.count(); diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp index 6533d565ef..9ef9a54889 100644 --- a/src/gpu/GrTextStrike.cpp +++ b/src/gpu/GrTextStrike.cpp @@ -115,7 +115,7 @@ void GrFontCache::freeAtlasExceptFor(GrTextStrike* preserveStrike) { } } -#if GR_DEBUG +#ifdef SK_DEBUG void GrFontCache::validate() const { int count = fCache.count(); if (0 == count) { @@ -147,7 +147,7 @@ void GrFontCache::validate() const { /////////////////////////////////////////////////////////////////////////////// -#if GR_DEBUG +#ifdef SK_DEBUG static int gCounter; #endif @@ -171,7 +171,7 @@ GrTextStrike::GrTextStrike(GrFontCache* cache, const GrKey* key, fMaskFormat = format; -#if GR_DEBUG +#ifdef SK_DEBUG // GrPrintf(" GrTextStrike %p %d\n", this, gCounter); gCounter += 1; #endif @@ -192,7 +192,7 @@ GrTextStrike::~GrTextStrike() { fFontScalerKey->unref(); fCache.getArray().visitAll(free_glyph); -#if GR_DEBUG +#ifdef SK_DEBUG gCounter -= 1; // GrPrintf("~GrTextStrike %p %d\n", this, gCounter); #endif diff --git a/src/gpu/GrTextStrike.h b/src/gpu/GrTextStrike.h index 64c4b90db3..a5abde6fac 100644 --- a/src/gpu/GrTextStrike.h +++ b/src/gpu/GrTextStrike.h @@ -95,7 +95,7 @@ public: } GrTextStrike* getHeadStrike() const { return fHead; } -#if GR_DEBUG +#ifdef SK_DEBUG void validate() const; #else void validate() const {} diff --git a/src/gpu/GrTextureAccess.cpp b/src/gpu/GrTextureAccess.cpp index 122a2090aa..e4b078698d 100644 --- a/src/gpu/GrTextureAccess.cpp +++ b/src/gpu/GrTextureAccess.cpp @@ -10,7 +10,7 @@ #include "GrTexture.h" GrTextureAccess::GrTextureAccess() { -#if GR_DEBUG +#ifdef SK_DEBUG memcpy(fSwizzle, "void", 5); fSwizzleMask = 0xbeeffeed; #endif diff --git a/src/gpu/gl/GrGLBufferImpl.cpp b/src/gpu/gl/GrGLBufferImpl.cpp index 787f40fb34..1d77070ebf 100644 --- a/src/gpu/gl/GrGLBufferImpl.cpp +++ b/src/gpu/gl/GrGLBufferImpl.cpp @@ -10,7 +10,7 @@ #define GL_CALL(GPU, X) GR_GL_CALL(GPU->glInterface(), X) -#if GR_DEBUG +#ifdef SK_DEBUG #define VALIDATE() this->validate() #else #define VALIDATE() do {} while(false) diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index 83ab232810..cae44bfd0c 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -650,7 +650,7 @@ bool GrGLProgram::genProgram(const GrEffectStage* colorStages[], /////////////////////////////////////////////////////////////////////////// // insert GS -#if GR_DEBUG +#ifdef SK_DEBUG this->genGeometryShader(&builder); #endif diff --git a/src/gpu/gl/GrGLProgramDesc.h b/src/gpu/gl/GrGLProgramDesc.h index 8c441b09e0..495a2250cc 100644 --- a/src/gpu/gl/GrGLProgramDesc.h +++ b/src/gpu/gl/GrGLProgramDesc.h @@ -14,9 +14,13 @@ class GrGpuGL; -// optionally compile the experimental GS code. Set to GR_DEBUG so that debug build bots will -// execute the code. -#define GR_GL_EXPERIMENTAL_GS GR_DEBUG +#ifdef SK_DEBUG + // Optionally compile the experimental GS code. Set to SK_DEBUG so that debug build bots will + // execute the code. + #define GR_GL_EXPERIMENTAL_GS 1 +#else + #define GR_GL_EXPERIMENTAL_GS 0 +#endif /** This class describes a program to generate. It also serves as a program cache key. Very little diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 7a1f4be3fd..a55aaa8613 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -895,7 +895,7 @@ static GrTexture* return_null_texture() { return NULL; } -#if 0 && GR_DEBUG +#if 0 && defined(SK_DEBUG) static size_t as_size_t(int x) { return x; } @@ -1125,7 +1125,7 @@ bool GrGpuGL::attachStencilBufferToRenderTarget(GrStencilBuffer* sb, GrRenderTar GL_CALL(FramebufferRenderbuffer(GR_GL_FRAMEBUFFER, GR_GL_DEPTH_ATTACHMENT, GR_GL_RENDERBUFFER, 0)); -#if GR_DEBUG +#ifdef SK_DEBUG GrGLenum status; GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status); @@ -1545,7 +1545,7 @@ void GrGpuGL::flushRenderTarget(const SkIRect* bound) { if (fHWBoundRenderTarget != rt) { GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, rt->renderFBOID())); -#if GR_DEBUG +#ifdef SK_DEBUG GrGLenum status; GL_CALL_RET(status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); if (status != GR_GL_FRAMEBUFFER_COMPLETE) { diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp index 5548320631..3f58c1bf73 100644 --- a/src/gpu/gl/GrGpuGL_program.cpp +++ b/src/gpu/gl/GrGpuGL_program.cpp @@ -165,7 +165,7 @@ GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrGLProgramDesc& desc, memmove(fEntries + purgeIdx, fEntries + purgeIdx + 1, copySize); fEntries[entryIdx - 1] = entry; } -#if GR_DEBUG +#ifdef SK_DEBUG SkASSERT(NULL != fEntries[0]->fProgram.get()); for (int i = 0; i < fCount - 1; ++i) { SkASSERT(NULL != fEntries[i + 1]->fProgram.get()); diff --git a/src/gpu/gr_unittests.cpp b/src/gpu/gr_unittests.cpp index a6a43c4f27..f586a94be7 100644 --- a/src/gpu/gr_unittests.cpp +++ b/src/gpu/gr_unittests.cpp @@ -17,7 +17,7 @@ void gr_run_unittests(); // If we aren't inheriting these as #defines from elsewhere, // clang demands they be declared before we #include the template // that relies on them. -#if GR_DEBUG +#ifdef SK_DEBUG static bool LT(const int& elem, int value) { return elem < value; } |