Many of the api calls in Extension3D can be marked as const.
Created attachment 191345 [details] patch
Comment on attachment 191345 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=191345&action=review May I ask what the goal of this patch is? While conceptually some of these methods are const, as you have already found, they may do some mutations internally which are invisible to callers. Neither the ChangeLog nor the bug explains the motivation for the patch. > Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:244 > + const_cast<Extensions3DOpenGLES*>(this)->resolveVAOExtBindings(); Rather than casting away const, these members should be made mutable -- that's what the keyword is for.
(In reply to comment #2) > (From update of attachment 191345 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=191345&action=review > > May I ask what the goal of this patch is? While conceptually some of these methods are const, as you have already found, they may do some mutations internally which are invisible to callers. Neither the ChangeLog nor the bug explains the motivation for the patch. While fixing 109382(https://bugs.webkit.org/show_bug.cgi?id=109382#c8), there was a discussion to make supports work with const or to make isVertexArrayObjectSupported work without const. For 109382, isVertexArrayObjectSupported in Extensions3DOpenGL was made to work without const. This work was motivated from that discussion. I will update the patch, if this is something we still want to address. > > Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:244 > Rather than casting away const, these members should be made mutable -- that's what the keyword is for. Yes, will fix that.
(In reply to comment #3) > While fixing 109382(https://bugs.webkit.org/show_bug.cgi?id=109382#c8), there was a discussion to make supports work with const or to make isVertexArrayObjectSupported work without const. For 109382, isVertexArrayObjectSupported in Extensions3DOpenGL was made to work without const. This work was motivated from that discussion. I will update the patch, if this is something we still want to address. I'd forgotten about that discussion. No objection if you want to fix this, but it doesn't seem critical to me.
(In reply to comment #4) > (In reply to comment #3) > > While fixing 109382(https://bugs.webkit.org/show_bug.cgi?id=109382#c8), there was a discussion to make supports work with const or to make isVertexArrayObjectSupported work without const. For 109382, isVertexArrayObjectSupported in Extensions3DOpenGL was made to work without const. This work was motivated from that discussion. I will update the patch, if this is something we still want to address. > > I'd forgotten about that discussion. No objection if you want to fix this, but it doesn't seem critical to me k. I am not completely happy to use mutable member variables (or cast). A cleaner way might be to find a suitable place to resolve the bindings than in supportsExtension function. I am currently unable to do any run time testing for GLES related changes. I will come back to this once I am able to test them.