Move the default definition of GR_USE_NEW_SHADER_SOURCE_SIGNATURE to GrGLConfig.
R=senorblanco@google.com Review URL: https://codereview.chromium.org/12390021 git-svn-id: http://skia.googlecode.com/svn/trunk@7904 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
c7565d177f
commit
26fb61ae46
@ -343,15 +343,6 @@ inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); }
|
||||
#define GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT 96
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE is for compatibility with the new version
|
||||
* of the OpenGLES2.0 headers from Khronos. glShaderSource now takes a const char * const *,
|
||||
* instead of a const char **.
|
||||
*/
|
||||
#if !defined(GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE)
|
||||
#define GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GR_STROKE_PATH_RENDERING controls whether or not the GrStrokePathRenderer can be selected
|
||||
* as a path renderer. GrStrokePathRenderer is currently an experimental path renderer.
|
||||
|
@ -100,6 +100,10 @@
|
||||
* GR_GL_MUST_USE_VBO: Indicates that all vertices and indices must be rendered
|
||||
* from VBOs. Chromium's command buffer doesn't allow glVertexAttribArray with
|
||||
* ARARY_BUFFER 0 bound or glDrawElements with ELEMENT_ARRAY_BUFFER 0 bound.
|
||||
*
|
||||
* GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE is for compatibility with the new version
|
||||
* of the OpenGLES2.0 headers from Khronos. glShaderSource now takes a const char * const *,
|
||||
* instead of a const char
|
||||
*/
|
||||
|
||||
#if !defined(GR_GL_LOG_CALLS)
|
||||
@ -154,6 +158,10 @@
|
||||
#define GR_GL_MUST_USE_VBO 0
|
||||
#endif
|
||||
|
||||
#if !defined(GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE)
|
||||
#define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* There is a strange bug that occurs on Macs with NVIDIA GPUs. We don't
|
||||
* fully understand it. When (element) array buffers are continually
|
||||
|
@ -39,6 +39,6 @@
|
||||
|
||||
// Use updated Khronos signature for glShaderSource
|
||||
// (const char* const instead of char**).
|
||||
#define GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE 1
|
||||
#define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 1
|
||||
|
||||
#endif
|
||||
|
@ -123,7 +123,7 @@ extern "C" {
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLRenderbufferStorageMultisampleCoverageProc)(GrGLenum target, GrGLsizei coverageSamples, GrGLsizei colorSamples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLResolveMultisampleFramebufferProc)();
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
|
||||
#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE
|
||||
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char* const * str, const GrGLint* length);
|
||||
#else
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length);
|
||||
|
@ -168,7 +168,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLScissor(GrGLint x,
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLShaderSource(GrGLuint shader,
|
||||
GrGLsizei count,
|
||||
#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE
|
||||
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
|
||||
const char* const * str,
|
||||
#else
|
||||
const char** str,
|
||||
|
@ -103,7 +103,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE noOpGLScissor(GrGLint x,
|
||||
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLShaderSource(GrGLuint shader,
|
||||
GrGLsizei count,
|
||||
#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE
|
||||
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
|
||||
const char* const * str,
|
||||
#else
|
||||
const char** str,
|
||||
|
@ -69,7 +69,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
interface->fPixelStorei = glPixelStorei;
|
||||
interface->fReadPixels = glReadPixels;
|
||||
interface->fScissor = glScissor;
|
||||
#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE
|
||||
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
|
||||
interface->fShaderSource = (GrGLShaderSourceProc) glShaderSource;
|
||||
#else
|
||||
interface->fShaderSource = glShaderSource;
|
||||
|
@ -115,7 +115,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
interface->fReadPixels = glReadPixels;
|
||||
interface->fScissor = glScissor;
|
||||
// The new OpenGLES2 header has an extra "const" in it. :(
|
||||
#if GR_USE_NEW_GL_SHADER_SOURCE_SIGNATURE
|
||||
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
|
||||
interface->fShaderSource = (GrGLShaderSourceProc) glShaderSource;
|
||||
#else
|
||||
interface->fShaderSource = glShaderSource;
|
||||
|
Loading…
Reference in New Issue
Block a user