Replace uses of GR_DEBUGCODE by SkDEBUGCODE.

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

Author: tfarina@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11142 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAllocPool.cpp b/src/gpu/GrAllocPool.cpp
index 1d8dc45..dc81ee2 100644
--- a/src/gpu/GrAllocPool.cpp
+++ b/src/gpu/GrAllocPool.cpp
@@ -57,7 +57,7 @@
 GrAllocPool::GrAllocPool(size_t blockSize) {
     fBlock = NULL;
     fMinBlockSize = GrMax(blockSize, GrAllocPool_MIN_BLOCK_SIZE);
-    GR_DEBUGCODE(fBlocksAllocated = 0;)
+    SkDEBUGCODE(fBlocksAllocated = 0;)
 }
 
 GrAllocPool::~GrAllocPool() {
@@ -74,7 +74,7 @@
         block = next;
     }
     fBlock = NULL;
-    GR_DEBUGCODE(fBlocksAllocated = 0;)
+    SkDEBUGCODE(fBlocksAllocated = 0;)
 }
 
 void* GrAllocPool::alloc(size_t size) {
@@ -83,7 +83,7 @@
     if (!fBlock || !fBlock->canAlloc(size)) {
         size_t blockSize = GrMax(fMinBlockSize, size);
         fBlock = Block::Create(blockSize, fBlock);
-        GR_DEBUGCODE(fBlocksAllocated += 1;)
+        SkDEBUGCODE(fBlocksAllocated += 1;)
     }
     return fBlock->alloc(size);
 }
@@ -97,7 +97,7 @@
             Block* next = fBlock->fNext;
             GrFree(fBlock);
             fBlock = next;
-            GR_DEBUGCODE(fBlocksAllocated -= 1;)
+            SkDEBUGCODE(fBlocksAllocated -= 1;)
         }
     }
 }
diff --git a/src/gpu/GrAllocator.h b/src/gpu/GrAllocator.h
index 4b81f25..c37b119 100755
--- a/src/gpu/GrAllocator.h
+++ b/src/gpu/GrAllocator.h
@@ -38,7 +38,7 @@
         SkASSERT(itemsPerBlock > 0);
         fBlockSize = fItemSize * fItemsPerBlock;
         fBlocks.push_back() = initialBlock;
-        GR_DEBUGCODE(if (!fOwnFirstBlock) {*((char*)initialBlock+fBlockSize-1)='a';} );
+        SkDEBUGCODE(if (!fOwnFirstBlock) {*((char*)initialBlock+fBlockSize-1)='a';} );
     }
 
     /**
diff --git a/src/gpu/GrBlend.cpp b/src/gpu/GrBlend.cpp
index 31e45fa..c8631c4 100644
--- a/src/gpu/GrBlend.cpp
+++ b/src/gpu/GrBlend.cpp
@@ -113,7 +113,7 @@
             break;
     }
     // We may have invalidated these above and shouldn't read them again.
-    GR_DEBUGCODE(dstColor = constantColor = GrColor_ILLEGAL;)
+    SkDEBUGCODE(dstColor = constantColor = GrColor_ILLEGAL;)
 
     if (kZero_GrBlendCoeff == *srcCoeff || (valid_color(srcCompFlags) && 0 == srcColor)) {
         *srcCoeff = kZero_GrBlendCoeff;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index b6555c4..5145b29 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1536,10 +1536,10 @@
         // handle the unpremul step on the CPU if we couldn't create an effect to do it.
         if (NULL == effect) {
             SkCanvas::Config8888 srcConfig8888, dstConfig8888;
-            GR_DEBUGCODE(bool success = )
+            SkDEBUGCODE(bool success = )
             grconfig_to_config8888(srcConfig, true, &srcConfig8888);
             SkASSERT(success);
-            GR_DEBUGCODE(success = )
+            SkDEBUGCODE(success = )
             grconfig_to_config8888(srcConfig, false, &dstConfig8888);
             SkASSERT(success);
             const uint32_t* src = reinterpret_cast<const uint32_t*>(buffer);
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 0aa4215..d1d6c58 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -400,7 +400,7 @@
 
 void GrDrawState::AutoViewMatrixRestore::restore() {
     if (NULL != fDrawState) {
-        GR_DEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;)
+        SkDEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;)
         fDrawState->fCommon.fViewMatrix = fViewMatrix;
         SkASSERT(fDrawState->numColorStages() >= fNumColorStages);
         int numCoverageStages = fSavedCoordChanges.count() - fNumColorStages;
@@ -431,7 +431,7 @@
     drawState->fCommon.fViewMatrix.preConcat(preconcatMatrix);
 
     this->doEffectCoordChanges(preconcatMatrix);
-    GR_DEBUGCODE(++fDrawState->fBlockEffectRemovalCnt;)
+    SkDEBUGCODE(++fDrawState->fBlockEffectRemovalCnt;)
 }
 
 bool GrDrawState::AutoViewMatrixRestore::setIdentity(GrDrawState* drawState) {
@@ -451,7 +451,7 @@
         fDrawState = drawState;
         fNumColorStages = 0;
         fSavedCoordChanges.reset(0);
-        GR_DEBUGCODE(++fDrawState->fBlockEffectRemovalCnt;)
+        SkDEBUGCODE(++fDrawState->fBlockEffectRemovalCnt;)
         return true;
     } else {
         SkMatrix inv;
@@ -461,7 +461,7 @@
         drawState->fCommon.fViewMatrix.reset();
         fDrawState = drawState;
         this->doEffectCoordChanges(inv);
-        GR_DEBUGCODE(++fDrawState->fBlockEffectRemovalCnt;)
+        SkDEBUGCODE(++fDrawState->fBlockEffectRemovalCnt;)
         return true;
     }
 }
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 25c8cb1..ef6cc46 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -30,12 +30,12 @@
     SK_DECLARE_INST_COUNT(GrDrawState)
 
     GrDrawState() {
-        GR_DEBUGCODE(fBlockEffectRemovalCnt = 0;)
+        SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
         this->reset();
     }
 
     GrDrawState(const SkMatrix& initialViewMatrix) {
-        GR_DEBUGCODE(fBlockEffectRemovalCnt = 0;)
+        SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
         this->reset(initialViewMatrix);
     }
 
@@ -43,7 +43,7 @@
      * Copies another draw state.
      **/
     GrDrawState(const GrDrawState& state) : INHERITED() {
-        GR_DEBUGCODE(fBlockEffectRemovalCnt = 0;)
+        SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
         *this = state;
     }
 
@@ -51,7 +51,7 @@
      * Copies another draw state with a preconcat to the view matrix.
      **/
     GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatrix) {
-        GR_DEBUGCODE(fBlockEffectRemovalCnt = 0;)
+        SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
         *this = state;
         if (!preConcatMatrix.isIdentity()) {
             for (int i = 0; i < fColorStages.count(); ++i) {
@@ -419,13 +419,13 @@
                 n = fDrawState->fCoverageStages.count() - fCoverageEffectCnt;
                 SkASSERT(n >= 0);
                 fDrawState->fCoverageStages.pop_back_n(n);
-                GR_DEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;)
+                SkDEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;)
             }
             fDrawState = ds;
             if (NULL != ds) {
                 fColorEffectCnt = ds->fColorStages.count();
                 fCoverageEffectCnt = ds->fCoverageStages.count();
-                GR_DEBUGCODE(++ds->fBlockEffectRemovalCnt;)
+                SkDEBUGCODE(++ds->fBlockEffectRemovalCnt;)
             }
         }
 
@@ -981,7 +981,7 @@
     class DeferredState {
     public:
         DeferredState() : fRenderTarget(NULL) {
-            GR_DEBUGCODE(fInitialized = false;)
+            SkDEBUGCODE(fInitialized = false;)
         }
         // TODO: Remove this when DeferredState no longer holds a ref to the RT
         ~DeferredState() { SkSafeUnref(fRenderTarget); }
@@ -1002,7 +1002,7 @@
             for (int i = 0; i < drawState.fCoverageStages.count(); ++i) {
                 fStages[i + fColorStageCnt].saveFrom(drawState.fCoverageStages[i]);
             }
-            GR_DEBUGCODE(fInitialized = true;)
+            SkDEBUGCODE(fInitialized = true;)
         }
 
         void restoreTo(GrDrawState* drawState) {
@@ -1053,7 +1053,7 @@
         int                                   fColorStageCnt;
         DeferredStageArray                    fStages;
 
-        GR_DEBUGCODE(bool fInitialized;)
+        SkDEBUGCODE(bool fInitialized;)
     };
 
 private:
@@ -1067,7 +1067,7 @@
 
     // Some of the auto restore objects assume that no effects are removed during their lifetime.
     // This is used to assert that this condition holds.
-    GR_DEBUGCODE(int fBlockEffectRemovalCnt;)
+    SkDEBUGCODE(int fBlockEffectRemovalCnt;)
 
     /**
      *  Sets vertex attributes for next draw.
diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp
index 83119db..83b02bd 100644
--- a/src/gpu/GrMemoryPool.cpp
+++ b/src/gpu/GrMemoryPool.cpp
@@ -14,7 +14,7 @@
 #endif
 
 GrMemoryPool::GrMemoryPool(size_t preallocSize, size_t minAllocSize) {
-    GR_DEBUGCODE(fAllocationCnt = 0);
+    SkDEBUGCODE(fAllocationCnt = 0);
 
     minAllocSize = GrMax<size_t>(minAllocSize, 1 << 10);
     fMinAllocSize = GrSizeAlignUp(minAllocSize + kPerAllocPad, kAlignment),
@@ -61,7 +61,7 @@
     fTail->fCurrPtr += size;
     fTail->fFreeSize -= size;
     fTail->fLiveCount += 1;
-    GR_DEBUGCODE(++fAllocationCnt);
+    SkDEBUGCODE(++fAllocationCnt);
     VALIDATE;
     return reinterpret_cast<void*>(ptr);
 }
@@ -98,7 +98,7 @@
             block->fCurrPtr = block->fPrevPtr;
         }
     }
-    GR_DEBUGCODE(--fAllocationCnt);
+    SkDEBUGCODE(--fAllocationCnt);
     VALIDATE;
 }
 
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 7bf7df0..c5a4425 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -78,11 +78,11 @@
     path.getPoints(&pathPoints[0], pointCnt);
     path.getVerbs(&pathCommands[0], verbCnt);
 
-    GR_DEBUGCODE(int numPts = 0);
+    SkDEBUGCODE(int numPts = 0);
     for (int i = 0; i < verbCnt; ++i) {
         SkPath::Verb v = static_cast<SkPath::Verb>(pathCommands[i]);
         pathCommands[i] = verb_to_gl_path_cmd(v);
-        GR_DEBUGCODE(numPts += num_pts(v));
+        SkDEBUGCODE(numPts += num_pts(v));
     }
     SkASSERT(pathPoints.count() == numPts);
 
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 5e00d7f..f73520c 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -334,7 +334,7 @@
 
     BuilderUniform& uni = fUniforms.push_back();
     UniformHandle h = GrGLUniformManager::UniformHandle::CreateFromUniformIndex(fUniforms.count() - 1);
-    GR_DEBUGCODE(UniformHandle h2 =)
+    SkDEBUGCODE(UniformHandle h2 =)
     fUniformManager.appendUniform(type, count);
     // We expect the uniform manager to initially have no uniforms and that all uniforms are added
     // by this function. Therefore, the handles should match.
diff --git a/src/gpu/gr_unittests.cpp b/src/gpu/gr_unittests.cpp
index f586a94..cf298cc 100644
--- a/src/gpu/gr_unittests.cpp
+++ b/src/gpu/gr_unittests.cpp
@@ -74,7 +74,7 @@
 
 
 void gr_run_unittests() {
-    GR_DEBUGCODE(test_bsearch();)
+    SkDEBUGCODE(test_bsearch();)
     test_binHashKey();
     GrRedBlackTree<int>::UnitTest();
 }