<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[281621] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/281621">281621</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-08-26 05:45:55 -0700 (Thu, 26 Aug 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebGL calls into static GraphicsContextGLOpenGL functions needlessly
https://bugs.webkit.org/show_bug.cgi?id=229402

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-08-26
Reviewed by Kenneth Russell.

The calls are problematic:
- No other call sites than WebGL layer
- The functionality is not needed for ANGLE, but present
- GraphicsContextGL is now an interface with multiple implementations,
  GraphicsContextGLOpenGL is just one implementation

Move the functions into WebGL, inside #if !USE(ANGLE) blocks.
>From there, they're simpler to move into !ANGLE specific files,
if possible.

This is work towards making it possible to remove ANGLE specific #if
blocks from WebGL implementation.

No new tests, refactor.

* html/canvas/WebGLFramebuffer.cpp:
(WebCore::getClearBitsByAttachmentType):
(WebCore::getClearBitsByFormat):
(WebCore::isAttachmentComplete):
(WebCore::WebGLFramebuffer::initializeAttachments):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::getChannelBitsByFormat):
(WebCore::possibleFormatAndTypeForInternalFormat):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid):
* platform/graphics/GraphicsContextGL.cpp:
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLFramebuffercpp">trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextGLcpp">trunk/Source/WebCore/platform/graphics/GraphicsContextGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextGLh">trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLcpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLh">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/ChangeLog      2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2021-08-26  Kimmo Kinnunen  <kkinnunen@apple.com>
+
+        WebGL calls into static GraphicsContextGLOpenGL functions needlessly
+        https://bugs.webkit.org/show_bug.cgi?id=229402
+
+        Reviewed by Kenneth Russell.
+
+        The calls are problematic:
+        - No other call sites than WebGL layer
+        - The functionality is not needed for ANGLE, but present
+        - GraphicsContextGL is now an interface with multiple implementations,
+          GraphicsContextGLOpenGL is just one implementation
+
+        Move the functions into WebGL, inside #if !USE(ANGLE) blocks.
+        From there, they're simpler to move into !ANGLE specific files,
+        if possible.
+
+        This is work towards making it possible to remove ANGLE specific #if
+        blocks from WebGL implementation.
+
+        No new tests, refactor.
+
+        * html/canvas/WebGLFramebuffer.cpp:
+        (WebCore::getClearBitsByAttachmentType):
+        (WebCore::getClearBitsByFormat):
+        (WebCore::isAttachmentComplete):
+        (WebCore::WebGLFramebuffer::initializeAttachments):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::getChannelBitsByFormat):
+        (WebCore::possibleFormatAndTypeForInternalFormat):
+        (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
+        (WebCore::WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid):
+        * platform/graphics/GraphicsContextGL.cpp:
+        * platform/graphics/GraphicsContextGL.h:
+        * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
+        * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
+
</ins><span class="cx"> 2021-08-26  Enrique Ocaña González  <eocanha@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [GStreamer][MSE] Implement the "sequence" mode in SourceBuffer for the GStreamer ports
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLFramebuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp    2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp       2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -272,34 +272,141 @@
</span><span class="cx">         visitor.addOpaqueRoot(m_texture.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+} // anonymous namespace
+
</ins><span class="cx"> #if !USE(ANGLE)
</span><del>-    bool isAttachmentComplete(WebGLFramebuffer::WebGLAttachment* attachedObject, GCGLenum attachment, const char** reason)
-    {
-        ASSERT(attachedObject && attachedObject->isValid());
-        ASSERT(reason);
-        GCGLenum format = attachedObject->getFormat();
-        unsigned need = GraphicsContextGLOpenGL::getClearBitsByAttachmentType(attachment);
-        unsigned have = GraphicsContextGLOpenGL::getClearBitsByFormat(format);
</del><ins>+static unsigned getClearBitsByAttachmentType(GCGLenum attachment)
+{
+    switch (attachment) {
+    case GraphicsContextGL::COLOR_ATTACHMENT0:
+    case ExtensionsGL::COLOR_ATTACHMENT1_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT2_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT3_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT4_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT5_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT6_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT7_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT8_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT9_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT10_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT11_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT12_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT13_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT14_EXT:
+    case ExtensionsGL::COLOR_ATTACHMENT15_EXT:
+        return GraphicsContextGL::COLOR_BUFFER_BIT;
+    case GraphicsContextGL::DEPTH_ATTACHMENT:
+        return GraphicsContextGL::DEPTH_BUFFER_BIT;
+    case GraphicsContextGL::STENCIL_ATTACHMENT:
+        return GraphicsContextGL::STENCIL_BUFFER_BIT;
+    case GraphicsContextGL::DEPTH_STENCIL_ATTACHMENT:
+        return GraphicsContextGL::DEPTH_BUFFER_BIT | GraphicsContextGL::STENCIL_BUFFER_BIT;
+    default:
+        return 0;
+    }
+}
</ins><span class="cx"> 
</span><del>-        if ((need & have) != need) {
-            *reason = "attachment type is not correct for attachment";
-            return false;
-        }
-        if (!attachedObject->getWidth() || !attachedObject->getHeight()) {
-            *reason = "attachment has a 0 dimension";
-            return false;
-        }
-        if ((attachment == GraphicsContextGL::DEPTH_ATTACHMENT || attachment == GraphicsContextGL::STENCIL_ATTACHMENT)
-            && format == GraphicsContextGL::DEPTH_STENCIL) {
-          *reason = "attachment DEPTH_STENCIL not allowed on DEPTH or STENCIL attachment";
-          return false;
-        }
-        return true;
</del><ins>+static unsigned getClearBitsByFormat(GCGLenum format)
+{
+    switch (format) {
+    case GraphicsContextGL::RGB:
+    case GraphicsContextGL::RGBA:
+    case GraphicsContextGL::LUMINANCE_ALPHA:
+    case GraphicsContextGL::LUMINANCE:
+    case GraphicsContextGL::ALPHA:
+    case GraphicsContextGL::R8:
+    case GraphicsContextGL::R8_SNORM:
+    case GraphicsContextGL::R16F:
+    case GraphicsContextGL::R32F:
+    case GraphicsContextGL::R8UI:
+    case GraphicsContextGL::R8I:
+    case GraphicsContextGL::R16UI:
+    case GraphicsContextGL::R16I:
+    case GraphicsContextGL::R32UI:
+    case GraphicsContextGL::R32I:
+    case GraphicsContextGL::RG8:
+    case GraphicsContextGL::RG8_SNORM:
+    case GraphicsContextGL::RG16F:
+    case GraphicsContextGL::RG32F:
+    case GraphicsContextGL::RG8UI:
+    case GraphicsContextGL::RG8I:
+    case GraphicsContextGL::RG16UI:
+    case GraphicsContextGL::RG16I:
+    case GraphicsContextGL::RG32UI:
+    case GraphicsContextGL::RG32I:
+    case GraphicsContextGL::RGB8:
+    case GraphicsContextGL::SRGB8:
+    case GraphicsContextGL::RGB565:
+    case GraphicsContextGL::RGB8_SNORM:
+    case GraphicsContextGL::R11F_G11F_B10F:
+    case GraphicsContextGL::RGB9_E5:
+    case GraphicsContextGL::RGB16F:
+    case GraphicsContextGL::RGB32F:
+    case GraphicsContextGL::RGB8UI:
+    case GraphicsContextGL::RGB8I:
+    case GraphicsContextGL::RGB16UI:
+    case GraphicsContextGL::RGB16I:
+    case GraphicsContextGL::RGB32UI:
+    case GraphicsContextGL::RGB32I:
+    case GraphicsContextGL::RGBA8:
+    case GraphicsContextGL::SRGB8_ALPHA8:
+    case GraphicsContextGL::RGBA8_SNORM:
+    case GraphicsContextGL::RGB5_A1:
+    case GraphicsContextGL::RGBA4:
+    case GraphicsContextGL::RGB10_A2:
+    case GraphicsContextGL::RGBA16F:
+    case GraphicsContextGL::RGBA32F:
+    case GraphicsContextGL::RGBA8UI:
+    case GraphicsContextGL::RGBA8I:
+    case GraphicsContextGL::RGB10_A2UI:
+    case GraphicsContextGL::RGBA16UI:
+    case GraphicsContextGL::RGBA16I:
+    case GraphicsContextGL::RGBA32I:
+    case GraphicsContextGL::RGBA32UI:
+    case ExtensionsGL::SRGB_EXT:
+    case ExtensionsGL::SRGB_ALPHA_EXT:
+        return GraphicsContextGL::COLOR_BUFFER_BIT;
+    case GraphicsContextGL::DEPTH_COMPONENT16:
+    case GraphicsContextGL::DEPTH_COMPONENT24:
+    case GraphicsContextGL::DEPTH_COMPONENT32F:
+    case GraphicsContextGL::DEPTH_COMPONENT:
+        return GraphicsContextGL::DEPTH_BUFFER_BIT;
+    case GraphicsContextGL::STENCIL_INDEX8:
+        return GraphicsContextGL::STENCIL_BUFFER_BIT;
+    case GraphicsContextGL::DEPTH_STENCIL:
+    case GraphicsContextGL::DEPTH24_STENCIL8:
+    case GraphicsContextGL::DEPTH32F_STENCIL8:
+        return GraphicsContextGL::DEPTH_BUFFER_BIT | GraphicsContextGL::STENCIL_BUFFER_BIT;
+    default:
+        return 0;
</ins><span class="cx">     }
</span><del>-#endif
</del><ins>+}
</ins><span class="cx"> 
</span><del>-} // anonymous namespace
</del><ins>+static bool isAttachmentComplete(WebGLFramebuffer::WebGLAttachment* attachedObject, GCGLenum attachment, const char** reason)
+{
+    ASSERT(attachedObject && attachedObject->isValid());
+    ASSERT(reason);
+    GCGLenum format = attachedObject->getFormat();
+    unsigned need = getClearBitsByAttachmentType(attachment);
+    unsigned have = getClearBitsByFormat(format);
</ins><span class="cx"> 
</span><ins>+    if ((need & have) != need) {
+        *reason = "attachment type is not correct for attachment";
+        return false;
+    }
+    if (!attachedObject->getWidth() || !attachedObject->getHeight()) {
+        *reason = "attachment has a 0 dimension";
+        return false;
+    }
+    if ((attachment == GraphicsContextGL::DEPTH_ATTACHMENT || attachment == GraphicsContextGL::STENCIL_ATTACHMENT)
+        && format == GraphicsContextGL::DEPTH_STENCIL) {
+        *reason = "attachment DEPTH_STENCIL not allowed on DEPTH or STENCIL attachment";
+        return false;
+    }
+    return true;
+}
+
+#endif
</ins><span class="cx"> WebGLFramebuffer::WebGLAttachment::WebGLAttachment() = default;
</span><span class="cx"> 
</span><span class="cx"> WebGLFramebuffer::WebGLAttachment::~WebGLAttachment() = default;
</span><span class="lines">@@ -611,7 +718,7 @@
</span><span class="cx">         GCGLenum attachmentType = entry.key;
</span><span class="cx">         RefPtr<WebGLAttachment> attachment = entry.value.get();
</span><span class="cx">         if (!attachment->isInitialized())
</span><del>-            mask |= GraphicsContextGLOpenGL::getClearBitsByAttachmentType(attachmentType);
</del><ins>+            mask |= getClearBitsByAttachmentType(attachmentType);
</ins><span class="cx">     }
</span><span class="cx">     if (!mask)
</span><span class="cx">         return true;
</span><span class="lines">@@ -682,7 +789,7 @@
</span><span class="cx">     for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
</span><span class="cx">         GCGLenum attachmentType = it->key;
</span><span class="cx">         auto attachment = it->value;
</span><del>-        GCGLbitfield bits = GraphicsContextGLOpenGL::getClearBitsByAttachmentType(attachmentType);
</del><ins>+        GCGLbitfield bits = getClearBitsByAttachmentType(attachmentType);
</ins><span class="cx">         if (bits & mask)
</span><span class="cx">             attachment->setInitialized();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp   2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp      2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -526,6 +526,127 @@
</span><span class="cx"> 
</span><span class="cx">     return (*clippedX != x || *clippedY != y || *clippedWidth != width || *clippedHeight != height);
</span><span class="cx"> }
</span><ins>+
+static uint8_t getChannelBitsByFormat(GCGLenum format)
+{
+    enum class ChannelBits : uint8_t {
+        Red = 1,
+        Green = 2,
+        Blue = 4,
+        Alpha = 8,
+        Depth = 16,
+        Stencil = 32,
+        RGB = Red | Green | Blue,
+        RGBA = RGB | Alpha,
+        DepthStencil = Depth | Stencil,
+    };
+    switch (format) {
+    case GraphicsContextGL::ALPHA:
+        return static_cast<uint8_t>(ChannelBits::Alpha);
+    case GraphicsContextGL::LUMINANCE:
+        return static_cast<uint8_t>(ChannelBits::RGB);
+    case GraphicsContextGL::LUMINANCE_ALPHA:
+        return static_cast<uint8_t>(ChannelBits::RGBA);
+    case GraphicsContextGL::RGB:
+    case GraphicsContextGL::RGB565:
+    case ExtensionsGL::SRGB_EXT:
+        return static_cast<uint8_t>(ChannelBits::RGB);
+    case GraphicsContextGL::RGBA:
+    case GraphicsContextGL::RGBA4:
+    case GraphicsContextGL::RGB5_A1:
+    case ExtensionsGL::SRGB_ALPHA_EXT:
+        return static_cast<uint8_t>(ChannelBits::RGBA);
+    case GraphicsContextGL::DEPTH_COMPONENT16:
+    case GraphicsContextGL::DEPTH_COMPONENT:
+        return static_cast<uint8_t>(ChannelBits::Depth);
+    case GraphicsContextGL::STENCIL_INDEX8:
+        return static_cast<uint8_t>(ChannelBits::Stencil);
+    case GraphicsContextGL::DEPTH_STENCIL:
+        return static_cast<uint8_t>(ChannelBits::DepthStencil);
+    default:
+        return 0;
+    }
+}
+
+static bool possibleFormatAndTypeForInternalFormat(GCGLenum internalFormat, GCGLenum& format, GCGLenum& type)
+{
+#define POSSIBLE_FORMAT_TYPE_CASE(internalFormatMacro, formatMacro, typeMacro) case internalFormatMacro: \
+        format = formatMacro; \
+        type = typeMacro; \
+        break;
+
+    switch (internalFormat) {
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB, GraphicsContextGL::RGB, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA, GraphicsContextGL::RGBA, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::LUMINANCE_ALPHA, GraphicsContextGL::LUMINANCE_ALPHA, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::LUMINANCE, GraphicsContextGL::LUMINANCE, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::ALPHA, GraphicsContextGL::ALPHA, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R8, GraphicsContextGL::RED, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R8_SNORM, GraphicsContextGL::RED, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R16F, GraphicsContextGL::RED, GraphicsContextGL::HALF_FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R32F, GraphicsContextGL::RED, GraphicsContextGL::FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R8UI, GraphicsContextGL::RED_INTEGER, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R8I, GraphicsContextGL::RED_INTEGER, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R16UI, GraphicsContextGL::RED_INTEGER, GraphicsContextGL::UNSIGNED_SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R16I, GraphicsContextGL::RED_INTEGER, GraphicsContextGL::SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R32UI, GraphicsContextGL::RED_INTEGER, GraphicsContextGL::UNSIGNED_INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R32I, GraphicsContextGL::RED_INTEGER, GraphicsContextGL::INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG8, GraphicsContextGL::RG, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG8_SNORM, GraphicsContextGL::RG, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG16F, GraphicsContextGL::RG, GraphicsContextGL::HALF_FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG32F, GraphicsContextGL::RG, GraphicsContextGL::FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG8UI, GraphicsContextGL::RG_INTEGER, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG8I, GraphicsContextGL::RG_INTEGER, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG16UI, GraphicsContextGL::RG_INTEGER, GraphicsContextGL::UNSIGNED_SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG16I, GraphicsContextGL::RG_INTEGER, GraphicsContextGL::SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG32UI, GraphicsContextGL::RG_INTEGER, GraphicsContextGL::UNSIGNED_INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RG32I, GraphicsContextGL::RG_INTEGER, GraphicsContextGL::INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB8, GraphicsContextGL::RGB, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::SRGB8, GraphicsContextGL::RGB, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB565, GraphicsContextGL::RGB, GraphicsContextGL::UNSIGNED_SHORT_5_6_5);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB8_SNORM, GraphicsContextGL::RGB, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::R11F_G11F_B10F, GraphicsContextGL::RGB, GraphicsContextGL::UNSIGNED_INT_10F_11F_11F_REV);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB9_E5, GraphicsContextGL::RGB, GraphicsContextGL::UNSIGNED_INT_5_9_9_9_REV);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB16F, GraphicsContextGL::RGB, GraphicsContextGL::HALF_FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB32F, GraphicsContextGL::RGB, GraphicsContextGL::FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB8UI, GraphicsContextGL::RGB_INTEGER, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB8I, GraphicsContextGL::RGB_INTEGER, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB16UI, GraphicsContextGL::RGB_INTEGER, GraphicsContextGL::UNSIGNED_SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB16I, GraphicsContextGL::RGB_INTEGER, GraphicsContextGL::SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB32UI, GraphicsContextGL::RGB_INTEGER, GraphicsContextGL::UNSIGNED_INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB32I, GraphicsContextGL::RGB_INTEGER, GraphicsContextGL::INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA8, GraphicsContextGL::RGBA, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::SRGB8_ALPHA8, GraphicsContextGL::RGBA, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA8_SNORM, GraphicsContextGL::RGBA, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB5_A1, GraphicsContextGL::RGBA, GraphicsContextGL::UNSIGNED_SHORT_5_5_5_1);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA4, GraphicsContextGL::RGBA, GraphicsContextGL::UNSIGNED_SHORT_4_4_4_4);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB10_A2, GraphicsContextGL::RGBA, GraphicsContextGL::UNSIGNED_INT_2_10_10_10_REV);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA16F, GraphicsContextGL::RGBA, GraphicsContextGL::HALF_FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA32F, GraphicsContextGL::RGBA, GraphicsContextGL::FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA8UI, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA8I, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGB10_A2UI, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::UNSIGNED_INT_2_10_10_10_REV);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA16UI, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::UNSIGNED_SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA16I, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA32I, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::RGBA32UI, GraphicsContextGL::RGBA_INTEGER, GraphicsContextGL::UNSIGNED_INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH_COMPONENT16, GraphicsContextGL::DEPTH_COMPONENT, GraphicsContextGL::UNSIGNED_SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH_COMPONENT, GraphicsContextGL::DEPTH_COMPONENT, GraphicsContextGL::UNSIGNED_SHORT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH_COMPONENT24, GraphicsContextGL::DEPTH_COMPONENT, GraphicsContextGL::UNSIGNED_INT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH_COMPONENT32F, GraphicsContextGL::DEPTH_COMPONENT, GraphicsContextGL::FLOAT);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH_STENCIL, GraphicsContextGL::DEPTH_STENCIL, GraphicsContextGL::UNSIGNED_INT_24_8);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH24_STENCIL8, GraphicsContextGL::DEPTH_STENCIL, GraphicsContextGL::UNSIGNED_INT_24_8);
+        POSSIBLE_FORMAT_TYPE_CASE(GraphicsContextGL::DEPTH32F_STENCIL8, GraphicsContextGL::DEPTH_STENCIL, GraphicsContextGL::FLOAT_32_UNSIGNED_INT_24_8_REV);
+        POSSIBLE_FORMAT_TYPE_CASE(ExtensionsGL::SRGB_EXT, ExtensionsGL::SRGB_EXT, GraphicsContextGL::UNSIGNED_BYTE);
+        POSSIBLE_FORMAT_TYPE_CASE(ExtensionsGL::SRGB_ALPHA_EXT, ExtensionsGL::SRGB_ALPHA_EXT, GraphicsContextGL::UNSIGNED_BYTE);
+    default:
+        return false;
+    }
+#undef POSSIBLE_FORMAT_TYPE_CASE
+
+    return true;
+}
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> class InspectorScopedShaderProgramHighlight {
</span><span class="lines">@@ -1923,7 +2044,7 @@
</span><span class="cx">     if (clip2D(x, y, width, height, getBoundReadFramebufferWidth(), getBoundReadFramebufferHeight(), &clippedX, &clippedY, &clippedWidth, &clippedHeight)) {
</span><span class="cx">         GCGLenum format;
</span><span class="cx">         GCGLenum type;
</span><del>-        if (!GraphicsContextGLOpenGL::possibleFormatAndTypeForInternalFormat(tex->getInternalFormat(target, level), format, type)) {
</del><ins>+        if (!possibleFormatAndTypeForInternalFormat(tex->getInternalFormat(target, level), format, type)) {
</ins><span class="cx">             synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "copyTexSubImage2D", "Texture has unknown internal format");
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -6545,8 +6666,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid(GCGLenum texInternalFormat, GCGLenum colorBufferFormat)
</span><span class="cx"> {
</span><del>-    auto need = GraphicsContextGL::getChannelBitsByFormat(texInternalFormat);
-    auto have = GraphicsContextGL::getChannelBitsByFormat(colorBufferFormat);
</del><ins>+    auto need = getChannelBitsByFormat(texInternalFormat);
+    auto have = getChannelBitsByFormat(colorBufferFormat);
</ins><span class="cx">     return (need & have) == need;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContextGL.cpp (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContextGL.cpp     2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextGL.cpp        2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -369,143 +369,6 @@
</span><span class="cx">     m_attrs.preserveDrawingBuffer = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned GraphicsContextGL::getClearBitsByAttachmentType(GCGLenum attachment)
-{
-    switch (attachment) {
-    case GraphicsContextGL::COLOR_ATTACHMENT0:
-    case ExtensionsGL::COLOR_ATTACHMENT1_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT2_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT3_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT4_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT5_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT6_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT7_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT8_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT9_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT10_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT11_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT12_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT13_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT14_EXT:
-    case ExtensionsGL::COLOR_ATTACHMENT15_EXT:
-        return GraphicsContextGL::COLOR_BUFFER_BIT;
-    case GraphicsContextGL::DEPTH_ATTACHMENT:
-        return GraphicsContextGL::DEPTH_BUFFER_BIT;
-    case GraphicsContextGL::STENCIL_ATTACHMENT:
-        return GraphicsContextGL::STENCIL_BUFFER_BIT;
-    case GraphicsContextGL::DEPTH_STENCIL_ATTACHMENT:
-        return GraphicsContextGL::DEPTH_BUFFER_BIT | GraphicsContextGL::STENCIL_BUFFER_BIT;
-    default:
-        return 0;
-    }
-}
-
-unsigned GraphicsContextGL::getClearBitsByFormat(GCGLenum format)
-{
-    switch (format) {
-    case GraphicsContextGL::RGB:
-    case GraphicsContextGL::RGBA:
-    case GraphicsContextGL::LUMINANCE_ALPHA:
-    case GraphicsContextGL::LUMINANCE:
-    case GraphicsContextGL::ALPHA:
-    case GraphicsContextGL::R8:
-    case GraphicsContextGL::R8_SNORM:
-    case GraphicsContextGL::R16F:
-    case GraphicsContextGL::R32F:
-    case GraphicsContextGL::R8UI:
-    case GraphicsContextGL::R8I:
-    case GraphicsContextGL::R16UI:
-    case GraphicsContextGL::R16I:
-    case GraphicsContextGL::R32UI:
-    case GraphicsContextGL::R32I:
-    case GraphicsContextGL::RG8:
-    case GraphicsContextGL::RG8_SNORM:
-    case GraphicsContextGL::RG16F:
-    case GraphicsContextGL::RG32F:
-    case GraphicsContextGL::RG8UI:
-    case GraphicsContextGL::RG8I:
-    case GraphicsContextGL::RG16UI:
-    case GraphicsContextGL::RG16I:
-    case GraphicsContextGL::RG32UI:
-    case GraphicsContextGL::RG32I:
-    case GraphicsContextGL::RGB8:
-    case GraphicsContextGL::SRGB8:
-    case GraphicsContextGL::RGB565:
-    case GraphicsContextGL::RGB8_SNORM:
-    case GraphicsContextGL::R11F_G11F_B10F:
-    case GraphicsContextGL::RGB9_E5:
-    case GraphicsContextGL::RGB16F:
-    case GraphicsContextGL::RGB32F:
-    case GraphicsContextGL::RGB8UI:
-    case GraphicsContextGL::RGB8I:
-    case GraphicsContextGL::RGB16UI:
-    case GraphicsContextGL::RGB16I:
-    case GraphicsContextGL::RGB32UI:
-    case GraphicsContextGL::RGB32I:
-    case GraphicsContextGL::RGBA8:
-    case GraphicsContextGL::SRGB8_ALPHA8:
-    case GraphicsContextGL::RGBA8_SNORM:
-    case GraphicsContextGL::RGB5_A1:
-    case GraphicsContextGL::RGBA4:
-    case GraphicsContextGL::RGB10_A2:
-    case GraphicsContextGL::RGBA16F:
-    case GraphicsContextGL::RGBA32F:
-    case GraphicsContextGL::RGBA8UI:
-    case GraphicsContextGL::RGBA8I:
-    case GraphicsContextGL::RGB10_A2UI:
-    case GraphicsContextGL::RGBA16UI:
-    case GraphicsContextGL::RGBA16I:
-    case GraphicsContextGL::RGBA32I:
-    case GraphicsContextGL::RGBA32UI:
-    case ExtensionsGL::SRGB_EXT:
-    case ExtensionsGL::SRGB_ALPHA_EXT:
-        return GraphicsContextGL::COLOR_BUFFER_BIT;
-    case GraphicsContextGL::DEPTH_COMPONENT16:
-    case GraphicsContextGL::DEPTH_COMPONENT24:
-    case GraphicsContextGL::DEPTH_COMPONENT32F:
-    case GraphicsContextGL::DEPTH_COMPONENT:
-        return GraphicsContextGL::DEPTH_BUFFER_BIT;
-    case GraphicsContextGL::STENCIL_INDEX8:
-        return GraphicsContextGL::STENCIL_BUFFER_BIT;
-    case GraphicsContextGL::DEPTH_STENCIL:
-    case GraphicsContextGL::DEPTH24_STENCIL8:
-    case GraphicsContextGL::DEPTH32F_STENCIL8:
-        return GraphicsContextGL::DEPTH_BUFFER_BIT | GraphicsContextGL::STENCIL_BUFFER_BIT;
-    default:
-        return 0;
-    }
-}
-
-uint8_t GraphicsContextGL::getChannelBitsByFormat(GCGLenum format)
-{
-    switch (format) {
-    case GraphicsContextGL::ALPHA:
-        return static_cast<uint8_t>(ChannelBits::Alpha);
-    case GraphicsContextGL::LUMINANCE:
-        return static_cast<uint8_t>(ChannelBits::RGB);
-    case GraphicsContextGL::LUMINANCE_ALPHA:
-        return static_cast<uint8_t>(ChannelBits::RGBA);
-    case GraphicsContextGL::RGB:
-    case GraphicsContextGL::RGB565:
-    case ExtensionsGL::SRGB_EXT:
-        return static_cast<uint8_t>(ChannelBits::RGB);
-    case GraphicsContextGL::RGBA:
-    case GraphicsContextGL::RGBA4:
-    case GraphicsContextGL::RGB5_A1:
-    case ExtensionsGL::SRGB_ALPHA_EXT:
-        return static_cast<uint8_t>(ChannelBits::RGBA);
-    case GraphicsContextGL::DEPTH_COMPONENT16:
-    case GraphicsContextGL::DEPTH_COMPONENT:
-        return static_cast<uint8_t>(ChannelBits::Depth);
-    case GraphicsContextGL::STENCIL_INDEX8:
-        return static_cast<uint8_t>(ChannelBits::Stencil);
-    case GraphicsContextGL::DEPTH_STENCIL:
-        return static_cast<uint8_t>(ChannelBits::DepthStencil);
-    default:
-        return 0;
-    }
-}
-
</del><span class="cx"> bool GraphicsContextGL::computeFormatAndTypeParameters(GCGLenum format, GCGLenum type, unsigned* componentsPerPixel, unsigned* bytesPerComponent)
</span><span class="cx"> {
</span><span class="cx">     switch (format) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextGLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h       2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h  2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -1318,11 +1318,6 @@
</span><span class="cx"> 
</span><span class="cx">     IntSize getInternalFramebufferSize() const { return IntSize(m_currentWidth, m_currentHeight); }
</span><span class="cx"> 
</span><del>-    static unsigned getClearBitsByAttachmentType(GCGLenum);
-    static unsigned getClearBitsByFormat(GCGLenum);
-
-    static uint8_t getChannelBitsByFormat(GCGLenum);
-
</del><span class="cx">     struct PixelStoreParams final {
</span><span class="cx">         GCGLint alignment { 4 };
</span><span class="cx">         GCGLint rowLength { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp        2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp   2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -107,88 +107,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-#if !USE(ANGLE)
-bool GraphicsContextGLOpenGL::possibleFormatAndTypeForInternalFormat(GCGLenum internalFormat, GCGLenum& format, GCGLenum& type)
-{
-#define POSSIBLE_FORMAT_TYPE_CASE(internalFormatMacro, formatMacro, typeMacro) case internalFormatMacro: \
-        format = formatMacro; \
-        type = typeMacro; \
-        break;
-
-    switch (internalFormat) {
-        POSSIBLE_FORMAT_TYPE_CASE(RGB, RGB, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA, RGBA, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(LUMINANCE_ALPHA, LUMINANCE_ALPHA, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(LUMINANCE, LUMINANCE, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(ALPHA, ALPHA, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(R8, RED, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(R8_SNORM, RED, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(R16F, RED, HALF_FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(R32F, RED, FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(R8UI, RED_INTEGER, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(R8I, RED_INTEGER, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(R16UI, RED_INTEGER, UNSIGNED_SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(R16I, RED_INTEGER, SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(R32UI, RED_INTEGER, UNSIGNED_INT);
-        POSSIBLE_FORMAT_TYPE_CASE(R32I, RED_INTEGER, INT);
-        POSSIBLE_FORMAT_TYPE_CASE(RG8, RG, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RG8_SNORM, RG, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RG16F, RG, HALF_FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(RG32F, RG, FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(RG8UI, RG_INTEGER, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RG8I, RG_INTEGER, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RG16UI, RG_INTEGER, UNSIGNED_SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(RG16I, RG_INTEGER, SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(RG32UI, RG_INTEGER, UNSIGNED_INT);
-        POSSIBLE_FORMAT_TYPE_CASE(RG32I, RG_INTEGER, INT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB8, RGB, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(SRGB8, RGB, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB565, RGB, UNSIGNED_SHORT_5_6_5);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB8_SNORM, RGB, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(R11F_G11F_B10F, RGB, UNSIGNED_INT_10F_11F_11F_REV);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB9_E5, RGB, UNSIGNED_INT_5_9_9_9_REV);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB16F, RGB, HALF_FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB32F, RGB, FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB8UI, RGB_INTEGER, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB8I, RGB_INTEGER, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB16UI, RGB_INTEGER, UNSIGNED_SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB16I, RGB_INTEGER, SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB32UI, RGB_INTEGER, UNSIGNED_INT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB32I, RGB_INTEGER, INT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA8, RGBA, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(SRGB8_ALPHA8, RGBA, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA8_SNORM, RGBA, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB5_A1, RGBA, UNSIGNED_SHORT_5_5_5_1);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA4, RGBA, UNSIGNED_SHORT_4_4_4_4);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB10_A2, RGBA, UNSIGNED_INT_2_10_10_10_REV);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA16F, RGBA, HALF_FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA32F, RGBA, FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA8UI, RGBA_INTEGER, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA8I, RGBA_INTEGER, BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(RGB10_A2UI, RGBA_INTEGER, UNSIGNED_INT_2_10_10_10_REV);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA16UI, RGBA_INTEGER, UNSIGNED_SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA16I, RGBA_INTEGER, SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA32I, RGBA_INTEGER, INT);
-        POSSIBLE_FORMAT_TYPE_CASE(RGBA32UI, RGBA_INTEGER, UNSIGNED_INT);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH_COMPONENT16, DEPTH_COMPONENT, UNSIGNED_SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH_COMPONENT, DEPTH_COMPONENT, UNSIGNED_SHORT);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH_COMPONENT24, DEPTH_COMPONENT, UNSIGNED_INT);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH_COMPONENT32F, DEPTH_COMPONENT, FLOAT);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH_STENCIL, DEPTH_STENCIL, UNSIGNED_INT_24_8);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH24_STENCIL8, DEPTH_STENCIL, UNSIGNED_INT_24_8);
-        POSSIBLE_FORMAT_TYPE_CASE(DEPTH32F_STENCIL8, DEPTH_STENCIL, FLOAT_32_UNSIGNED_INT_24_8_REV);
-        POSSIBLE_FORMAT_TYPE_CASE(ExtensionsGL::SRGB_EXT, ExtensionsGL::SRGB_EXT, UNSIGNED_BYTE);
-        POSSIBLE_FORMAT_TYPE_CASE(ExtensionsGL::SRGB_ALPHA_EXT, ExtensionsGL::SRGB_ALPHA_EXT, UNSIGNED_BYTE);
-    default:
-        return false;
-    }
-#undef POSSIBLE_FORMAT_TYPE_CASE
-
-    return true;
-}
-#endif // !USE(ANGLE)
-
-
</del><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx"> void GraphicsContextGLOpenGL::setContextVisibility(bool)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h (281620 => 281621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h  2021-08-26 12:30:46 UTC (rev 281620)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h     2021-08-26 12:45:55 UTC (rev 281621)
</span><span class="lines">@@ -524,10 +524,6 @@
</span><span class="cx">     GraphicsContextGLCV* asCV() final;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !USE(ANGLE)
-    static bool possibleFormatAndTypeForInternalFormat(GCGLenum internalFormat, GCGLenum& format, GCGLenum& type);
-#endif // !USE(ANGLE)
-
</del><span class="cx">     static void paintToCanvas(const GraphicsContextGLAttributes&, PixelBuffer&&, const IntSize& canvasSize, GraphicsContext&);
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre>
</div>
</div>

</body>
</html>