<!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>[210158] releases/WebKitGTK/webkit-2.14</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/210158">210158</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-12-27 03:41:48 -0800 (Tue, 27 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/208022">r208022</a> - [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
https://bugs.webkit.org/show_bug.cgi?id=164091
Reviewed by Dean Jackson.
Source/WebCore:
In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL
context to a 3.2-compatible context to make sure the new symbols are
accepted. Eventually, this 3.2-compatible context will have to be
reverted and replaced with an ANGLE context. The current 3.2-compatible
context is just for testing.
Test: fast/canvas/webgl/webgl2-context-creation.html
* html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
(WebCore::WebGLBuffer::associateBufferData):
* html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
of the unique_ptr constructor.
(WebCore::WebGLRenderingContextBase::create):
* platform/graphics/GraphicsContext3D.h: GraphicsContext should know
if it is using a 3.2-compatible context because some parts of 2.1 are
removed in these contexts, and replaced with new things which aren't
in 2.1.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
OpenGL 3.2 context.
(WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
exactly what we want. In OpenGL3.2, point sprites are always enabled,
so there's no need to enable them in those contexts.
(WebCore::GraphicsContext3D::isGLES2Compliant):
* platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
is used instead. Unfortunately, glGetString() is not available in
OpenGL 2.1 contexts, so we need to use one or the other based on the
version of the context we're using.
(WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
(WebCore::Extensions3DOpenGL::getExtensions):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
Instead of modifying getExtensions() to use glGetStringi(), it makes
better sense to modify this function because getExtensions() returns
a string. Building up a string just to split it up again is silly, so
modifying this function instead makes more sense.
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
removed in OpenGL 3.2 contexts. However, it is replaced by
GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
recommended instead, but that isn't available in OpenGL 3.2.
(WebCore::GraphicsContext3D::getExtensions):
LayoutTests:
* TestExpectations:
* fast/canvas/webgl/webgl2-context-creation-expected.txt: Added.
* fast/canvas/webgl/webgl2-context-creation.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlcanvasWebGLBuffercpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsGraphicsContext3Dh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLCommoncpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLCommonh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsfastcanvaswebglwebgl2contextcreationexpectedtxt">releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsfastcanvaswebglwebgl2contextcreationhtml">releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-27 Myles C. Maxfield <mmaxfield@apple.com>
+
+ [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
+ https://bugs.webkit.org/show_bug.cgi?id=164091
+
+ Reviewed by Dean Jackson.
+
+ * TestExpectations:
+ * fast/canvas/webgl/webgl2-context-creation-expected.txt: Added.
+ * fast/canvas/webgl/webgl2-context-creation.html: Added.
+
</ins><span class="cx"> 2016-10-25 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestsfastcanvaswebglwebgl2contextcreationexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt (0 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Checks that using a WebGL 2 context doesn't cause an error.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS context.getError() is context.NO_ERROR
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestsfastcanvaswebglwebgl2contextcreationhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html (0 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<canvas id="c" width="40" height="40"></canvas>
+<script>
+description("Checks that using a WebGL 2 context doesn't cause an error.");
+
+if (window.internals)
+        internals.setWebGL2Enabled(true);
+
+var canvas = document.getElementById("c");
+var context = canvas.getContext("webgl2");
+shouldBe("context.getError()", "context.NO_ERROR");
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2016-10-27 Myles C. Maxfield <mmaxfield@apple.com>
+
+ [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
+ https://bugs.webkit.org/show_bug.cgi?id=164091
+
+ Reviewed by Dean Jackson.
+
+ In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL
+ context to a 3.2-compatible context to make sure the new symbols are
+ accepted. Eventually, this 3.2-compatible context will have to be
+ reverted and replaced with an ANGLE context. The current 3.2-compatible
+ context is just for testing.
+
+ Test: fast/canvas/webgl/webgl2-context-creation.html
+
+ * html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
+ (WebCore::WebGLBuffer::associateBufferData):
+ * html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
+ of the unique_ptr constructor.
+ (WebCore::WebGLRenderingContextBase::create):
+ * platform/graphics/GraphicsContext3D.h: GraphicsContext should know
+ if it is using a 3.2-compatible context because some parts of 2.1 are
+ removed in these contexts, and replaced with new things which aren't
+ in 2.1.
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
+ OpenGL 3.2 context.
+ (WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
+ in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
+ exactly what we want. In OpenGL3.2, point sprites are always enabled,
+ so there's no need to enable them in those contexts.
+ (WebCore::GraphicsContext3D::isGLES2Compliant):
+ * platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
+ glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
+ is used instead. Unfortunately, glGetString() is not available in
+ OpenGL 2.1 contexts, so we need to use one or the other based on the
+ version of the context we're using.
+ (WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
+ (WebCore::Extensions3DOpenGL::getExtensions):
+ * platform/graphics/opengl/Extensions3DOpenGL.h:
+ * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+ (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
+ (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
+ Instead of modifying getExtensions() to use glGetStringi(), it makes
+ better sense to modify this function because getExtensions() returns
+ a string. Building up a string just to split it up again is silly, so
+ modifying this function instead makes more sense.
+ * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+ (WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
+ removed in OpenGL 3.2 contexts. However, it is replaced by
+ GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
+ In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
+ recommended instead, but that isn't available in OpenGL 3.2.
+ (WebCore::GraphicsContext3D::getExtensions):
+
</ins><span class="cx"> 2016-10-21 Miguel Gomez <magomez@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlcanvasWebGLBuffercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">
</span><span class="cx"> bool WebGLBuffer::associateBufferData(GC3Dsizeiptr size)
</span><span class="cx"> {
</span><del>- return associateBufferDataImpl(0, size);
</del><ins>+ return associateBufferDataImpl(nullptr, size);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool WebGLBuffer::associateBufferData(ArrayBuffer* array)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -414,10 +414,10 @@
</span><span class="cx"> std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx"> if (type == "webgl2")
</span><del>- renderingContext = std::unique_ptr<WebGL2RenderingContext>(new WebGL2RenderingContext(canvas, attributes));
</del><ins>+ renderingContext = std::make_unique<WebGL2RenderingContext>(canvas, attributes);
</ins><span class="cx"> else
</span><span class="cx"> #endif
</span><del>- renderingContext = std::unique_ptr<WebGLRenderingContext>(new WebGLRenderingContext(canvas, attributes));
</del><ins>+ renderingContext = std::make_unique<WebGLRenderingContext>(canvas, attributes);
</ins><span class="cx"> renderingContext->suspendIfNeeded();
</span><span class="cx"> return renderingContext;
</span><span class="cx"> }
</span><span class="lines">@@ -437,10 +437,10 @@
</span><span class="cx"> std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx"> if (type == "webgl2")
</span><del>- renderingContext = std::unique_ptr<WebGL2RenderingContext>(new WebGL2RenderingContext(canvas, WTFMove(context), attributes));
</del><ins>+ renderingContext = std::make_unique<WebGL2RenderingContext>(canvas, WTFMove(context), attributes);
</ins><span class="cx"> else
</span><span class="cx"> #endif
</span><del>- renderingContext = std::unique_ptr<WebGLRenderingContext>(new WebGLRenderingContext(canvas, WTFMove(context), attributes));
</del><ins>+ renderingContext = std::make_unique<WebGLRenderingContext>(canvas, WTFMove(context), attributes);
</ins><span class="cx"> renderingContext->suspendIfNeeded();
</span><span class="cx">
</span><span class="cx"> return renderingContext;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsGraphicsContext3Dh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -1443,6 +1443,8 @@
</span><span class="cx"> std::unique_ptr<GraphicsContext3DPrivate> m_private;
</span><span class="cx">
</span><span class="cx"> WebGLRenderingContextBase* m_webglContext;
</span><ins>+
+ bool m_isForWebGL2 { false };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool allowOffline)
</del><ins>+static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool allowOffline, bool useGLES3)
</ins><span class="cx"> {
</span><span class="cx"> attribs.clear();
</span><span class="cx">
</span><span class="lines">@@ -120,6 +120,13 @@
</span><span class="cx"> attribs.append(kCGLPFASamples);
</span><span class="cx"> attribs.append(static_cast<CGLPixelFormatAttribute>(4));
</span><span class="cx"> }
</span><ins>+
+ if (useGLES3) {
+ // FIXME: Instead of backing a WebGL2 GraphicsContext3D with a OpenGL 3.2 context, we should instead back it with ANGLE.
+ // Use an OpenGL 3.2 context for now until the ANGLE backend is ready.
+ attribs.append(kCGLPFAOpenGLProfile);
+ attribs.append(static_cast<CGLPixelFormatAttribute>(kCGLOGLPVersion_3_2_Core));
+ }
</ins><span class="cx">
</span><span class="cx"> attribs.append(static_cast<CGLPixelFormatAttribute>(0));
</span><span class="cx"> }
</span><span class="lines">@@ -199,19 +206,19 @@
</span><span class="cx">
</span><span class="cx"> bool useMultisampling = m_attrs.antialias;
</span><span class="cx">
</span><del>- setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.preferLowPowerToHighPerformance);
</del><ins>+ setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
</ins><span class="cx"> CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
</span><span class="cx">
</span><span class="cx"> if (!numPixelFormats) {
</span><del>- setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance);
</del><ins>+ setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
</ins><span class="cx"> CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
</span><span class="cx">
</span><span class="cx"> if (!numPixelFormats) {
</span><del>- setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance);
</del><ins>+ setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
</ins><span class="cx"> CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
</span><span class="cx">
</span><span class="cx"> if (!attrs.forceSoftwareRenderer && !numPixelFormats) {
</span><del>- setPixelFormat(attribs, 32, 16, false, false, true, false, false);
</del><ins>+ setPixelFormat(attribs, 32, 16, false, false, true, false, false, attrs.useGLES3);
</ins><span class="cx"> CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
</span><span class="cx"> useMultisampling = false;
</span><span class="cx"> }
</span><span class="lines">@@ -237,6 +244,8 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ m_isForWebGL2 = attrs.useGLES3;
+
</ins><span class="cx"> // Set the current context to the one given to us.
</span><span class="cx"> CGLSetCurrentContext(m_contextObj);
</span><span class="cx">
</span><span class="lines">@@ -263,16 +272,16 @@
</span><span class="cx"> // create a texture to render into
</span><span class="cx"> ::glGenTextures(1, &m_texture);
</span><span class="cx"> ::glBindTexture(GL_TEXTURE_2D, m_texture);
</span><del>- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
</del><ins>+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
</ins><span class="cx"> ::glGenTextures(1, &m_compositorTexture);
</span><span class="cx"> ::glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
</span><del>- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
</del><ins>+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
</ins><span class="cx"> ::glBindTexture(GL_TEXTURE_2D, 0);
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -318,7 +327,8 @@
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
</span><del>- ::glEnable(GL_POINT_SPRITE);
</del><ins>+ if (!isGLES2Compliant())
+ ::glEnable(GL_POINT_SPRITE);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> ::glClearColor(0, 0, 0, 0);
</span><span class="lines">@@ -438,7 +448,7 @@
</span><span class="cx">
</span><span class="cx"> bool GraphicsContext3D::isGLES2Compliant() const
</span><span class="cx"> {
</span><del>- return false;
</del><ins>+ return m_isForWebGL2;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -45,8 +45,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context)
- : Extensions3DOpenGLCommon(context)
</del><ins>+Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context, bool useIndexedGetString)
+ : Extensions3DOpenGLCommon(context, useIndexedGetString)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -296,6 +296,7 @@
</span><span class="cx">
</span><span class="cx"> String Extensions3DOpenGL::getExtensions()
</span><span class="cx"> {
</span><ins>+ ASSERT(!m_useIndexedGetString);
</ins><span class="cx"> return String(reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS)));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef Extensions3DOpenGL_h
-#define Extensions3DOpenGL_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "Extensions3DOpenGLCommon.h"
</span><span class="cx">
</span><span class="lines">@@ -38,7 +37,7 @@
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx"> // This class only needs to be instantiated by GraphicsContext3D implementations.
</span><del>- explicit Extensions3DOpenGL(GraphicsContext3D*);
</del><ins>+ explicit Extensions3DOpenGL(GraphicsContext3D*, bool useIndexedGetString);
</ins><span class="cx"> virtual ~Extensions3DOpenGL();
</span><span class="cx">
</span><span class="cx"> // Extensions3D methods.
</span><span class="lines">@@ -61,12 +60,11 @@
</span><span class="cx"> protected:
</span><span class="cx"> virtual bool supportsExtension(const WTF::String&);
</span><span class="cx"> virtual String getExtensions();
</span><ins>+
+private:
</ins><span class="cx"> #if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
</span><del>-private:
</del><span class="cx"> bool isVertexArrayObjectSupported();
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // Extensions3DOpenGL_h
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include <OpenGLES/ES2/glext.h>
</span><ins>+#include <OpenGLES/ES3/gl.h>
</ins><span class="cx"> #else
</span><span class="cx"> #if USE(OPENGL_ES_2)
</span><span class="cx"> #include "OpenGLESShims.h"
</span><span class="lines">@@ -40,7 +41,10 @@
</span><span class="cx"> #include <GLES2/gl2.h>
</span><span class="cx"> #include <GLES2/gl2ext.h>
</span><span class="cx"> #elif PLATFORM(MAC)
</span><ins>+#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
</ins><span class="cx"> #include <OpenGL/gl.h>
</span><ins>+#include <OpenGL/gl3.h>
+#undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
</ins><span class="cx"> #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
</span><span class="cx"> #include "OpenGLShims.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -51,7 +55,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-Extensions3DOpenGLCommon::Extensions3DOpenGLCommon(GraphicsContext3D* context)
</del><ins>+Extensions3DOpenGLCommon::Extensions3DOpenGLCommon(GraphicsContext3D* context, bool useIndexedGetString)
</ins><span class="cx"> : m_initializedAvailableExtensions(false)
</span><span class="cx"> , m_context(context)
</span><span class="cx"> , m_isNVIDIA(false)
</span><span class="lines">@@ -60,6 +64,7 @@
</span><span class="cx"> , m_isImagination(false)
</span><span class="cx"> , m_requiresBuiltInFunctionEmulation(false)
</span><span class="cx"> , m_requiresRestrictedMaximumTextureSize(false)
</span><ins>+ , m_useIndexedGetString(useIndexedGetString)
</ins><span class="cx"> {
</span><span class="cx"> m_vendor = String(reinterpret_cast<const char*>(::glGetString(GL_VENDOR)));
</span><span class="cx"> m_renderer = String(reinterpret_cast<const char*>(::glGetString(GL_RENDERER)));
</span><span class="lines">@@ -206,11 +211,21 @@
</span><span class="cx">
</span><span class="cx"> void Extensions3DOpenGLCommon::initializeAvailableExtensions()
</span><span class="cx"> {
</span><del>- String extensionsString = getExtensions();
- Vector<String> availableExtensions;
- extensionsString.split(' ', availableExtensions);
- for (size_t i = 0; i < availableExtensions.size(); ++i)
- m_availableExtensions.add(availableExtensions[i]);
</del><ins>+#if PLATFORM(MAC)
+ if (m_useIndexedGetString) {
+ GLint numExtensions = 0;
+ ::glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
+ for (GLint i = 0; i < numExtensions; ++i)
+ m_availableExtensions.add(glGetStringi(GL_EXTENSIONS, i));
+ } else
+#endif
+ {
+ String extensionsString = getExtensions();
+ Vector<String> availableExtensions;
+ extensionsString.split(' ', availableExtensions);
+ for (size_t i = 0; i < availableExtensions.size(); ++i)
+ m_availableExtensions.add(availableExtensions[i]);
+ }
</ins><span class="cx"> m_initializedAvailableExtensions = true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglExtensions3DOpenGLCommonh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> friend class Extensions3DOpenGLES;
</span><del>- Extensions3DOpenGLCommon(GraphicsContext3D*);
</del><ins>+ Extensions3DOpenGLCommon(GraphicsContext3D*, bool useIndexedGetString);
</ins><span class="cx">
</span><span class="cx"> virtual bool supportsExtension(const String&) = 0;
</span><span class="cx"> virtual String getExtensions() = 0;
</span><span class="lines">@@ -89,6 +89,8 @@
</span><span class="cx"> bool m_requiresBuiltInFunctionEmulation;
</span><span class="cx"> bool m_requiresRestrictedMaximumTextureSize;
</span><span class="cx">
</span><ins>+ bool m_useIndexedGetString { false };
+
</ins><span class="cx"> String m_vendor;
</span><span class="cx"> String m_renderer;
</span><span class="cx"> };
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp (210157 => 210158)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2016-12-27 11:41:48 UTC (rev 210158)
</span><span class="lines">@@ -54,7 +54,10 @@
</span><span class="cx"> #define GL_RGBA32F_ARB 0x8814
</span><span class="cx"> #define GL_RGB32F_ARB 0x8815
</span><span class="cx"> #elif PLATFORM(MAC)
</span><ins>+#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
</ins><span class="cx"> #include <OpenGL/gl.h>
</span><ins>+#include <OpenGL/gl3.h>
+#undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
</ins><span class="cx"> #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
</span><span class="cx"> #include "OpenGLShims.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -285,8 +288,17 @@
</span><span class="cx"> *value /= 4;
</span><span class="cx"> break;
</span><span class="cx"> case MAX_VARYING_VECTORS:
</span><del>- ::glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
- *value /= 4;
</del><ins>+ if (isGLES2Compliant()) {
+ ASSERT(::glGetError() == GL_NO_ERROR);
+ ::glGetIntegerv(GL_MAX_VARYING_VECTORS, value);
+ if (::glGetError() == GL_INVALID_ENUM) {
+ ::glGetIntegerv(GL_MAX_VARYING_COMPONENTS, value);
+ *value /= 4;
+ }
+ } else {
+ ::glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
+ *value /= 4;
+ }
</ins><span class="cx"> break;
</span><span class="cx"> #endif
</span><span class="cx"> case MAX_TEXTURE_SIZE:
</span><span class="lines">@@ -397,7 +409,7 @@
</span><span class="cx"> Extensions3D* GraphicsContext3D::getExtensions()
</span><span class="cx"> {
</span><span class="cx"> if (!m_extensions)
</span><del>- m_extensions = std::make_unique<Extensions3DOpenGL>(this);
</del><ins>+ m_extensions = std::make_unique<Extensions3DOpenGL>(this, isGLES2Compliant());
</ins><span class="cx"> return m_extensions.get();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>