diff options
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/include/GrConfig.h | 27 | ||||
-rw-r--r-- | gpu/include/GrPath.h | 2 | ||||
-rw-r--r-- | gpu/src/GrGLUtil.cpp | 2 | ||||
-rw-r--r-- | gpu/src/GrGpuGL.cpp | 6 | ||||
-rw-r--r-- | gpu/src/GrGpuGL.h | 4 | ||||
-rw-r--r-- | gpu/src/GrGpuGLShaders.cpp | 4 | ||||
-rw-r--r-- | gpu/src/GrPath.cpp | 2 |
7 files changed, 24 insertions, 23 deletions
diff --git a/gpu/include/GrConfig.h b/gpu/include/GrConfig.h index 9c18f60ef6..e933b031a3 100644 --- a/gpu/include/GrConfig.h +++ b/gpu/include/GrConfig.h @@ -68,7 +68,7 @@ #undef GR_IOS_BUILD #define GR_IOS_BUILD 1 // #error "IOS" - #elif ANDROID_NDK || defined(ANDROID) + #elif (defined(ANDROID_NDK) && ANDROID_NDK) || defined(ANDROID) #undef GR_ANDROID_BUILD #define GR_ANDROID_BUILD 1 // #error "ANDROID" @@ -87,15 +87,28 @@ #endif #endif -#if !defined(GR_DEBUG) && !defined(GR_RELEASE) - #ifdef NDEBUG - #define GR_DEBUG 0 +// 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 - #define GR_DEBUG 1 + #ifdef NDEBUG + #define GR_DEBUG 0 + #else + #define GR_DEBUG 1 + #endif #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 +#endif + /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -159,7 +172,7 @@ extern void GrPrintf(const char format[], ...); * particular compiler. * To insert compiler warnings use "#pragma message GR_WARN(<string>)" */ -#if _MSC_VER +#if defined(_MSC_VER) && _MSC_VER #define GR_WARN(MSG) (GR_FILE_AND_LINE_STR "WARNING: " MSG) #else//__GNUC__ - may need other defines for different compilers #define GR_WARN(MSG) ("WARNING: " MSG) @@ -239,7 +252,7 @@ extern void GrPrintf(const char format[], ...); // VS 2010 and GCC compiled with c++0x or gnu++0x support the new // static_assert. #if !defined(GR_STATIC_ASSERT) - #if (_MSC_VER >= 1600) || __GXX_EXPERIMENTAL_CXX0X__ + #if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__) #define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug") #else template <bool> class GR_STATIC_ASSERT_FAILURE; diff --git a/gpu/include/GrPath.h b/gpu/include/GrPath.h index a9b75665c3..cf7b97f2d8 100644 --- a/gpu/include/GrPath.h +++ b/gpu/include/GrPath.h @@ -78,6 +78,8 @@ private: } friend class Iter; + + typedef GrPathSink INHERITED; }; #endif diff --git a/gpu/src/GrGLUtil.cpp b/gpu/src/GrGLUtil.cpp index c1ed0f44b7..360e84e263 100644 --- a/gpu/src/GrGLUtil.cpp +++ b/gpu/src/GrGLUtil.cpp @@ -104,7 +104,7 @@ extern void GrGLInitExtensions(GrGLExts* exts) { bool fboFound = false;
#if GR_SUPPORT_GLDESKTOP
- #if GL_VERSION_3_0
+ #if defined(GL_VERSION_3_0) && GL_VERSION_3_0
if (!fboFound && major >= 3) { // all of ARB_fbo is in 3.x
exts->GenFramebuffers = glGenFramebuffers;
exts->BindFramebuffer = glBindFramebuffer;
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp index f0c7cff881..ae27189d08 100644 --- a/gpu/src/GrGpuGL.cpp +++ b/gpu/src/GrGpuGL.cpp @@ -1166,12 +1166,6 @@ void GrGpuGL::drawNonIndexedHelper(PrimitiveType type, GR_GL(DrawArrays(gPrimitiveType2GLMode[type], 0, vertexCount)); } -#if !defined(SK_GL_HAS_COLOR4UB) -static inline GrFixed byte2fixed(unsigned value) { - return (value + (value >> 7)) << 8; -} -#endif - void GrGpuGL::resolveTextureRenderTarget(GrGLTexture* texture) { GrGLRenderTarget* rt = (GrGLRenderTarget*) texture->asRenderTarget(); diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h index dbc5de3acb..0ba405d457 100644 --- a/gpu/src/GrGpuGL.h +++ b/gpu/src/GrGpuGL.h @@ -177,10 +177,6 @@ void gl_version(int* major, int* minor); #define GrGL_RestoreResetRowLength() #endif -#if SK_TextGLType != GL_FIXED - #define SK_GL_HAS_COLOR4UB -#endif - /* * Some drivers want the var-int arg to be zero-initialized on input. */ diff --git a/gpu/src/GrGpuGLShaders.cpp b/gpu/src/GrGpuGLShaders.cpp index c7baf1f63e..053479f97b 100644 --- a/gpu/src/GrGpuGLShaders.cpp +++ b/gpu/src/GrGpuGLShaders.cpp @@ -192,11 +192,7 @@ static const char* gfshad[] = { "void main() {\n" // On Brian's PC laptop with Intel Gfx texture2DProj seems to be broken // but it works everywhere else tested. -#if GR_GLSL_2DPROJ_BROKEN - " gl_FragColor = vColor * texture2D(sTexture, vTexture.xy / vTexture.z);\n" -#else " gl_FragColor = vColor * texture2DProj(sTexture, vTexture);\n" -#endif "}\n", diff --git a/gpu/src/GrPath.cpp b/gpu/src/GrPath.cpp index 7b117ebf41..554b3b915a 100644 --- a/gpu/src/GrPath.cpp +++ b/gpu/src/GrPath.cpp @@ -2,7 +2,7 @@ GrPath::GrPath() {} -GrPath::GrPath(const GrPath& src) { +GrPath::GrPath(const GrPath& src) : INHERITED() { } GrPath::GrPath(GrPathIter& iter) { |