Title: [164525] trunk/Source/WebCore
Revision
164525
Author
changseok...@collabora.com
Date
2014-02-21 19:56:33 -0800 (Fri, 21 Feb 2014)

Log Message

[GTK] Support WEBGL_draw_buffers extension.
https://bugs.webkit.org/show_bug.cgi?id=129143

Reviewed by Dean Jackson.

Support the WEBGL_draw_buffers WebGL extension for gtk port. Relevant opengl APIs
are exposed for WebGLRenderingContext to access them properly.

Covered by fast/canvas/webgl/webgl-draw-buffers.html

* platform/graphics/OpenGLShims.cpp:
(WebCore::initializeOpenGLShims):
* platform/graphics/OpenGLShims.h:
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):
(WebCore::Extensions3DOpenGL::drawBuffersEXT):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164524 => 164525)


--- trunk/Source/WebCore/ChangeLog	2014-02-22 03:53:53 UTC (rev 164524)
+++ trunk/Source/WebCore/ChangeLog	2014-02-22 03:56:33 UTC (rev 164525)
@@ -1,5 +1,24 @@
 2014-02-21  ChangSeok Oh  <changseok...@collabora.com>
 
+        [GTK] Support WEBGL_draw_buffers extension.
+        https://bugs.webkit.org/show_bug.cgi?id=129143
+
+        Reviewed by Dean Jackson.
+
+        Support the WEBGL_draw_buffers WebGL extension for gtk port. Relevant opengl APIs
+        are exposed for WebGLRenderingContext to access them properly.
+
+        Covered by fast/canvas/webgl/webgl-draw-buffers.html
+
+        * platform/graphics/OpenGLShims.cpp:
+        (WebCore::initializeOpenGLShims):
+        * platform/graphics/OpenGLShims.h:
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::supportsExtension):
+        (WebCore::Extensions3DOpenGL::drawBuffersEXT):
+
+2014-02-21  ChangSeok Oh  <changseok...@collabora.com>
+
         Mac port uses ANGLE_instanced_arrays related apis through those in GraphicsContext3DCommon.cpp
         https://bugs.webkit.org/show_bug.cgi?id=128803
 

Modified: trunk/Source/WebCore/platform/graphics/OpenGLShims.cpp (164524 => 164525)


--- trunk/Source/WebCore/platform/graphics/OpenGLShims.cpp	2014-02-22 03:53:53 UTC (rev 164524)
+++ trunk/Source/WebCore/platform/graphics/OpenGLShims.cpp	2014-02-22 03:56:33 UTC (rev 164525)
@@ -147,6 +147,7 @@
     ASSIGN_FUNCTION_TABLE_ENTRY(glDetachShader, success);
     ASSIGN_FUNCTION_TABLE_ENTRY(glDisableVertexAttribArray, success);
     ASSIGN_FUNCTION_TABLE_ENTRY(glDrawArraysInstanced, success);
+    ASSIGN_FUNCTION_TABLE_ENTRY(glDrawBuffers, success);
     ASSIGN_FUNCTION_TABLE_ENTRY(glDrawElementsInstanced, success);
     ASSIGN_FUNCTION_TABLE_ENTRY(glEnableVertexAttribArray, success);
     ASSIGN_FUNCTION_TABLE_ENTRY(glFramebufferRenderbuffer, success);

Modified: trunk/Source/WebCore/platform/graphics/OpenGLShims.h (164524 => 164525)


--- trunk/Source/WebCore/platform/graphics/OpenGLShims.h	2014-02-22 03:53:53 UTC (rev 164524)
+++ trunk/Source/WebCore/platform/graphics/OpenGLShims.h	2014-02-22 03:56:33 UTC (rev 164525)
@@ -70,6 +70,7 @@
 typedef void (GLAPIENTRY *glDetachShaderType) (GLuint, GLuint);
 typedef void (GLAPIENTRY *glDisableVertexAttribArrayType) (GLuint);
 typedef void (GLAPIENTRY *glDrawArraysInstancedType) (GLenum, GLint, GLsizei, GLsizei);
+typedef void (GLAPIENTRY *glDrawBuffersType) (GLsizei, const GLenum*);
 typedef void (GLAPIENTRY *glDrawElementsInstancedType) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei);
 typedef void (GLAPIENTRY *glEnableVertexAttribArrayType) (GLuint);
 typedef void (GLAPIENTRY *glFramebufferRenderbufferType) (GLenum, GLenum, GLenum, GLuint);
@@ -175,6 +176,7 @@
     FUNCTION_TABLE_ENTRY(glDetachShader);
     FUNCTION_TABLE_ENTRY(glDisableVertexAttribArray);
     FUNCTION_TABLE_ENTRY(glDrawArraysInstanced);
+    FUNCTION_TABLE_ENTRY(glDrawBuffers);
     FUNCTION_TABLE_ENTRY(glDrawElementsInstanced);
     FUNCTION_TABLE_ENTRY(glEnableVertexAttribArray);
     FUNCTION_TABLE_ENTRY(glFramebufferRenderbuffer);
@@ -290,6 +292,8 @@
 #define glDisableVertexAttribArray             LOOKUP_GL_FUNCTION(glDisableVertexAttribArray)
 #define glDrawArraysInstancedEXT               glDrawArraysInstanced
 #define glDrawArraysInstanced                  LOOKUP_GL_FUNCTION(glDrawArraysInstanced)
+#define glDrawBuffersEXT                       glDrawBuffers
+#define glDrawBuffers                          LOOKUP_GL_FUNCTION(glDrawBuffers)
 #define glDrawElementsInstancedEXT             glDrawElementsInstanced
 #define glDrawElementsInstanced                LOOKUP_GL_FUNCTION(glDrawElementsInstanced)
 #define glEnableVertexAttribArray              LOOKUP_GL_FUNCTION(glEnableVertexAttribArray)

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (164524 => 164525)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp	2014-02-22 03:53:53 UTC (rev 164524)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp	2014-02-22 03:56:33 UTC (rev 164525)
@@ -203,7 +203,7 @@
         return m_availableExtensions.contains("GL_EXT_texture_filter_anisotropic");
 
     if (name == "GL_EXT_draw_buffers") {
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(GTK)
         return m_availableExtensions.contains("GL_ARB_draw_buffers");
 #else
         // FIXME: implement support for other platforms.
@@ -224,6 +224,8 @@
     //  FIXME: implement support for other platforms.
 #if PLATFORM(MAC)
     ::glDrawBuffersARB(n, bufs);
+#elif PLATFORM(GTK)
+    ::glDrawBuffers(n, bufs);
 #else
     UNUSED_PARAM(n);
     UNUSED_PARAM(bufs);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to