summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-24 11:24:40 +0100
committerBen Murdoch <benm@google.com>2011-06-02 09:53:15 +0100
commit81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch)
tree7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
parent94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff)
downloadexternal_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp')
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
index df45147..e09534e 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
@@ -87,6 +87,10 @@ bool Extensions3DOpenGL::supports(const String& name)
// GL_OES_texture_half_float as available.
if (name == "GL_OES_texture_float" || name == "GL_OES_texture_half_float")
return m_availableExtensions.contains("GL_ARB_texture_float");
+
+ // GL_OES_vertex_array_object
+ if (name == "GL_OES_vertex_array_object")
+ return m_availableExtensions.contains("GL_APPLE_vertex_array_object");
// Desktop GL always supports the standard derivative functions
if (name == "GL_OES_standard_derivatives")
@@ -127,6 +131,53 @@ void Extensions3DOpenGL::renderbufferStorageMultisample(unsigned long target, un
::glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
}
+Platform3DObject Extensions3DOpenGL::createVertexArrayOES()
+{
+ m_context->makeContextCurrent();
+#if defined GL_APPLE_vertex_array_object && GL_APPLE_vertex_array_object
+ GLuint array = 0;
+ glGenVertexArraysAPPLE(1, &array);
+ return array;
+#else
+ return 0;
+#endif
+}
+
+void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
+{
+ if (!array)
+ return;
+
+ m_context->makeContextCurrent();
+#if defined GL_APPLE_vertex_array_object && GL_APPLE_vertex_array_object
+ glDeleteVertexArraysAPPLE(1, &array);
+#endif
+}
+
+GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array)
+{
+ if (!array)
+ return GL_FALSE;
+
+ m_context->makeContextCurrent();
+#if defined GL_APPLE_vertex_array_object && GL_APPLE_vertex_array_object
+ return glIsVertexArrayAPPLE(array);
+#else
+ return GL_FALSE;
+#endif
+}
+
+void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
+{
+ if (!array)
+ return;
+
+ m_context->makeContextCurrent();
+#if defined GL_APPLE_vertex_array_object && GL_APPLE_vertex_array_object
+ glBindVertexArrayAPPLE(array);
+#endif
+}
+
} // namespace WebCore
#endif // ENABLE(WEBGL)