Bug 233513

Summary: GraphicsContextGLOpenGL.cpp contains OpenGL implementation specific and platform specific code
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebGLAssignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, dino, ews-watchlist, kbr, kkinnunen, koivisto, kondapallykalyan, luiz, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 221664    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch none

Description Kimmo Kinnunen 2021-11-25 23:16:23 PST
GraphicsContextGLOpenGL.cpp contains OpenGL implementation specific and platform specific code

This blocks the task of removing ifdefs from GraphicsContextGLOpenGL.h by means of separating various code paths to separate classes.

GraphicsContextGLOpenGL.cpp should contain only "OpenGL" specific code. Currently that code lives in GraphicsContextGLOpenGLCommon.cpp, so GraphicsContextGLOpenGL.cpp should be made empty and then ultimately GraphicsContextGLOpenGLCommon.cpp would be renamed to GraphicsContextGLOpenGL.cpp

ANGLE specific code should go into GraphicsContextGLANGLE.cpp

Platform specific code should go into platform specific files such as GraphicsContextGLCocoa.cpp and compositor specific files such as GraphicsContextGLTextureMapper.cpp.
Comment 1 Kimmo Kinnunen 2021-11-25 23:30:08 PST
Created attachment 445172 [details]
Patch
Comment 2 Kimmo Kinnunen 2021-11-25 23:54:27 PST
Created attachment 445173 [details]
Patch
Comment 3 Kimmo Kinnunen 2021-11-26 00:32:12 PST
Created attachment 445176 [details]
Patch
Comment 4 Kimmo Kinnunen 2021-11-26 00:40:07 PST
Created attachment 445178 [details]
Patch
Comment 5 Antti Koivisto 2021-11-26 02:56:54 PST
Comment on attachment 445178 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=445178&action=review

> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:-67
> -void GraphicsContextGLOpenGL::resetBuffersToAutoClear()
> -{
> -    GCGLuint buffers = GraphicsContextGL::COLOR_BUFFER_BIT;
> -    // The GraphicsContextGL's attributes (as opposed to
> -    // WebGLRenderingContext's) indicate whether there is an
> -    // implicitly-allocated stencil buffer, for example.
> -    auto attrs = contextAttributes();
> -    if (attrs.depth)
> -        buffers |= GraphicsContextGL::DEPTH_BUFFER_BIT;
> -    if (attrs.stencil)
> -        buffers |= GraphicsContextGL::STENCIL_BUFFER_BIT;
> -    setBuffersToAutoClear(buffers);
> -}
> -

Might want to comment what happened to this function  (and others?) since it doesn't move anywhere mechanically.
Comment 6 EWS 2021-11-26 03:11:40 PST
Committed r286175 (244558@main): <https://commits.webkit.org/244558@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445178 [details].
Comment 7 Radar WebKit Bug Importer 2021-11-26 03:12:27 PST
<rdar://problem/85764264>
Comment 8 Kimmo Kinnunen 2021-11-26 06:36:13 PST
*** Bug 233512 has been marked as a duplicate of this bug. ***