<!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>[194933] trunk</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/194933">194933</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-01-12 16:10:26 -0800 (Tue, 12 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Antialiasing doesn't work in WebGL
https://bugs.webkit.org/show_bug.cgi?id=153000
&lt;rdar://problem/9165531&gt;

Reviewed by Alex Christensen.

Source/WebCore:

WebGL has supported platform antialiasing since
the beginning, but we never hooked it up for iOS
because it used a slightly different extension.

Test: fast/canvas/webgl/antialiasing-enabled.html

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::endPaint): Resolve the multisampling
buffer once we're done painting.
(WebCore::GraphicsContext3D::~GraphicsContext3D): We never created
the m_compositorTexture RenderBuffer on iOS, so no point deleting
it.

* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension): The iOS extension
has a slightly different name.
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs): Make sure to create the
multisample buffer with the correct format.
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): We
need to remember what our bound frame buffer is when we
enter this call, and restore it afterwards. In the middle we can
discard our multisample read buffer once we have resolved it
into the normal framebuffer.

LayoutTests:

New test to check if WebGL antialiasing happened on a rendered canvas.

* fast/canvas/webgl/antialiasing-enabled-expected.txt: Added.
* fast/canvas/webgl/antialiasing-enabled.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm">trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglExtensions3DOpenGLcpp">trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcanvaswebglantialiasingenabledexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebglantialiasingenabledhtml">trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194932 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-13 00:04:25 UTC (rev 194932)
+++ trunk/LayoutTests/ChangeLog        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-01-12  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] Antialiasing doesn't work in WebGL
+        https://bugs.webkit.org/show_bug.cgi?id=153000
+        &lt;rdar://problem/9165531&gt;
+
+        Reviewed by Alex Christensen.
+
+        New test to check if WebGL antialiasing happened on a rendered canvas.
+
+        * fast/canvas/webgl/antialiasing-enabled-expected.txt: Added.
+        * fast/canvas/webgl/antialiasing-enabled.html: Added.
+
</ins><span class="cx"> 2016-01-12  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skipped more tests related to picture element on ios-simulator and grouped them together in TestExpectations file.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglantialiasingenabledexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled-expected.txt (0 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled-expected.txt        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+To check anti-aliasing, we draw a triangle over half of a 2x2 quad, then check the pixel colors in the corners. Note that if you're looking at the rendering results on a high-dpi display you will see some artefacts as the canvas is scaled by the page zoom. Don't mistake that for anti-aliasing (the test code doesn't).
+
+PASS: top left corner was fully black.
+PASS: top right corner did not have a completely solid red channel.
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebglantialiasingenabledhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled.html (0 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled.html                                (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled.html        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -0,0 +1,169 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1,user-scalable=no&quot;&gt;
+&lt;title&gt;WebGL Triangle&lt;/title&gt;
+&lt;style&gt;
+canvas {
+    width: 2px;
+    height: 2px;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;script id=&quot;vertexShaderSource&quot; type=&quot;text/glsl&quot;&gt;
+attribute vec4 position;
+void main() {
+  gl_Position = position;
+}
+&lt;/script&gt;
+&lt;script id=&quot;fragmentShaderSource&quot; type=&quot;text/glsl&quot;&gt;
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+void main() {
+  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+&lt;/script&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    window.testRunner.waitUntilDone();
+    window.testRunner.dumpAsText();
+    window.testRunner.overridePreference(&quot;WebKitWebGLEnabled&quot;, &quot;1&quot;);
+}
+
+function logResult(message) {
+    var output = document.getElementById(&quot;results&quot;);
+    output.innerHTML += message + &quot;&lt;br&gt;&quot;;
+}
+
+function drawTriangle(canvas) {
+
+    canvas.width = 2;
+    canvas.height = 2;
+
+    var gl = canvas.getContext(&quot;webgl&quot;, { antialias: true });
+
+    if (!gl) {
+        logResult(&quot;ERROR: Couldn't create WebGL context.&quot;);
+        return;
+    }
+
+    if (!gl.getContextAttributes().antialias) {
+        logResult(&quot;ERROR: Antialiasing was not enabled at creation time.&quot;);
+        return;
+    }
+
+    var vertexShader = gl.createShader(gl.VERTEX_SHADER);
+
+    gl.shaderSource(vertexShader, document.getElementById(&quot;vertexShaderSource&quot;).textContent);
+
+    gl.compileShader(vertexShader);
+    if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
+        logResult(&quot;ERROR: Vertex Shader failed to compile.&quot;);
+        logResult(gl.getShaderInfoLog(vertexShader));
+        return;
+    }
+
+    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
+    gl.shaderSource(fragmentShader, document.getElementById(&quot;fragmentShaderSource&quot;).textContent);
+    gl.compileShader(fragmentShader);
+    if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
+        logResult(&quot;ERROR: Fragment Shader failed to compile.&quot;);
+        logResult(gl.getShaderInfoLog(fragmentShader));
+        return;
+    }
+
+    var program = gl.createProgram();
+    gl.attachShader(program, vertexShader);
+    gl.attachShader(program, fragmentShader);
+    gl.linkProgram(program);
+
+    if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+        logResult(&quot;ERROR: Unable to link shaders into program.&quot;);
+        return;
+    }
+
+    gl.useProgram(program);
+    var positionAttribute = gl.getAttribLocation(program, &quot;position&quot;);
+    gl.enableVertexAttribArray(positionAttribute);
+
+    var vertices = new Float32Array([
+       -1.0, -1.0,
+       1.0, -1.0,
+       1.0, 1.0
+    ]);
+    var triangleBuffer = gl.createBuffer();
+
+    gl.bindBuffer(gl.ARRAY_BUFFER, triangleBuffer);
+    gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+
+    gl.clearColor(0, 0, 0, 1);
+    gl.clear(gl.COLOR_BUFFER_BIT);
+    gl.bindBuffer(gl.ARRAY_BUFFER, triangleBuffer);
+    gl.vertexAttribPointer(positionAttribute, 2, gl.FLOAT, false, 0, 0);
+
+    gl.drawArrays(gl.TRIANGLES, 0, 3);
+}
+
+function pixelAt(cssX, cssY, buffer) {
+    // Remember that &quot;top&quot; in CSS coordinates is the last row in WebGL. i.e. things are upside down.
+    var col = cssX;
+    var row = 1 - cssY;
+    return {
+        r: buffer[(row * 2 + col) * 4 + 0],
+        g: buffer[(row * 2 + col) * 4 + 1],
+        b: buffer[(row * 2 + col) * 4 + 2],
+        a: buffer[(row * 2 + col) * 4 + 3],
+    };
+}
+
+function pixelToString(pixel) {
+    return &quot;{r: &quot; + pixel.r + &quot;, g: &quot; + pixel.g + &quot;, b: &quot; + pixel.b + &quot;, a: &quot; + pixel.a + &quot;}&quot;;
+}
+
+function testOutput(canvas) {
+    
+    var gl = canvas.getContext(&quot;webgl&quot;);
+    
+    if (!gl) {
+        logResult(&quot;FAIL: No WebGL context to examine.&quot;);
+        return;
+    }
+    
+    var imageBuffer = new Uint8Array(canvas.width * canvas.height * 4);
+    gl.readPixels(0, 0, canvas.width, canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, imageBuffer);
+
+    // Check that the top left pixel is fully black.
+    var topLeft = pixelAt(0, 0, imageBuffer);
+    if (topLeft.r != 0 || topLeft.g != 0 || topLeft.b != 0 || topLeft.a != 255) {
+        logResult(&quot;FAIL: top left corner was not fully black. &quot; + pixelToString(topLeft));
+        return;
+    }
+    logResult(&quot;PASS: top left corner was fully black.&quot;);
+    
+    // Check that the top right pixel isn't fully red. If it is, it implies we didn't multisample.
+    var topRight = pixelAt(1, 0, imageBuffer);
+    if (topRight.r == 255) {
+        logResult(&quot;FAIL: top right corner had a solid red channel. &quot; + pixelToString(topRight));
+        return;
+    }
+    logResult(&quot;PASS: top right corner did not have a completely solid red channel.&quot;);
+}
+
+window.addEventListener(&quot;load&quot;, function () {
+    var canvas = document.querySelector(&quot;canvas&quot;);
+    drawTriangle(canvas);
+    testOutput(canvas);
+    if (window.testRunner)
+        window.testRunner.notifyDone();
+}, false);
+&lt;/script&gt;
+&lt;body&gt;
+    &lt;p&gt;To check anti-aliasing, we draw a triangle over half of a 2x2 quad, then check the pixel colors
+    in the corners. Note that if you're looking at the rendering results on a high-dpi display
+    you will see some artefacts as the canvas is scaled by the page zoom. Don't mistake that for
+    anti-aliasing (the test code doesn't).&lt;/p&gt;
+    &lt;canvas&gt;&lt;/canvas&gt;
+    &lt;p id=&quot;results&quot;&gt;&lt;/p&gt;
+&lt;/body&gt;
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/antialiasing-enabled.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194932 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-13 00:04:25 UTC (rev 194932)
+++ trunk/Source/WebCore/ChangeLog        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-01-11  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] Antialiasing doesn't work in WebGL
+        https://bugs.webkit.org/show_bug.cgi?id=153000
+        &lt;rdar://problem/9165531&gt;
+
+        Reviewed by Alex Christensen.
+
+        WebGL has supported platform antialiasing since
+        the beginning, but we never hooked it up for iOS
+        because it used a slightly different extension.
+
+        Test: fast/canvas/webgl/antialiasing-enabled.html
+
+        * platform/graphics/mac/GraphicsContext3DMac.mm:
+        (WebCore::GraphicsContext3D::endPaint): Resolve the multisampling
+        buffer once we're done painting.
+        (WebCore::GraphicsContext3D::~GraphicsContext3D): We never created
+        the m_compositorTexture RenderBuffer on iOS, so no point deleting
+        it.
+
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::supportsExtension): The iOS extension
+        has a slightly different name.
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::reshapeFBOs): Make sure to create the
+        multisample buffer with the correct format.
+        (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): We
+        need to remember what our bound frame buffer is when we
+        enter this call, and restore it afterwards. In the middle we can
+        discard our multisample read buffer once we have resolved it
+        into the normal framebuffer.
+
</ins><span class="cx"> 2016-01-12  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         XSS Auditor should navigate to empty substitute data on full page block
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (194932 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2016-01-13 00:04:25 UTC (rev 194932)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -314,7 +314,6 @@
</span><span class="cx">         makeContextCurrent();
</span><span class="cx">         [m_contextObj renderbufferStorage:GL_RENDERBUFFER fromDrawable:nil];
</span><span class="cx">         ::glDeleteRenderbuffers(1, &amp;m_texture);
</span><del>-        ::glDeleteRenderbuffers(1, &amp;m_compositorTexture);
</del><span class="cx"> #else
</span><span class="cx">         CGLSetCurrentContext(m_contextObj);
</span><span class="cx">         ::glDeleteTextures(1, &amp;m_texture);
</span><span class="lines">@@ -401,6 +400,8 @@
</span><span class="cx"> void GraphicsContext3D::endPaint()
</span><span class="cx"> {
</span><span class="cx">     makeContextCurrent();
</span><ins>+    if (m_attrs.antialias)
+        resolveMultisamplingIfNecessary();
</ins><span class="cx">     ::glFlush();
</span><span class="cx">     ::glBindRenderbuffer(GL_RENDERBUFFER, m_texture);
</span><span class="cx">     [static_cast&lt;EAGLContext*&gt;(m_contextObj) presentRenderbuffer:GL_RENDERBUFFER];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglExtensions3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (194932 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp        2016-01-13 00:04:25 UTC (rev 194932)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -156,11 +156,15 @@
</span><span class="cx"> bool Extensions3DOpenGL::supportsExtension(const String&amp; name)
</span><span class="cx"> {
</span><span class="cx">     // GL_ANGLE_framebuffer_blit and GL_ANGLE_framebuffer_multisample are &quot;fake&quot;. They are implemented using other
</span><del>-    // extensions. In particular GL_EXT_framebuffer_blit and GL_EXT_framebuffer_multisample
</del><ins>+    // extensions. In particular GL_EXT_framebuffer_blit and GL_EXT_framebuffer_multisample/GL_APPLE_framebuffer_multisample.
</ins><span class="cx">     if (name == &quot;GL_ANGLE_framebuffer_blit&quot;)
</span><span class="cx">         return m_availableExtensions.contains(&quot;GL_EXT_framebuffer_blit&quot;);
</span><span class="cx">     if (name == &quot;GL_ANGLE_framebuffer_multisample&quot;)
</span><ins>+#if PLATFORM(IOS)
+        return m_availableExtensions.contains(&quot;GL_APPLE_framebuffer_multisample&quot;);
+#else
</ins><span class="cx">         return m_availableExtensions.contains(&quot;GL_EXT_framebuffer_multisample&quot;);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (name == &quot;GL_ANGLE_instanced_arrays&quot;) {
</span><span class="cx">         return (m_availableExtensions.contains(&quot;GL_ARB_instanced_arrays&quot;) || m_availableExtensions.contains(&quot;GL_EXT_instanced_arrays&quot;))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp (194932 => 194933)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2016-01-13 00:04:25 UTC (rev 194932)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2016-01-13 00:10:26 UTC (rev 194933)
</span><span class="lines">@@ -139,7 +139,11 @@
</span><span class="cx">             sampleCount = maxSampleCount;
</span><span class="cx">         ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
</span><span class="cx">         ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
</span><ins>+#if PLATFORM(IOS)
+        ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, GL_RGBA8_OES, width, height);
+#else
</ins><span class="cx">         ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, m_internalColorFormat, width, height);
</span><ins>+#endif
</ins><span class="cx">         ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
</span><span class="cx">         if (m_attrs.stencil || m_attrs.depth) {
</span><span class="cx">             ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
</span><span class="lines">@@ -221,11 +225,17 @@
</span><span class="cx">     TemporaryOpenGLSetting scopedDepth(GL_DEPTH_TEST, GL_FALSE);
</span><span class="cx">     TemporaryOpenGLSetting scopedStencil(GL_STENCIL_TEST, GL_FALSE);
</span><span class="cx"> 
</span><ins>+    GLint boundFrameBuffer;
+    ::glGetIntegerv(GL_FRAMEBUFFER_BINDING, &amp;boundFrameBuffer);
+
</ins><span class="cx">     ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
</span><span class="cx">     ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     UNUSED_PARAM(rect);
</span><span class="cx">     ::glResolveMultisampleFramebufferAPPLE();
</span><ins>+    const GLenum discards[] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT };
+    ::glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 2, discards);
+    ::glBindFramebuffer(GL_FRAMEBUFFER, boundFrameBuffer);
</ins><span class="cx"> #else
</span><span class="cx">     IntRect resolveRect = rect;
</span><span class="cx">     if (rect.isEmpty())
</span></span></pre>
</div>
</div>

</body>
</html>