RESOLVED WONTFIX 66903
Restructure GraphicsContext3D to make it more extensible
https://bugs.webkit.org/show_bug.cgi?id=66903
Summary Restructure GraphicsContext3D to make it more extensible
Chris Marrin
Reported 2011-08-24 16:07:12 PDT
Currently GC3D needs to work on GLX, CGL and (as of https://bugs.webkit.org/show_bug.cgi?id=59064) EGL platforms. It also needs to work with OpenGL, GLES and possibly ANGLE (if there are differences). Finally, it needs to work with the split process model of Chromium. So the code should be restructured to make all these variables easier to implement. We should first consider resurrecting https://bugs.webkit.org/show_bug.cgi?id=53201. This might move all the GLX/CGL/EGL code into DrawingBuffer and avoid the need for any differences in GC3D for that part of the code. Other changes we should make: 1) Rename GraphicsContext3DInternal to GraphicsContext3DPrivate (matches the uses in the rest of the code) 2) Rename m_internal to m_private 3) Make the Mac implementation use GraphicsContext3DPrivate and get rid of the ifdef around it 4) Move all API that is not part of the public API into GraphicsContext3DPrivate. (Note: is GraphicsContext3DInternal still needed if we make GraphicsContext3D use DrawingBuffer?) Once that is done, the code should be generaly split into the following files. What goes into which file depends on what is needed to avoid ifdefs as much as possible: GraphicsContext3D - Anything that is common to all platforms GraphicsContext3DOpenGLCommon - code common to any OpenGL implementation GraphicsContext3DOpenGL - OpenGL (not OpenGL ES) specific code) GraphicsContext3DGLES - OpenGL ES specific code The OpenGLShims file is also getting very messy. A way should be found to eliminate as many of its ifdefs as possible. But that file is not used in the Mac implementation so I don't know enough to suggest any changes there.
Attachments
Chris Marrin
Comment 1 2011-08-25 08:57:50 PDT
This code in GraphicsContext3D.h should also be cleaned up: #if PLATFORM(QT) bool paintsIntoCanvasBuffer() const { return true; } #elif PLATFORM(CHROMIUM) bool paintsIntoCanvasBuffer() const; #elif PLATFORM(GTK) bool paintsIntoCanvasBuffer() const { return true; } #else bool paintsIntoCanvasBuffer() const { return false; } #endif It should be forwarded to the Private class and dealt with in platform specific implementations rather than with an ifdef
ChangSeok Oh
Comment 2 2011-08-25 21:19:24 PDT
Are you going to cover all these changes by yourself for all ports? or expect someone's contribution? May I get involved? :)
Weiwei
Comment 3 2011-10-18 23:40:49 PDT
Is there any update on this bug? And will the bug be merged into webkit trunk later?
Darin Adler
Comment 4 2019-01-21 14:11:51 PST
We might do a cleanup like this some day, but if we do, we don’t really need this 7-year-old bug to track it or remind us to do it.
Note You need to log in before you can comment on or make changes to this bug.