#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)
--- /dev/null
+#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 <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#define GR_GL_FUNC
+
+#define GR_GL_PROC_ADDRESS(X) &X
+//#define GR_GL_PROC_ADDRESS_HEADER
+
+#endif
\r
GLint major, minor;\r
gl_version(&major, &minor);\r
-#if GR_SUPPORT_GLDESKTOP\r
\r
bool fboFound = false;\r
+#if GR_SUPPORT_GLDESKTOP\r
#if GL_VERSION_3_0\r
if (!fboFound && major >= 3) { // all of ARB_fbo is in 3.x\r
exts->GenFramebuffers = glGenFramebuffers;\r
exts->MapBuffer = glMapBuffer;\r
exts->UnmapBuffer = glUnmapBuffer;\r
#else // !GR_SUPPORT_GLDESKTOP\r
- bool foundFBO = false;\r
#if GR_SUPPORT_GLES2\r
if (!fboFound && major >= 2) {// ES 2.0 supports FBO\r
exts->GenFramebuffers = glGenFramebuffers;\r
fboFound = true;\r
}\r
#endif\r
- #if !GL_OES_framebuffer_object\r
+ #if GL_OES_framebuffer_object\r
if (!fboFound && has_gl_extension("GL_OES_framebuffer_object")) {\r
GET_SUFFIX_PROC(exts, GenFramebuffers, OES);\r
GET_SUFFIX_PROC(exts, BindFramebuffer, OES);\r
#endif // !GR_SUPPORT_GLDESKTOP\r
}\r
\r
-
-///////////////////////////////////////////////////////////////////////////////
-
-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;
-
-
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+void GrGLCheckErr(const char* location, const char* call) {\r
+ uint32_t err = glGetError();\r
+ if (GL_NO_ERROR != err) {\r
+ GrPrintf("---- glGetError %x", err);\r
+ if (NULL != location) {\r
+ GrPrintf(" at\n\t%s", location);\r
+ }\r
+ if (NULL != call) {\r
+ GrPrintf("\n\t\t%s", call);\r
+ }\r
+ GrPrintf("\n");\r
+ }\r
+}\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+bool gPrintGL = true;\r
+\r
+\r
\r