Diff
Modified: trunk/LayoutTests/ChangeLog (179232 => 179233)
--- trunk/LayoutTests/ChangeLog 2015-01-28 01:11:33 UTC (rev 179232)
+++ trunk/LayoutTests/ChangeLog 2015-01-28 01:16:32 UTC (rev 179233)
@@ -1,3 +1,13 @@
+2015-01-27 Roger Fong <[email protected]>
+
+ 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:
+
2015-01-27 Brent Fulgham <[email protected]>
[Win] More Windows rebaselines.
Modified: trunk/LayoutTests/fast/canvas/webgl/constants.html (179232 => 179233)
--- 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)
@@ -433,16 +433,6 @@
CONTEXT_LOST_WEBGL : 0x9242,
UNPACK_COLORSPACE_CONVERSION_WEBGL : 0x9243,
BROWSER_DEFAULT_WEBGL : 0x9244,
-
-/* 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
};
// Constants removed from the WebGL spec compared to ES 2.0
Modified: trunk/Source/WebCore/ChangeLog (179232 => 179233)
--- 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)
@@ -1,3 +1,25 @@
+2015-01-27 Roger Fong <[email protected]>
+
+ 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.
+
2015-01-27 Chris Dumez <[email protected]>
Remove unnecessary m_cachedPage null-checks in PageCache
Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (179232 => 179233)
--- 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)
@@ -28,7 +28,19 @@
#if ENABLE(WEBGL)
#include "WebGL2RenderingContext.h"
+#include "EXTTextureFilterAnisotropic.h"
+#include "Extensions3D.h"
+#include "OESTextureFloat.h"
+#include "OESTextureFloatLinear.h"
+#include "OESTextureHalfFloat.h"
+#include "OESTextureHalfFloatLinear.h"
#include "WebGLActiveInfo.h"
+#include "WebGLCompressedTextureATC.h"
+#include "WebGLCompressedTexturePVRTC.h"
+#include "WebGLCompressedTextureS3TC.h"
+#include "WebGLDebugRendererInfo.h"
+#include "WebGLDebugShaders.h"
+#include "WebGLDepthTexture.h"
#include "WebGLQuery.h"
#include "WebGLSampler.h"
#include "WebGLSync.h"
@@ -751,6 +763,129 @@
UNUSED_PARAM(vertexArray);
}
+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;
+}
+
} // namespace WebCore
#endif // ENABLE(WEBGL)
Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (179232 => 179233)
--- 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)
@@ -163,6 +163,10 @@
void deleteVertexArray(WebGLVertexArrayObject* vertexArray);
GC3Dboolean isVertexArray(WebGLVertexArrayObject* vertexArray);
void bindVertexArray(WebGLVertexArrayObject* vertexArray);
+
+ /* Extensions */
+ virtual WebGLExtension* getExtension(const String&) override;
+ virtual Vector<String> getSupportedExtensions() override;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (179232 => 179233)
--- 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)
@@ -28,6 +28,29 @@
#if ENABLE(WEBGL)
#include "WebGLRenderingContext.h"
+#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"
+
namespace WebCore {
WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, GraphicsContext3D::Attributes attributes)
@@ -40,6 +63,224 @@
{
}
+
+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;
+}
+
} // namespace WebCore
#endif // ENABLE(WEBGL)
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (179232 => 179233)
--- 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)
@@ -35,6 +35,9 @@
WebGLRenderingContext(HTMLCanvasElement*, GraphicsContext3D::Attributes);
WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
virtual bool isWebGL1() const { return true; }
+
+ virtual WebGLExtension* getExtension(const String&) override;
+ virtual Vector<String> getSupportedExtensions() override;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (179232 => 179233)
--- 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)
@@ -3095,60 +3095,6 @@
return ensureNotNull(shader->getSource());
}
-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;
-}
-
WebGLGetInfo WebGLRenderingContextBase::getTexParameter(GC3Denum target, GC3Denum pname, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (179232 => 179233)
--- 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)
@@ -176,7 +176,7 @@
WebGLGetInfo getBufferParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
PassRefPtr<WebGLContextAttributes> getContextAttributes();
GC3Denum getError();
- WebGLExtension* getExtension(const String& name);
+ virtual WebGLExtension* getExtension(const String& name) = 0;
WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname, ExceptionCode&);
WebGLGetInfo getParameter(GC3Denum pname, ExceptionCode&);
WebGLGetInfo getProgramParameter(WebGLProgram*, GC3Denum pname, ExceptionCode&);
@@ -186,7 +186,7 @@
String getShaderInfoLog(WebGLShader*, ExceptionCode&);
PassRefPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&);
String getShaderSource(WebGLShader*, ExceptionCode&);
- Vector<String> getSupportedExtensions();
+ virtual Vector<String> getSupportedExtensions() = 0;
WebGLGetInfo getTexParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*, ExceptionCode&);
PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&, ExceptionCode&);
@@ -335,10 +335,9 @@
void vertexAttribDivisor(GC3Duint index, GC3Duint divisor);
protected:
-WebGLRenderingContextBase(HTMLCanvasElement*, GraphicsContext3D::Attributes);
-WebGLRenderingContextBase(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
+ WebGLRenderingContextBase(HTMLCanvasElement*, GraphicsContext3D::Attributes);
+ WebGLRenderingContextBase(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
-private:
friend class WebGLDrawBuffers;
friend class WebGLFramebuffer;
friend class WebGLObject;
@@ -350,8 +349,8 @@
friend class WebGLRenderingContextErrorMessageCallback;
friend class WebGLVertexArrayObjectOES;
-void initializeNewContext();
-void setupFlags();
+ void initializeNewContext();
+ void setupFlags();
// ActiveDOMObject
virtual bool hasPendingActivity() const override;
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl (179232 => 179233)
--- 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)
@@ -419,14 +419,6 @@
const GLenum STENCIL_INDEX8 = 0x8D48;
const GLenum DEPTH_STENCIL = 0x84F9;
- 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;
-
const GLenum RENDERBUFFER_WIDTH = 0x8D42;
const GLenum RENDERBUFFER_HEIGHT = 0x8D43;
const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;