Bug 233513 - GraphicsContextGLOpenGL.cpp contains OpenGL implementation specific and platform specific code
Summary: GraphicsContextGLOpenGL.cpp contains OpenGL implementation specific and platf...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
: 233512 (view as bug list)
Depends on:
Blocks: gcgranglecleanup
  Show dependency treegraph
 
Reported: 2021-11-25 23:16 PST by Kimmo Kinnunen
Modified: 2021-11-26 06:36 PST (History)
9 users (show)

See Also:


Attachments
Patch (29.75 KB, patch)
2021-11-25 23:30 PST, Kimmo Kinnunen
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (30.22 KB, patch)
2021-11-25 23:54 PST, Kimmo Kinnunen
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (30.43 KB, patch)
2021-11-26 00:32 PST, Kimmo Kinnunen
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (30.44 KB, patch)
2021-11-26 00:40 PST, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***