From bf858b7ef0e26b459ac02d922f5cae2e2d44792b Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 19 Jan 2011 19:04:04 +0000 Subject: update chrome-specific glconfig (should make versions of this for mac/win/linux) git-svn-id: http://skia.googlecode.com/svn/trunk@715 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gpu/include/GrGLConfig.h | 6 ++-- gpu/include/GrGLConfig_chrome.h | 19 ++++++++++++ gpu/include/GrGLCustomSetupHeader_chrome.h | 12 -------- gpu/src/GrGLUtil.cpp | 49 +++++++++++++++--------------- 4 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 gpu/include/GrGLConfig_chrome.h delete mode 100644 gpu/include/GrGLCustomSetupHeader_chrome.h diff --git a/gpu/include/GrGLConfig.h b/gpu/include/GrGLConfig.h index 5c23495403..cdcc97f0ca 100644 --- a/gpu/include/GrGLConfig.h +++ b/gpu/include/GrGLConfig.h @@ -167,8 +167,10 @@ #define GR_SUPPORT_GLES ((GR_SUPPORT_GLES1) || (GR_SUPPORT_GLES2)) -#if !(GR_SUPPORT_GLES) != !(GR_SUPPORT_DESKTOP) - #error "Either desktop of ES GL must be supported but not both" +#if !GR_SUPPORT_GLES && !GR_SUPPORT_GLDESKTOP + #error "Either desktop or ES GL must be supported" +#elif GR_SUPPORT_GLES && GR_SUPPORT_GLDESKTOP + #error "Cannot support both desktop and ES GL" #endif #if !defined(GR_GL_FUNC) diff --git a/gpu/include/GrGLConfig_chrome.h b/gpu/include/GrGLConfig_chrome.h new file mode 100644 index 0000000000..e2294c0e67 --- /dev/null +++ b/gpu/include/GrGLConfig_chrome.h @@ -0,0 +1,19 @@ +#ifndef GrGLConfig_chrome_DEFINED +#define GrGLConfig_chrome_DEFINED + +#define GR_SUPPORT_GLES2 1 + +// gl2ext.h will define these extensions macros but Chrome doesn't provide +// prototypes. +#define GL_OES_mapbuffer 0 +#define GL_IMG_multisampled_render_to_texture 0 + +#include +#include + +#define GR_GL_FUNC + +#define GR_GL_PROC_ADDRESS(X) &X +//#define GR_GL_PROC_ADDRESS_HEADER + +#endif diff --git a/gpu/include/GrGLCustomSetupHeader_chrome.h b/gpu/include/GrGLCustomSetupHeader_chrome.h deleted file mode 100644 index 018fd157d7..0000000000 --- a/gpu/include/GrGLCustomSetupHeader_chrome.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef Chrome_GR_GL_CUSTOM_SETUP_HEADER -#define Chrome_GR_GL_CUSTOM_SETUP_HEADER - -#define GR_INCLUDE_GLES2 -#define GR_INCLUDE_GLES2ext - -#define GR_GL_FUNC - -#define GR_GL_PROC_ADDRESS(X) &X -#define GR_GL_PROC_ADDRESS_HEADER - -#endif diff --git a/gpu/src/GrGLUtil.cpp b/gpu/src/GrGLUtil.cpp index f961194b7a..c1ed0f44b7 100644 --- a/gpu/src/GrGLUtil.cpp +++ b/gpu/src/GrGLUtil.cpp @@ -101,9 +101,9 @@ extern void GrGLInitExtensions(GrGLExts* exts) { GLint major, minor; gl_version(&major, &minor); -#if GR_SUPPORT_GLDESKTOP bool fboFound = false; +#if GR_SUPPORT_GLDESKTOP #if GL_VERSION_3_0 if (!fboFound && major >= 3) { // all of ARB_fbo is in 3.x exts->GenFramebuffers = glGenFramebuffers; @@ -174,7 +174,6 @@ extern void GrGLInitExtensions(GrGLExts* exts) { exts->MapBuffer = glMapBuffer; exts->UnmapBuffer = glUnmapBuffer; #else // !GR_SUPPORT_GLDESKTOP - bool foundFBO = false; #if GR_SUPPORT_GLES2 if (!fboFound && major >= 2) {// ES 2.0 supports FBO exts->GenFramebuffers = glGenFramebuffers; @@ -190,7 +189,7 @@ extern void GrGLInitExtensions(GrGLExts* exts) { fboFound = true; } #endif - #if !GL_OES_framebuffer_object + #if GL_OES_framebuffer_object if (!fboFound && has_gl_extension("GL_OES_framebuffer_object")) { GET_SUFFIX_PROC(exts, GenFramebuffers, OES); GET_SUFFIX_PROC(exts, BindFramebuffer, OES); @@ -231,26 +230,26 @@ extern void GrGLInitExtensions(GrGLExts* exts) { #endif // !GR_SUPPORT_GLDESKTOP } - -/////////////////////////////////////////////////////////////////////////////// - -void GrGLCheckErr(const char* location, const char* call) { - uint32_t err = glGetError(); - if (GL_NO_ERROR != err) { - GrPrintf("---- glGetError %x", err); - if (NULL != location) { - GrPrintf(" at\n\t%s", location); - } - if (NULL != call) { - GrPrintf("\n\t\t%s", call); - } - GrPrintf("\n"); - } -} - -/////////////////////////////////////////////////////////////////////////////// - -bool gPrintGL = true; - - + +/////////////////////////////////////////////////////////////////////////////// + +void GrGLCheckErr(const char* location, const char* call) { + uint32_t err = glGetError(); + if (GL_NO_ERROR != err) { + GrPrintf("---- glGetError %x", err); + if (NULL != location) { + GrPrintf(" at\n\t%s", location); + } + if (NULL != call) { + GrPrintf("\n\t\t%s", call); + } + GrPrintf("\n"); + } +} + +/////////////////////////////////////////////////////////////////////////////// + +bool gPrintGL = true; + + -- cgit v1.2.3