Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Created October 11, 2013 05:17
Show Gist options
  • Save arajkumar/6929912 to your computer and use it in GitHub Desktop.
Save arajkumar/6929912 to your computer and use it in GitHub Desktop.
Fix for GLES2 compilation error
diff --git a/Source/WebCore/platform/graphics/OpenGLESShims.h b/Source/WebCore/platform/graphics/OpenGLESShims.h
index b495814..9683042 100644
--- a/Source/WebCore/platform/graphics/OpenGLESShims.h
+++ b/Source/WebCore/platform/graphics/OpenGLESShims.h
@@ -44,8 +44,12 @@
#define glIsRenderbufferEXT glIsRenderbuffer
#define glIsFramebufferEXT glIsFramebuffer
#define glGenerateMipmapEXT glGenerateMipmap
+#ifndef GL_COLOR_ATTACHMENT0_EXT
#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
+#endif
+#ifndef GL_DEPTH_ATTACHMENT_EXT
#define GL_DEPTH_ATTACHMENT_EXT GL_DEPTH_ATTACHMENT
+#endif
#define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
#define GL_DEPTH24_STENCIL8_EXT GL_DEPTH24_STENCIL8_OES
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
index 174289b..786a323 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
@@ -37,9 +37,9 @@
#endif
#if USE(OPENGL_ES_2)
-#include "OpenGLESShims.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include "OpenGLESShims.h"
#elif PLATFORM(MAC)
#include <OpenGL/gl.h>
#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment