<!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>[179233] 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/179233">179233</a></dd>
<dt>Author</dt> <dd>roger_fong@apple.com</dd>
<dt>Date</dt> <dd>2015-01-27 17:16:32 -0800 (Tue, 27 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>WebGL2: Disable various extensions on WebGL2 context that have been promoted to core.
https://bugs.webkit.org/show_bug.cgi?id=140907.
<rdar://problem/19545857>
Reviewed by Brent Fulgham.
Source/WebCore:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getSupportedExtensions): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
Remove some extra extension enums that shouldn't have been declared on the context idl.
LayoutTests:
* fast/canvas/webgl/constants.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebglconstantshtml">trunk/LayoutTests/fast/canvas/webgl/constants.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContexth">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseidl">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/LayoutTests/ChangeLog        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-01-27 Roger Fong <roger_fong@apple.com>
+
+ WebGL2: Disable various extensions on WebGL2 context that have been promoted to core.
+ https://bugs.webkit.org/show_bug.cgi?id=140907.
+ <rdar://problem/19545857>
+
+ Reviewed by Brent Fulgham.
+
+ * fast/canvas/webgl/constants.html:
+
</ins><span class="cx"> 2015-01-27 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] More Windows rebaselines.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglconstantshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/constants.html (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/constants.html        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/LayoutTests/fast/canvas/webgl/constants.html        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -433,16 +433,6 @@
</span><span class="cx"> CONTEXT_LOST_WEBGL : 0x9242,
</span><span class="cx"> UNPACK_COLORSPACE_CONVERSION_WEBGL : 0x9243,
</span><span class="cx"> BROWSER_DEFAULT_WEBGL : 0x9244,
</span><del>-
-/* EXT_SRGB extension */
-SRGB_EXT : 0x8C40,
-SRGB_ALPHA_EXT : 0x8C42,
-SRGB8_ALPHA8_EXT : 0x8C43,
-FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT : 0x8210,
-
-/* EXT_BLEND_MINMAX extension */
-MIN_EXT : 0x8007,
-MAX_EXT : 0x8008
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // Constants removed from the WebGL spec compared to ES 2.0
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/ChangeLog        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-01-27 Roger Fong <roger_fong@apple.com>
+
+ WebGL2: Disable various extensions on WebGL2 context that have been promoted to core.
+ https://bugs.webkit.org/show_bug.cgi?id=140907.
+ <rdar://problem/19545857>
+
+ Reviewed by Brent Fulgham.
+
+ * html/canvas/WebGL2RenderingContext.cpp:
+ (WebCore::WebGL2RenderingContext::getExtension):
+ (WebCore::WebGL2RenderingContext::getSupportedExtensions):
+ * html/canvas/WebGL2RenderingContext.h:
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getExtension):
+ (WebCore::WebGLRenderingContext::getSupportedExtensions):
+ * html/canvas/WebGLRenderingContext.h:
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::getSupportedExtensions): Deleted.
+ * html/canvas/WebGLRenderingContextBase.h:
+ * html/canvas/WebGLRenderingContextBase.idl:
+ Remove some extra extension enums that shouldn't have been declared on the context idl.
+
</ins><span class="cx"> 2015-01-27 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove unnecessary m_cachedPage null-checks in PageCache
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -28,7 +28,19 @@
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> #include "WebGL2RenderingContext.h"
</span><span class="cx">
</span><ins>+#include "EXTTextureFilterAnisotropic.h"
+#include "Extensions3D.h"
+#include "OESTextureFloat.h"
+#include "OESTextureFloatLinear.h"
+#include "OESTextureHalfFloat.h"
+#include "OESTextureHalfFloatLinear.h"
</ins><span class="cx"> #include "WebGLActiveInfo.h"
</span><ins>+#include "WebGLCompressedTextureATC.h"
+#include "WebGLCompressedTexturePVRTC.h"
+#include "WebGLCompressedTextureS3TC.h"
+#include "WebGLDebugRendererInfo.h"
+#include "WebGLDebugShaders.h"
+#include "WebGLDepthTexture.h"
</ins><span class="cx"> #include "WebGLQuery.h"
</span><span class="cx"> #include "WebGLSampler.h"
</span><span class="cx"> #include "WebGLSync.h"
</span><span class="lines">@@ -751,6 +763,129 @@
</span><span class="cx"> UNUSED_PARAM(vertexArray);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+WebGLExtension* WebGL2RenderingContext::getExtension(const String& name)
+{
+ if (isContextLostOrPending())
+ return nullptr;
+
+ if (equalIgnoringCase(name, "WEBKIT_EXT_texture_filter_anisotropic")
+ && m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic")) {
+ if (!m_extTextureFilterAnisotropic) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_texture_filter_anisotropic");
+ m_extTextureFilterAnisotropic = std::make_unique<EXTTextureFilterAnisotropic>(this);
+ }
+ return m_extTextureFilterAnisotropic.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_float")
+ && m_context->getExtensions()->supports("GL_OES_texture_float")) {
+ if (!m_oesTextureFloat) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_float");
+ m_oesTextureFloat = std::make_unique<OESTextureFloat>(this);
+ }
+ return m_oesTextureFloat.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_float_linear")
+ && m_context->getExtensions()->supports("GL_OES_texture_float_linear")) {
+ if (!m_oesTextureFloatLinear) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_float_linear");
+ m_oesTextureFloatLinear = std::make_unique<OESTextureFloatLinear>(this);
+ }
+ return m_oesTextureFloatLinear.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_half_float")
+ && m_context->getExtensions()->supports("GL_OES_texture_half_float")) {
+ if (!m_oesTextureHalfFloat) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_half_float");
+ m_oesTextureHalfFloat = std::make_unique<OESTextureHalfFloat>(this);
+ }
+ return m_oesTextureHalfFloat.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_half_float_linear")
+ && m_context->getExtensions()->supports("GL_OES_texture_half_float_linear")) {
+ if (!m_oesTextureHalfFloatLinear) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_half_float_linear");
+ m_oesTextureHalfFloatLinear = std::make_unique<OESTextureHalfFloatLinear>(this);
+ }
+ return m_oesTextureHalfFloatLinear.get();
+ }
+ if ((equalIgnoringCase(name, "WEBKIT_WEBGL_compressed_texture_atc"))
+ && WebGLCompressedTextureATC::supported(this)) {
+ if (!m_webglCompressedTextureATC)
+ m_webglCompressedTextureATC = std::make_unique<WebGLCompressedTextureATC>(this);
+ return m_webglCompressedTextureATC.get();
+ }
+ if ((equalIgnoringCase(name, "WEBKIT_WEBGL_compressed_texture_pvrtc"))
+ && WebGLCompressedTexturePVRTC::supported(this)) {
+ if (!m_webglCompressedTexturePVRTC)
+ m_webglCompressedTexturePVRTC = std::make_unique<WebGLCompressedTexturePVRTC>(this);
+ return m_webglCompressedTexturePVRTC.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_compressed_texture_s3tc")
+ && WebGLCompressedTextureS3TC::supported(this)) {
+ if (!m_webglCompressedTextureS3TC)
+ m_webglCompressedTextureS3TC = std::make_unique<WebGLCompressedTextureS3TC>(this);
+ return m_webglCompressedTextureS3TC.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_depth_texture")
+ && WebGLDepthTexture::supported(graphicsContext3D())) {
+ if (!m_webglDepthTexture) {
+ m_context->getExtensions()->ensureEnabled("GL_CHROMIUM_depth_texture");
+ m_webglDepthTexture = std::make_unique<WebGLDepthTexture>(this);
+ }
+ return m_webglDepthTexture.get();
+ }
+ if (allowPrivilegedExtensions()) {
+ if (equalIgnoringCase(name, "WEBGL_debug_renderer_info")) {
+ if (!m_webglDebugRendererInfo)
+ m_webglDebugRendererInfo = std::make_unique<WebGLDebugRendererInfo>(this);
+ return m_webglDebugRendererInfo.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_debug_shaders")
+ && m_context->getExtensions()->supports("GL_ANGLE_translated_shader_source")) {
+ if (!m_webglDebugShaders)
+ m_webglDebugShaders = std::make_unique<WebGLDebugShaders>(this);
+ return m_webglDebugShaders.get();
+ }
+ }
+
+ return nullptr;
+}
+
+Vector<String> WebGL2RenderingContext::getSupportedExtensions()
+{
+ Vector<String> result;
+
+ if (m_isPendingPolicyResolution)
+ return result;
+
+ if (m_context->getExtensions()->supports("GL_OES_texture_float"))
+ result.append("OES_texture_float");
+ if (m_context->getExtensions()->supports("GL_OES_texture_float_linear"))
+ result.append("OES_texture_float_linear");
+ if (m_context->getExtensions()->supports("GL_OES_texture_half_float"))
+ result.append("OES_texture_half_float");
+ if (m_context->getExtensions()->supports("GL_OES_texture_half_float_linear"))
+ result.append("OES_texture_half_float_linear");
+ if (m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic"))
+ result.append("WEBKIT_EXT_texture_filter_anisotropic");
+ if (WebGLCompressedTextureATC::supported(this))
+ result.append("WEBKIT_WEBGL_compressed_texture_atc");
+ if (WebGLCompressedTexturePVRTC::supported(this))
+ result.append("WEBKIT_WEBGL_compressed_texture_pvrtc");
+ if (WebGLCompressedTextureS3TC::supported(this))
+ result.append("WEBGL_compressed_texture_s3tc");
+ if (WebGLDepthTexture::supported(graphicsContext3D()))
+ result.append("WEBGL_depth_texture");
+
+ if (allowPrivilegedExtensions()) {
+ if (m_context->getExtensions()->supports("GL_ANGLE_translated_shader_source"))
+ result.append("WEBGL_debug_shaders");
+ result.append("WEBGL_debug_renderer_info");
+ }
+
+ return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(WEBGL)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -163,6 +163,10 @@
</span><span class="cx"> void deleteVertexArray(WebGLVertexArrayObject* vertexArray);
</span><span class="cx"> GC3Dboolean isVertexArray(WebGLVertexArrayObject* vertexArray);
</span><span class="cx"> void bindVertexArray(WebGLVertexArrayObject* vertexArray);
</span><ins>+
+ /* Extensions */
+ virtual WebGLExtension* getExtension(const String&) override;
+ virtual Vector<String> getSupportedExtensions() override;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -28,6 +28,29 @@
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> #include "WebGLRenderingContext.h"
</span><span class="cx">
</span><ins>+#include "ANGLEInstancedArrays.h"
+#include "EXTBlendMinMax.h"
+#include "EXTFragDepth.h"
+#include "EXTShaderTextureLOD.h"
+#include "EXTTextureFilterAnisotropic.h"
+#include "EXTsRGB.h"
+#include "Extensions3D.h"
+#include "OESElementIndexUint.h"
+#include "OESStandardDerivatives.h"
+#include "OESTextureFloat.h"
+#include "OESTextureFloatLinear.h"
+#include "OESTextureHalfFloat.h"
+#include "OESTextureHalfFloatLinear.h"
+#include "OESVertexArrayObject.h"
+#include "WebGLCompressedTextureATC.h"
+#include "WebGLCompressedTexturePVRTC.h"
+#include "WebGLCompressedTextureS3TC.h"
+#include "WebGLDebugRendererInfo.h"
+#include "WebGLDebugShaders.h"
+#include "WebGLDepthTexture.h"
+#include "WebGLDrawBuffers.h"
+#include "WebGLLoseContext.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, GraphicsContext3D::Attributes attributes)
</span><span class="lines">@@ -40,6 +63,224 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+
+WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
+{
+ if (isContextLostOrPending())
+ return nullptr;
+
+ if (equalIgnoringCase(name, "EXT_blend_minmax")
+ && m_context->getExtensions()->supports("GL_EXT_blend_minmax")) {
+ if (!m_extBlendMinMax) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_blend_minmax");
+ m_extBlendMinMax = std::make_unique<EXTBlendMinMax>(this);
+ }
+ return m_extBlendMinMax.get();
+ }
+ if (equalIgnoringCase(name, "EXT_sRGB")
+ && m_context->getExtensions()->supports("GL_EXT_sRGB")) {
+ if (!m_extsRGB) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_sRGB");
+ m_extsRGB = std::make_unique<EXTsRGB>(this);
+ }
+ return m_extsRGB.get();
+ }
+ if (equalIgnoringCase(name, "EXT_frag_depth")
+ && m_context->getExtensions()->supports("GL_EXT_frag_depth")) {
+ if (!m_extFragDepth) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_frag_depth");
+ m_extFragDepth = std::make_unique<EXTFragDepth>(this);
+ }
+ return m_extFragDepth.get();
+ }
+ if (equalIgnoringCase(name, "EXT_shader_texture_lod")
+ && (m_context->getExtensions()->supports("GL_EXT_shader_texture_lod") || m_context->getExtensions()->supports("GL_ARB_shader_texture_lod"))) {
+ if (!m_extShaderTextureLOD) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_shader_texture_lod");
+ m_extShaderTextureLOD = std::make_unique<EXTShaderTextureLOD>(this);
+ }
+ return m_extShaderTextureLOD.get();
+ }
+ if (equalIgnoringCase(name, "WEBKIT_EXT_texture_filter_anisotropic")
+ && m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic")) {
+ if (!m_extTextureFilterAnisotropic) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_texture_filter_anisotropic");
+ m_extTextureFilterAnisotropic = std::make_unique<EXTTextureFilterAnisotropic>(this);
+ }
+ return m_extTextureFilterAnisotropic.get();
+ }
+ if (equalIgnoringCase(name, "OES_standard_derivatives")
+ && m_context->getExtensions()->supports("GL_OES_standard_derivatives")) {
+ if (!m_oesStandardDerivatives) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_standard_derivatives");
+ m_oesStandardDerivatives = std::make_unique<OESStandardDerivatives>(this);
+ }
+ return m_oesStandardDerivatives.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_float")
+ && m_context->getExtensions()->supports("GL_OES_texture_float")) {
+ if (!m_oesTextureFloat) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_float");
+ m_oesTextureFloat = std::make_unique<OESTextureFloat>(this);
+ }
+ return m_oesTextureFloat.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_float_linear")
+ && m_context->getExtensions()->supports("GL_OES_texture_float_linear")) {
+ if (!m_oesTextureFloatLinear) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_float_linear");
+ m_oesTextureFloatLinear = std::make_unique<OESTextureFloatLinear>(this);
+ }
+ return m_oesTextureFloatLinear.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_half_float")
+ && m_context->getExtensions()->supports("GL_OES_texture_half_float")) {
+ if (!m_oesTextureHalfFloat) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_half_float");
+ m_oesTextureHalfFloat = std::make_unique<OESTextureHalfFloat>(this);
+ }
+ return m_oesTextureHalfFloat.get();
+ }
+ if (equalIgnoringCase(name, "OES_texture_half_float_linear")
+ && m_context->getExtensions()->supports("GL_OES_texture_half_float_linear")) {
+ if (!m_oesTextureHalfFloatLinear) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_texture_half_float_linear");
+ m_oesTextureHalfFloatLinear = std::make_unique<OESTextureHalfFloatLinear>(this);
+ }
+ return m_oesTextureHalfFloatLinear.get();
+ }
+ if (equalIgnoringCase(name, "OES_vertex_array_object")
+ && m_context->getExtensions()->supports("GL_OES_vertex_array_object")) {
+ if (!m_oesVertexArrayObject) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_vertex_array_object");
+ m_oesVertexArrayObject = std::make_unique<OESVertexArrayObject>(this);
+ }
+ return m_oesVertexArrayObject.get();
+ }
+ if (equalIgnoringCase(name, "OES_element_index_uint")
+ && m_context->getExtensions()->supports("GL_OES_element_index_uint")) {
+ if (!m_oesElementIndexUint) {
+ m_context->getExtensions()->ensureEnabled("GL_OES_element_index_uint");
+ m_oesElementIndexUint = std::make_unique<OESElementIndexUint>(this);
+ }
+ return m_oesElementIndexUint.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_lose_context")) {
+ if (!m_webglLoseContext)
+ m_webglLoseContext = std::make_unique<WebGLLoseContext>(this);
+ return m_webglLoseContext.get();
+ }
+ if ((equalIgnoringCase(name, "WEBKIT_WEBGL_compressed_texture_atc"))
+ && WebGLCompressedTextureATC::supported(this)) {
+ if (!m_webglCompressedTextureATC)
+ m_webglCompressedTextureATC = std::make_unique<WebGLCompressedTextureATC>(this);
+ return m_webglCompressedTextureATC.get();
+ }
+ if ((equalIgnoringCase(name, "WEBKIT_WEBGL_compressed_texture_pvrtc"))
+ && WebGLCompressedTexturePVRTC::supported(this)) {
+ if (!m_webglCompressedTexturePVRTC)
+ m_webglCompressedTexturePVRTC = std::make_unique<WebGLCompressedTexturePVRTC>(this);
+ return m_webglCompressedTexturePVRTC.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_compressed_texture_s3tc")
+ && WebGLCompressedTextureS3TC::supported(this)) {
+ if (!m_webglCompressedTextureS3TC)
+ m_webglCompressedTextureS3TC = std::make_unique<WebGLCompressedTextureS3TC>(this);
+ return m_webglCompressedTextureS3TC.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_depth_texture")
+ && WebGLDepthTexture::supported(graphicsContext3D())) {
+ if (!m_webglDepthTexture) {
+ m_context->getExtensions()->ensureEnabled("GL_CHROMIUM_depth_texture");
+ m_webglDepthTexture = std::make_unique<WebGLDepthTexture>(this);
+ }
+ return m_webglDepthTexture.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_draw_buffers") && supportsDrawBuffers()) {
+ if (!m_webglDrawBuffers) {
+ m_context->getExtensions()->ensureEnabled("GL_EXT_draw_buffers");
+ m_webglDrawBuffers = std::make_unique<WebGLDrawBuffers>(this);
+ }
+ return m_webglDrawBuffers.get();
+ }
+ if (equalIgnoringCase(name, "ANGLE_instanced_arrays") && ANGLEInstancedArrays::supported(this)) {
+ if (!m_angleInstancedArrays) {
+ m_context->getExtensions()->ensureEnabled("GL_ANGLE_instanced_arrays");
+ m_angleInstancedArrays = std::make_unique<ANGLEInstancedArrays>(this);
+ }
+ return m_angleInstancedArrays.get();
+ }
+ if (allowPrivilegedExtensions()) {
+ if (equalIgnoringCase(name, "WEBGL_debug_renderer_info")) {
+ if (!m_webglDebugRendererInfo)
+ m_webglDebugRendererInfo = std::make_unique<WebGLDebugRendererInfo>(this);
+ return m_webglDebugRendererInfo.get();
+ }
+ if (equalIgnoringCase(name, "WEBGL_debug_shaders")
+ && m_context->getExtensions()->supports("GL_ANGLE_translated_shader_source")) {
+ if (!m_webglDebugShaders)
+ m_webglDebugShaders = std::make_unique<WebGLDebugShaders>(this);
+ return m_webglDebugShaders.get();
+ }
+ }
+
+ return nullptr;
+}
+
+Vector<String> WebGLRenderingContext::getSupportedExtensions()
+{
+ Vector<String> result;
+
+ if (m_isPendingPolicyResolution)
+ return result;
+
+ if (m_context->getExtensions()->supports("GL_EXT_blend_minmax"))
+ result.append("EXT_blend_minmax");
+ if (m_context->getExtensions()->supports("GL_EXT_sRGB"))
+ result.append("EXT_sRGB");
+ if (m_context->getExtensions()->supports("GL_EXT_frag_depth"))
+ result.append("EXT_frag_depth");
+ if (m_context->getExtensions()->supports("GL_OES_texture_float"))
+ result.append("OES_texture_float");
+ if (m_context->getExtensions()->supports("GL_OES_texture_float_linear"))
+ result.append("OES_texture_float_linear");
+ if (m_context->getExtensions()->supports("GL_OES_texture_half_float"))
+ result.append("OES_texture_half_float");
+ if (m_context->getExtensions()->supports("GL_OES_texture_half_float_linear"))
+ result.append("OES_texture_half_float_linear");
+ if (m_context->getExtensions()->supports("GL_OES_standard_derivatives"))
+ result.append("OES_standard_derivatives");
+ if (m_context->getExtensions()->supports("GL_EXT_shader_texture_lod") || m_context->getExtensions()->supports("GL_ARB_shader_texture_lod"))
+ result.append("EXT_shader_texture_lod");
+ if (m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic"))
+ result.append("WEBKIT_EXT_texture_filter_anisotropic");
+ if (m_context->getExtensions()->supports("GL_OES_vertex_array_object"))
+ result.append("OES_vertex_array_object");
+ if (m_context->getExtensions()->supports("GL_OES_element_index_uint"))
+ result.append("OES_element_index_uint");
+ result.append("WEBGL_lose_context");
+ if (WebGLCompressedTextureATC::supported(this))
+ result.append("WEBKIT_WEBGL_compressed_texture_atc");
+ if (WebGLCompressedTexturePVRTC::supported(this))
+ result.append("WEBKIT_WEBGL_compressed_texture_pvrtc");
+ if (WebGLCompressedTextureS3TC::supported(this))
+ result.append("WEBGL_compressed_texture_s3tc");
+ if (WebGLDepthTexture::supported(graphicsContext3D()))
+ result.append("WEBGL_depth_texture");
+ if (supportsDrawBuffers())
+ result.append("WEBGL_draw_buffers");
+ if (ANGLEInstancedArrays::supported(this))
+ result.append("ANGLE_instanced_arrays");
+
+ if (allowPrivilegedExtensions()) {
+ if (m_context->getExtensions()->supports("GL_ANGLE_translated_shader_source"))
+ result.append("WEBGL_debug_shaders");
+ result.append("WEBGL_debug_renderer_info");
+ }
+
+ return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(WEBGL)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -35,6 +35,9 @@
</span><span class="cx"> WebGLRenderingContext(HTMLCanvasElement*, GraphicsContext3D::Attributes);
</span><span class="cx"> WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
</span><span class="cx"> virtual bool isWebGL1() const { return true; }
</span><ins>+
+ virtual WebGLExtension* getExtension(const String&) override;
+ virtual Vector<String> getSupportedExtensions() override;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -3095,60 +3095,6 @@
</span><span class="cx"> return ensureNotNull(shader->getSource());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<String> WebGLRenderingContextBase::getSupportedExtensions()
-{
- Vector<String> result;
-
- if (m_isPendingPolicyResolution)
- return result;
-
- if (m_context->getExtensions()->supports("GL_EXT_blend_minmax"))
- result.append("EXT_blend_minmax");
- if (m_context->getExtensions()->supports("GL_EXT_sRGB"))
- result.append("EXT_sRGB");
- if (m_context->getExtensions()->supports("GL_EXT_frag_depth"))
- result.append("EXT_frag_depth");
- if (m_context->getExtensions()->supports("GL_OES_texture_float"))
- result.append("OES_texture_float");
- if (m_context->getExtensions()->supports("GL_OES_texture_float_linear"))
- result.append("OES_texture_float_linear");
- if (m_context->getExtensions()->supports("GL_OES_texture_half_float"))
- result.append("OES_texture_half_float");
- if (m_context->getExtensions()->supports("GL_OES_texture_half_float_linear"))
- result.append("OES_texture_half_float_linear");
- if (m_context->getExtensions()->supports("GL_OES_standard_derivatives"))
- result.append("OES_standard_derivatives");
- if (m_context->getExtensions()->supports("GL_EXT_shader_texture_lod") || m_context->getExtensions()->supports("GL_ARB_shader_texture_lod"))
- result.append("EXT_shader_texture_lod");
- if (m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic"))
- result.append("WEBKIT_EXT_texture_filter_anisotropic");
- if (m_context->getExtensions()->supports("GL_OES_vertex_array_object"))
- result.append("OES_vertex_array_object");
- if (m_context->getExtensions()->supports("GL_OES_element_index_uint"))
- result.append("OES_element_index_uint");
- result.append("WEBGL_lose_context");
- if (WebGLCompressedTextureATC::supported(this))
- result.append("WEBKIT_WEBGL_compressed_texture_atc");
- if (WebGLCompressedTexturePVRTC::supported(this))
- result.append("WEBKIT_WEBGL_compressed_texture_pvrtc");
- if (WebGLCompressedTextureS3TC::supported(this))
- result.append("WEBGL_compressed_texture_s3tc");
- if (WebGLDepthTexture::supported(graphicsContext3D()))
- result.append("WEBGL_depth_texture");
- if (supportsDrawBuffers())
- result.append("WEBGL_draw_buffers");
- if (ANGLEInstancedArrays::supported(this))
- result.append("ANGLE_instanced_arrays");
-
- if (allowPrivilegedExtensions()) {
- if (m_context->getExtensions()->supports("GL_ANGLE_translated_shader_source"))
- result.append("WEBGL_debug_shaders");
- result.append("WEBGL_debug_renderer_info");
- }
-
- return result;
-}
-
</del><span class="cx"> WebGLGetInfo WebGLRenderingContextBase::getTexParameter(GC3Denum target, GC3Denum pname, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(ec);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> WebGLGetInfo getBufferParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
</span><span class="cx"> PassRefPtr<WebGLContextAttributes> getContextAttributes();
</span><span class="cx"> GC3Denum getError();
</span><del>- WebGLExtension* getExtension(const String& name);
</del><ins>+ virtual WebGLExtension* getExtension(const String& name) = 0;
</ins><span class="cx"> WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&);
</span><span class="cx"> WebGLGetInfo getParameter(GC3Denum pname, ExceptionCode&);
</span><span class="cx"> WebGLGetInfo getProgramParameter(WebGLProgram*, GC3Denum pname, ExceptionCode&);
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx"> String getShaderInfoLog(WebGLShader*, ExceptionCode&);
</span><span class="cx"> PassRefPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&);
</span><span class="cx"> String getShaderSource(WebGLShader*, ExceptionCode&);
</span><del>- Vector<String> getSupportedExtensions();
</del><ins>+ virtual Vector<String> getSupportedExtensions() = 0;
</ins><span class="cx"> WebGLGetInfo getTexParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
</span><span class="cx"> WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*, ExceptionCode&);
</span><span class="cx"> PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&, ExceptionCode&);
</span><span class="lines">@@ -335,10 +335,9 @@
</span><span class="cx"> void vertexAttribDivisor(GC3Duint index, GC3Duint divisor);
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>-WebGLRenderingContextBase(HTMLCanvasElement*, GraphicsContext3D::Attributes);
-WebGLRenderingContextBase(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
</del><ins>+ WebGLRenderingContextBase(HTMLCanvasElement*, GraphicsContext3D::Attributes);
+ WebGLRenderingContextBase(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
</ins><span class="cx">
</span><del>-private:
</del><span class="cx"> friend class WebGLDrawBuffers;
</span><span class="cx"> friend class WebGLFramebuffer;
</span><span class="cx"> friend class WebGLObject;
</span><span class="lines">@@ -350,8 +349,8 @@
</span><span class="cx"> friend class WebGLRenderingContextErrorMessageCallback;
</span><span class="cx"> friend class WebGLVertexArrayObjectOES;
</span><span class="cx">
</span><del>-void initializeNewContext();
-void setupFlags();
</del><ins>+ void initializeNewContext();
+ void setupFlags();
</ins><span class="cx">
</span><span class="cx"> // ActiveDOMObject
</span><span class="cx"> virtual bool hasPendingActivity() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl (179232 => 179233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl        2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl        2015-01-28 01:16:32 UTC (rev 179233)
</span><span class="lines">@@ -419,14 +419,6 @@
</span><span class="cx"> const GLenum STENCIL_INDEX8 = 0x8D48;
</span><span class="cx"> const GLenum DEPTH_STENCIL = 0x84F9;
</span><span class="cx">
</span><del>- const GLenum SRGB_EXT = 0x8C40;
- const GLenum SRGB_ALPHA_EXT = 0x8C42;
- const GLenum SRGB8_ALPHA8_EXT = 0x8C43;
- const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
-
- const GLenum MIN_EXT = 0x8007;
- const GLenum MAX_EXT = 0x8008;
-
</del><span class="cx"> const GLenum RENDERBUFFER_WIDTH = 0x8D42;
</span><span class="cx"> const GLenum RENDERBUFFER_HEIGHT = 0x8D43;
</span><span class="cx"> const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
</span></span></pre>
</div>
</div>
</body>
</html>