From 515dcd36032997ce335daa0163c6d67e851bcad1 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 28 Aug 2013 14:17:03 +0000 Subject: 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 --- include/gpu/GrConfig.h | 32 ++++++++++---------------------- include/gpu/GrEffect.h | 2 +- include/gpu/GrResource.h | 2 +- include/gpu/GrTBackendEffectFactory.h | 2 +- include/gpu/GrTexture.h | 2 +- include/gpu/GrTextureAccess.h | 2 +- include/gpu/GrTypes.h | 2 +- include/gpu/GrUserConfig.h | 9 --------- include/gpu/SkGr.h | 4 ++-- include/gpu/gl/GrGLConfig.h | 14 +++++++++++--- 10 files changed, 29 insertions(+), 42 deletions(-) (limited to 'include/gpu') diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h index d47ccb3fe8..ad8c1d21af 100644 --- a/include/gpu/GrConfig.h +++ b/include/gpu/GrConfig.h @@ -85,26 +85,14 @@ #endif #endif -// we need both GR_DEBUG and GR_RELEASE to be defined as 0 or 1 -// -#ifndef GR_DEBUG - #ifdef GR_RELEASE - #define GR_DEBUG !GR_RELEASE - #else - #ifdef NDEBUG - #define GR_DEBUG 0 - #else - #define GR_DEBUG 1 - #endif +#if !defined(SK_DEBUG) && !GR_RELEASE + #ifdef NDEBUG + #define GR_RELEASE 1 #endif #endif -#ifndef GR_RELEASE - #define GR_RELEASE !GR_DEBUG -#endif - -#if GR_DEBUG == GR_RELEASE - #error "GR_DEBUG and GR_RELEASE must not be the same" +#if defined(SK_DEBUG) && GR_RELEASE + #error "cannot define both SK_DEBUG and GR_RELEASE" #endif /////////////////////////////////////////////////////////////////////////////// @@ -142,8 +130,8 @@ typedef unsigned __int64 uint64_t; * A alternate user config file can be specified by defining * GR_USER_CONFIG_FILE. It should be defined relative to GrConfig.h * - * e.g. it can specify GR_DEBUG/GR_RELEASE as it please, change the BUILD - * target, or supply its own defines for anything else (e.g. GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT) + * e.g. it can change the BUILD target or supply its own defines for anything + * else (e.g. GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT) */ #if !defined(GR_USER_CONFIG_FILE) #include "GrUserConfig.h" @@ -212,7 +200,7 @@ typedef unsigned __int64 uint64_t; * GR_DEBUGBREAK is an unconditional break in debug builds. */ #if !defined(GR_DEBUGBREAK) - #if GR_DEBUG + #ifdef SK_DEBUG #define GR_DEBUGBREAK GR_ALWAYSBREAK #else #define GR_DEBUGBREAK @@ -236,7 +224,7 @@ typedef unsigned __int64 uint64_t; * GR_DEBUGASSERT is an assertion in debug builds only. */ #if !defined(GR_DEBUGASSERT) - #if GR_DEBUG + #ifdef SK_DEBUG #define GR_DEBUGASSERT(COND) GR_ALWAYSASSERT(COND) #else #define GR_DEBUGASSERT(COND) @@ -261,7 +249,7 @@ inline void GrDebugCrash(const char* msg) { GrPrintf(msg); SkASSERT(false); } * GR_DEBUGCODE compiles the code X in debug builds only */ #if !defined(GR_DEBUGCODE) - #if GR_DEBUG + #ifdef SK_DEBUG #define GR_DEBUGCODE(X) X #else #define GR_DEBUGCODE(X) diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h index d8757b2ced..942e580d4c 100644 --- a/include/gpu/GrEffect.h +++ b/include/gpu/GrEffect.h @@ -287,7 +287,7 @@ private: return false; } bool result = this->onIsEqual(other); -#if GR_DEBUG +#ifdef SK_DEBUG if (result) { SkASSERT(this->numTextures() == other.numTextures()); for (int i = 0; i < this->numTextures(); ++i) { diff --git a/include/gpu/GrResource.h b/include/gpu/GrResource.h index 61a089ed47..c52fa044f2 100644 --- a/include/gpu/GrResource.h +++ b/include/gpu/GrResource.h @@ -92,7 +92,7 @@ protected: bool isWrapped() const { return kWrapped_Flag & fFlags; } private: -#if GR_DEBUG +#ifdef SK_DEBUG friend class GrGpu; // for assert in GrGpu to access getGpu #endif diff --git a/include/gpu/GrTBackendEffectFactory.h b/include/gpu/GrTBackendEffectFactory.h index 87ace756ec..1a01e1c274 100644 --- a/include/gpu/GrTBackendEffectFactory.h +++ b/include/gpu/GrTBackendEffectFactory.h @@ -36,7 +36,7 @@ public: EffectKey effectKey = GLEffect::GenKey(drawEffect, caps); EffectKey textureKey = GLEffect::GenTextureKey(drawEffect, caps); EffectKey attribKey = GLEffect::GenAttribKey(drawEffect); -#if GR_DEBUG +#ifdef SK_DEBUG static const EffectKey kIllegalIDMask = (uint16_t) (~((1U << kEffectKeyBits) - 1)); SkASSERT(!(kIllegalIDMask & effectKey)); diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index f1c855dc4b..4fe189403f 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -120,7 +120,7 @@ public: */ virtual void invalidateCachedState() = 0; -#if GR_DEBUG +#ifdef SK_DEBUG void validate() const { this->INHERITED::validate(); diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h index e3ab79fdf6..0f44807466 100644 --- a/include/gpu/GrTextureAccess.h +++ b/include/gpu/GrTextureAccess.h @@ -149,7 +149,7 @@ public: SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); bool operator== (const GrTextureAccess& other) const { -#if GR_DEBUG +#ifdef SK_DEBUG // below assumes all chars in fSwizzle are initialized even if string is < 4 chars long. SkASSERT(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1) == strcmp(fSwizzle, other.fSwizzle)); diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 3a52804be9..497f9389f0 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -163,7 +163,7 @@ static inline int GrNextPow2(int n) { */ typedef int32_t GrFixed; -#if GR_DEBUG +#ifdef SK_DEBUG static inline int16_t GrToS16(intptr_t x) { SkASSERT((int16_t)x == x); diff --git a/include/gpu/GrUserConfig.h b/include/gpu/GrUserConfig.h index a10d339381..6bae564539 100644 --- a/include/gpu/GrUserConfig.h +++ b/include/gpu/GrUserConfig.h @@ -1,4 +1,3 @@ - /* * Copyright 2010 Google Inc. * @@ -6,7 +5,6 @@ * found in the LICENSE file. */ - #ifndef GrUserConfig_DEFINED #define GrUserConfig_DEFINED @@ -14,13 +12,6 @@ #error "default user config pulled in but GR_USER_CONFIG_FILE is defined." #endif -#if 0 - #undef GR_RELEASE - #undef GR_DEBUG - #define GR_RELEASE 0 - #define GR_DEBUG 1 -#endif - /** * This gives a threshold in bytes of when to lock a GrGeometryBuffer vs using * updateData. (Note the depending on the underlying 3D API the update functions diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h index 1f72fbc2c5..15e54a3871 100644 --- a/include/gpu/SkGr.h +++ b/include/gpu/SkGr.h @@ -25,8 +25,8 @@ #include "SkRegion.h" #include "SkClipStack.h" -#if (GR_DEBUG && defined(SK_RELEASE)) || (GR_RELEASE && defined(SK_DEBUG)) -// #error "inconsistent GR_DEBUG and SK_DEBUG" +#if (GR_RELEASE && defined(SK_DEBUG)) +// #error "inconsistent GR_RELEASE and SK_DEBUG" #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/include/gpu/gl/GrGLConfig.h b/include/gpu/gl/GrGLConfig.h index 81cba1badf..1f7c9e29f5 100644 --- a/include/gpu/gl/GrGLConfig.h +++ b/include/gpu/gl/GrGLConfig.h @@ -39,7 +39,7 @@ * GR_GL_LOG_CALLS is 1. Defaults to 0. * * GR_GL_CHECK_ERROR: if enabled Gr can do a glGetError() after every GL call. - * Defaults to 1 if GR_DEBUG is set, otherwise 0. When GR_GL_CHECK_ERROR is 1 + * Defaults to 1 if SK_DEBUG is set, otherwise 0. When GR_GL_CHECK_ERROR is 1 * this can be toggled in a debugger using the gCheckErrorGL global. The initial * value of gCheckErrorGL is controlled by by GR_GL_CHECK_ERROR_START. * @@ -107,7 +107,11 @@ */ #if !defined(GR_GL_LOG_CALLS) - #define GR_GL_LOG_CALLS GR_DEBUG + #ifdef SK_DEBUG + #define GR_GL_LOG_CALLS 1 + #else + #define GR_GL_LOG_CALLS 0 + #endif #endif #if !defined(GR_GL_LOG_CALLS_START) @@ -115,7 +119,11 @@ #endif #if !defined(GR_GL_CHECK_ERROR) - #define GR_GL_CHECK_ERROR GR_DEBUG + #ifdef SK_DEBUG + #define GR_GL_CHECK_ERROR 1 + #else + #define GR_GL_CHECK_ERROR 0 + #endif #endif #if !defined(GR_GL_CHECK_ERROR_START) -- cgit v1.2.3