<!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>[210123] 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/210123">210123</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-12-22 16:32:25 -0800 (Thu, 22 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move GraphicsContext3DWin to GraphicsContext3DOpenGLES
https://bugs.webkit.org/show_bug.cgi?id=166425

Reviewed by Tim Horton.

Move code which is GLES-specific not Windows-specific to the GLES-specific file
so I can use it on Cocoa, with a temporary PLATFORM macro that I plan to remove once
all platforms use ANGLE's GLES implementation. There is another copy of this code in
GraphicsContext3DCairo, which will also be united with this code here soon.
Also remove the PlatformCALayerWin, which was never used for anything.

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::setContextLostCallback):
(WebCore::GraphicsContext3D::setErrorMessageCallback):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::platformTexture):
(WebCore::GraphicsContext3D::isGLES2Compliant):
(WebCore::GraphicsContext3D::platformLayer):
* platform/graphics/win/GraphicsContext3DWin.cpp: Removed.
* PlatformMac.cmake:
Include the egl directory.  I'll need this, too, once Mac starts using ANGLE's EGL implementation.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLEScpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGraphicsContext3DWincpp">trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210122 => 210123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-23 00:20:27 UTC (rev 210122)
+++ trunk/Source/WebCore/ChangeLog        2016-12-23 00:32:25 UTC (rev 210123)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-12-22  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Move GraphicsContext3DWin to GraphicsContext3DOpenGLES
+        https://bugs.webkit.org/show_bug.cgi?id=166425
+
+        Reviewed by Tim Horton.
+
+        Move code which is GLES-specific not Windows-specific to the GLES-specific file
+        so I can use it on Cocoa, with a temporary PLATFORM macro that I plan to remove once
+        all platforms use ANGLE's GLES implementation. There is another copy of this code in
+        GraphicsContext3DCairo, which will also be united with this code here soon.
+        Also remove the PlatformCALayerWin, which was never used for anything.
+
+        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::setContextLostCallback):
+        (WebCore::GraphicsContext3D::setErrorMessageCallback):
+        (WebCore::GraphicsContext3D::makeContextCurrent):
+        (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
+        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformTexture):
+        (WebCore::GraphicsContext3D::isGLES2Compliant):
+        (WebCore::GraphicsContext3D::platformLayer):
+        * platform/graphics/win/GraphicsContext3DWin.cpp: Removed.
+        * PlatformMac.cmake:
+        Include the egl directory.  I'll need this, too, once Mac starts using ANGLE's EGL implementation.
+
</ins><span class="cx"> 2016-12-22  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Nested calls to setDocument can omit firing 'unload' events
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (210122 => 210123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-12-23 00:20:27 UTC (rev 210122)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-12-23 00:32:25 UTC (rev 210123)
</span><span class="lines">@@ -107,6 +107,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cocoa&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cg&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cv&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/platform/graphics/egl&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opentype&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opengl&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/mac&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLEScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp (210122 => 210123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp        2016-12-23 00:20:27 UTC (rev 210122)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp        2016-12-23 00:32:25 UTC (rev 210123)
</span><span class="lines">@@ -37,6 +37,12 @@
</span><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WIN)
+#include &lt;GLSLANG/ShaderLang.h&gt;
+#else
+#include &lt;ANGLE/ShaderLang.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext3D::releaseShaderCompiler()
</span><span class="lines">@@ -247,6 +253,162 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WIN) &amp;&amp; !USE(CAIRO)
+RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3DAttributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
+{
+    // This implementation doesn't currently support rendering directly to the HostWindow.
+    if (renderStyle == RenderDirectlyToHostWindow)
+        return nullptr;
+    
+    static bool initialized = false;
+    static bool success = true;
+    if (!initialized) {
+#if !USE(OPENGL_ES_2)
+        success = initializeOpenGLShims();
+#endif
+        initialized = true;
+    }
+    if (!success)
+        return nullptr;
+    
+    return adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
+    : m_currentWidth(0)
+    , m_currentHeight(0)
+    , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
+    , m_attrs(attributes)
+    , m_texture(0)
+    , m_fbo(0)
+    , m_depthStencilBuffer(0)
+    , m_multisampleFBO(0)
+    , m_multisampleDepthStencilBuffer(0)
+    , m_multisampleColorBuffer(0)
+    , m_private(std::make_unique&lt;GraphicsContext3DPrivate&gt;(this, renderStyle))
+{
+    makeContextCurrent();
+    
+    validateAttributes();
+
+    if (renderStyle == RenderOffscreen) {
+        // Create a texture to render into.
+        ::glGenTextures(1, &amp;m_texture);
+        ::glBindTexture(GL_TEXTURE_2D, m_texture);
+        ::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_TO_EDGE);
+        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+        ::glBindTexture(GL_TEXTURE_2D, 0);
+        
+        // Create an FBO.
+        ::glGenFramebuffers(1, &amp;m_fbo);
+        ::glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
+        
+        m_state.boundFBO = m_fbo;
+        if (!m_attrs.antialias &amp;&amp; (m_attrs.stencil || m_attrs.depth))
+            ::glGenRenderbuffers(1, &amp;m_depthStencilBuffer);
+        
+        // Create a multisample FBO.
+        if (m_attrs.antialias) {
+            ::glGenFramebuffers(1, &amp;m_multisampleFBO);
+            ::glBindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
+            m_state.boundFBO = m_multisampleFBO;
+            ::glGenRenderbuffers(1, &amp;m_multisampleColorBuffer);
+            if (m_attrs.stencil || m_attrs.depth)
+                ::glGenRenderbuffers(1, &amp;m_multisampleDepthStencilBuffer);
+        }
+    }
+    
+    // ANGLE initialization.
+    ShBuiltInResources ANGLEResources;
+    ShInitBuiltInResources(&amp;ANGLEResources);
+    
+    getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &amp;ANGLEResources.MaxVertexAttribs);
+    getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &amp;ANGLEResources.MaxVertexUniformVectors);
+    getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &amp;ANGLEResources.MaxVaryingVectors);
+    getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &amp;ANGLEResources.MaxVertexTextureImageUnits);
+    getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &amp;ANGLEResources.MaxCombinedTextureImageUnits);
+    getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &amp;ANGLEResources.MaxTextureImageUnits);
+    getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &amp;ANGLEResources.MaxFragmentUniformVectors);
+    
+    // Always set to 1 for OpenGL ES.
+    ANGLEResources.MaxDrawBuffers = 1;
+    
+    GC3Dint range[2], precision;
+    getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &amp;precision);
+    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
+    
+    m_compiler.setResources(ANGLEResources);
+    
+#if !USE(OPENGL_ES_2)
+    ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+    ::glEnable(GL_POINT_SPRITE);
+#endif
+    
+    ::glClearColor(0, 0, 0, 0);
+}
+
+GraphicsContext3D::~GraphicsContext3D()
+{
+    makeContextCurrent();
+    ::glDeleteTextures(1, &amp;m_texture);
+    if (m_attrs.antialias) {
+        ::glDeleteRenderbuffers(1, &amp;m_multisampleColorBuffer);
+        if (m_attrs.stencil || m_attrs.depth)
+            ::glDeleteRenderbuffers(1, &amp;m_multisampleDepthStencilBuffer);
+        ::glDeleteFramebuffers(1, &amp;m_multisampleFBO);
+    } else {
+        if (m_attrs.stencil || m_attrs.depth)
+            ::glDeleteRenderbuffers(1, &amp;m_depthStencilBuffer);
+    }
+    ::glDeleteFramebuffers(1, &amp;m_fbo);
+}
+
+void GraphicsContext3D::setContextLostCallback(std::unique_ptr&lt;ContextLostCallback&gt;)
+{
+}
+
+void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr&lt;ErrorMessageCallback&gt;)
+{
+}
+
+bool GraphicsContext3D::makeContextCurrent()
+{
+    if (!m_private)
+        return false;
+    return m_private-&gt;makeContextCurrent();
+}
+
+void GraphicsContext3D::checkGPUStatusIfNecessary()
+{
+}
+
+PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
+{
+    return m_private-&gt;platformContext();
+}
+
+Platform3DObject GraphicsContext3D::platformTexture() const
+{
+    return m_texture;
+}
+
+bool GraphicsContext3D::isGLES2Compliant() const
+{
+#if USE(OPENGL_ES_2)
+    return true;
+#else
+    return false;
+#endif
+}
+
+PlatformLayer* GraphicsContext3D::platformLayer() const
+{
+    return m_webGLLayer-&gt;platformLayer();
+}
+#endif
+
+}
+
</ins><span class="cx"> #endif // ENABLE(GRAPHICS_CONTEXT_3D)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGraphicsContext3DWincpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp (210122 => 210123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp        2016-12-23 00:20:27 UTC (rev 210122)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp        2016-12-23 00:32:25 UTC (rev 210123)
</span><span class="lines">@@ -1,208 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-
-#if ENABLE(GRAPHICS_CONTEXT_3D)
-
-#include &quot;GraphicsContext3D.h&quot;
-#include &quot;GraphicsContext3DPrivate.h&quot;
-#include &lt;WebCore/PlatformCALayerWin.h&gt;
-
-#if PLATFORM(WIN)
-#include &lt;GLSLANG/ShaderLang.h&gt;
-#else
-#include &lt;ANGLE/ShaderLang.h&gt;
-#endif
-
-#if USE(OPENGL_ES_2)
-#include &quot;Extensions3DOpenGLES.h&quot;
-#else
-#include &quot;Extensions3DOpenGL.h&quot;
-#include &quot;OpenGLShims.h&quot;
-#endif
-
-namespace WebCore {
-
-RefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3DAttributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
-{
-    // This implementation doesn't currently support rendering directly to the HostWindow.
-    if (renderStyle == RenderDirectlyToHostWindow)
-        return nullptr;
-
-    static bool initialized = false;
-    static bool success = true;
-    if (!initialized) {
-#if !USE(OPENGL_ES_2)
-        success = initializeOpenGLShims();
-#endif
-        initialized = true;
-    }
-    if (!success)
-        return nullptr;
-
-    return adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
-}
-
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
-    : m_currentWidth(0)
-    , m_currentHeight(0)
-    , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
-    , m_attrs(attributes)
-    , m_texture(0)
-    , m_fbo(0)
-    , m_depthStencilBuffer(0)
-    , m_multisampleFBO(0)
-    , m_multisampleDepthStencilBuffer(0)
-    , m_multisampleColorBuffer(0)
-    , m_private(std::make_unique&lt;GraphicsContext3DPrivate&gt;(this, renderStyle))
-{
-    makeContextCurrent();
-
-    validateAttributes();
-
-#if USE(CA)
-    m_webGLLayer = PlatformCALayerWin::create(PlatformCALayer::LayerTypeLayer, 0);
-#endif
-
-    if (renderStyle == RenderOffscreen) {
-        // Create a texture to render into.
-        ::glGenTextures(1, &amp;m_texture);
-        ::glBindTexture(GL_TEXTURE_2D, m_texture);
-        ::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_TO_EDGE);
-        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-        ::glBindTexture(GL_TEXTURE_2D, 0);
-
-        // Create an FBO.
-        ::glGenFramebuffers(1, &amp;m_fbo);
-        ::glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
-
-        m_state.boundFBO = m_fbo;
-        if (!m_attrs.antialias &amp;&amp; (m_attrs.stencil || m_attrs.depth))
-            ::glGenRenderbuffers(1, &amp;m_depthStencilBuffer);
-
-        // Create a multisample FBO.
-        if (m_attrs.antialias) {
-            ::glGenFramebuffers(1, &amp;m_multisampleFBO);
-            ::glBindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
-            m_state.boundFBO = m_multisampleFBO;
-            ::glGenRenderbuffers(1, &amp;m_multisampleColorBuffer);
-            if (m_attrs.stencil || m_attrs.depth)
-                ::glGenRenderbuffers(1, &amp;m_multisampleDepthStencilBuffer);
-        }
-    }
-
-    // ANGLE initialization.
-    ShBuiltInResources ANGLEResources;
-    ShInitBuiltInResources(&amp;ANGLEResources);
-
-    getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &amp;ANGLEResources.MaxVertexAttribs);
-    getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &amp;ANGLEResources.MaxVertexUniformVectors);
-    getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &amp;ANGLEResources.MaxVaryingVectors);
-    getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &amp;ANGLEResources.MaxVertexTextureImageUnits);
-    getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &amp;ANGLEResources.MaxCombinedTextureImageUnits);
-    getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &amp;ANGLEResources.MaxTextureImageUnits);
-    getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &amp;ANGLEResources.MaxFragmentUniformVectors);
-
-    // Always set to 1 for OpenGL ES.
-    ANGLEResources.MaxDrawBuffers = 1;
-
-    GC3Dint range[2], precision;
-    getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &amp;precision);
-    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
-
-    m_compiler.setResources(ANGLEResources);
-
-#if !USE(OPENGL_ES_2)
-    ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
-    ::glEnable(GL_POINT_SPRITE);
-#endif
-
-    ::glClearColor(0, 0, 0, 0);
-}
-
-GraphicsContext3D::~GraphicsContext3D()
-{
-    makeContextCurrent();
-    ::glDeleteTextures(1, &amp;m_texture);
-    if (m_attrs.antialias) {
-        ::glDeleteRenderbuffers(1, &amp;m_multisampleColorBuffer);
-        if (m_attrs.stencil || m_attrs.depth)
-            ::glDeleteRenderbuffers(1, &amp;m_multisampleDepthStencilBuffer);
-        ::glDeleteFramebuffers(1, &amp;m_multisampleFBO);
-    } else {
-        if (m_attrs.stencil || m_attrs.depth)
-            ::glDeleteRenderbuffers(1, &amp;m_depthStencilBuffer);
-    }
-    ::glDeleteFramebuffers(1, &amp;m_fbo);
-}
-
-void GraphicsContext3D::setContextLostCallback(std::unique_ptr&lt;ContextLostCallback&gt;)
-{
-}
-
-void GraphicsContext3D::setErrorMessageCallback(std::unique_ptr&lt;ErrorMessageCallback&gt;)
-{
-}
-
-bool GraphicsContext3D::makeContextCurrent()
-{
-    if (!m_private)
-        return false;
-    return m_private-&gt;makeContextCurrent();
-}
-
-void GraphicsContext3D::checkGPUStatusIfNecessary()
-{
-}
-
-PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
-{
-    return m_private-&gt;platformContext();
-}
-
-Platform3DObject GraphicsContext3D::platformTexture() const
-{
-    return m_texture;
-}
-
-bool GraphicsContext3D::isGLES2Compliant() const
-{
-#if USE(OPENGL_ES_2)
-    return true;
-#else
-    return false;
-#endif
-}
-
-PlatformLayer* GraphicsContext3D::platformLayer() const
-{
-    return m_webGLLayer-&gt;platformLayer();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(GRAPHICS_CONTEXT_3D)
</del></span></pre>
</div>
</div>

</body>
</html>