[webkit-dev] Sharing the OpenGL GraphicsContext3D implementation

Zan Dobersek zandobersek at gmail.com
Tue Feb 22 12:53:49 PST 2011


Hi,

I'm writing this mail in order to propose changes that would make the OpenGL
implementation of the GraphicsContext3D a lot easier to share between the
Mac and Gtk port.

Currently the mentioned implementation is only used by the Mac port. The Gtk
port is also interested in using this implementation and there is already a
patch available in bug #31517[1] by Martin Robinson that brings the WebGL
functionality to daylight.

There is, however, the issue of the OpenGL extensions functions. Current
OpenGL implementation is Mac-only, and Mac port has a specific set of
extensions functions available. The same cannot be said for the Gtk port,
which can end up having extensions functions available that do not have the
same extension suffix as the Mac port's functions (EXT vs ARB). Because of
that the current proposed implementation acquires addresses of the OpenGL
extensions functions and then uses shims to make the GraphicsContext3D work.

I recommend a new class to be created for these two ports to use, named
something like OpenGLExtensionsFunctions. Extensions-specific functions in
the GraphicsContext3D class would then be replaced with calls to the
corresponding functions in this class, for example
OpenGLExtensionsFunctions::blitFramebuffer instead of current
::glBlitFramebufferEXT. Implementation for the Mac port would be simple,
passing arguments on to functions that are currently used in the
GraphicsContext3D class. Gtk port's implementation would simply call the
functions that were acquired, with no need to depend on shims.

Modifying the OpenGL implementation of the GraphicsContext3D class in this
way would ease the use of it for the Gtk port and perhaps any other port
that would go on to use this implementation with no damage to the Mac port.

I'd like to hear what Mac folks think of this approach and if there are any
other ideas that address this problem.

Regards,
Zan Dobersek

[1] https://bugs.webkit.org/show_bug.cgi?id=31517
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110222/0bd2e449/attachment.html>


More information about the webkit-dev mailing list