summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/opengl
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
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')
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp51
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h7
2 files changed, 57 insertions, 1 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)
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
index 1941a42..9188507 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
@@ -43,7 +43,12 @@ public:
virtual void ensureEnabled(const String&);
virtual int getGraphicsResetStatusARB();
virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
- virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
+ virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
+
+ virtual Platform3DObject createVertexArrayOES();
+ virtual void deleteVertexArrayOES(Platform3DObject);
+ virtual GC3Dboolean isVertexArrayOES(Platform3DObject);
+ virtual void bindVertexArrayOES(Platform3DObject);
private:
// This class only needs to be instantiated by GraphicsContext3D implementations.