Diff
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog (269316 => 269317)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/ChangeLog 2020-11-03 19:14:11 UTC (rev 269317)
@@ -1,3 +1,60 @@
+2020-11-02 Alan Coon <[email protected]>
+
+ Cherry-pick r266364. rdar://problem/70970205
+
+ Implement WEBGL_compressed_texture_s3tc_srgb extension
+ https://bugs.webkit.org/show_bug.cgi?id=215973
+
+ Patch by James Darpinian <[email protected]> on 2020-08-31
+ Reviewed by Dean Jackson.
+
+ Source/ThirdParty/ANGLE:
+
+ * src/libANGLE/renderer/gl/formatutilsgl.cpp:
+ (rx::nativegl::ExtAndVersionOrExt):
+ (rx::nativegl::BuildInternalFormatInfoMap):
+
+ Source/WebCore:
+
+ Tested by webgl/2.0.0/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMConvertWebGL.cpp:
+ (WebCore::convertToJSValue):
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.cpp: Added.
+ (WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB):
+ (WebCore::WebGLCompressedTextureS3TCsRGB::getName const):
+ (WebCore::WebGLCompressedTextureS3TCsRGB::supported):
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.h: Added.
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: Added.
+ * html/canvas/WebGLExtension.h:
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getExtension):
+ (WebCore::WebGLRenderingContext::getSupportedExtensions):
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::extensionIsEnabled):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexSubDimensions):
+ * html/canvas/WebGLRenderingContextBase.h:
+ * platform/graphics/ExtensionsGL.h:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-08-31 James Darpinian <[email protected]>
+
+ Implement WEBGL_compressed_texture_s3tc_srgb extension
+ https://bugs.webkit.org/show_bug.cgi?id=215973
+
+ Reviewed by Dean Jackson.
+
+ * src/libANGLE/renderer/gl/formatutilsgl.cpp:
+ (rx::nativegl::ExtAndVersionOrExt):
+ (rx::nativegl::BuildInternalFormatInfoMap):
+
2020-10-29 Russell Epstein <[email protected]>
Cherry-pick r269118. rdar://problem/70795320
Modified: branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp (269316 => 269317)
--- branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/formatutilsgl.cpp 2020-11-03 19:14:11 UTC (rev 269317)
@@ -50,6 +50,21 @@
return requirement;
}
+// supported = requiredExt && (version || requiredWithoutVersionExt)
+static inline SupportRequirement ExtAndVersionOrExt(const std::string &requiredExt,
+ GLuint major,
+ GLuint minor,
+ const std::string &requiredWithoutVersionExt)
+{
+ SupportRequirement requirement;
+ requirement.requiredExtensions.resize(1);
+ angle::SplitStringAlongWhitespace(requiredExt, &requirement.requiredExtensions[0]);
+ requirement.version.major = major;
+ requirement.version.minor = minor;
+ angle::SplitStringAlongWhitespace(requiredWithoutVersionExt, &requirement.versionExtensions);
+ return requirement;
+}
+
// supported = version
static inline SupportRequirement VersionOnly(GLuint major, GLuint minor)
{
@@ -325,11 +340,11 @@
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_ANGLE_texture_compression_dxt5", "GL_EXT_texture_compression_s3tc"), AlwaysSupported(), NeverSupported(), NeverSupported() );
// From GL_EXT_texture_compression_s3tc_srgb
- // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
- InsertFormatMapping(&map, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
- InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | OpenGL ES texture attachment support | OpenGL ES renderbuffer support |
+ InsertFormatMapping(&map, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, ExtAndVersionOrExt("GL_EXT_texture_compression_s3tc", 2, 1, "GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, ExtAndVersionOrExt("GL_EXT_texture_compression_s3tc", 2, 1, "GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, ExtAndVersionOrExt("GL_EXT_texture_compression_s3tc", 2, 1, "GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
+ InsertFormatMapping(&map, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, ExtAndVersionOrExt("GL_EXT_texture_compression_s3tc", 2, 1, "GL_EXT_texture_sRGB"), AlwaysSupported(), NeverSupported(), ExtsOnly("GL_EXT_texture_compression_s3tc_srgb", "GL_EXT_texture_compression_s3tc GL_NV_sRGB_formats"), AlwaysSupported(), NeverSupported(), NeverSupported() );
// From GL_OES_compressed_ETC1_RGB8_texture
InsertFormatMapping(&map, GL_ETC1_RGB8_OES, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), AlwaysSupported(), NeverSupported(), VersionOrExts(3, 0, "GL_OES_compressed_ETC1_RGB8_texture"), AlwaysSupported(), NeverSupported(), NeverSupported() );
Modified: branches/safari-610-branch/Source/WebCore/CMakeLists.txt (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/CMakeLists.txt 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/CMakeLists.txt 2020-11-03 19:14:11 UTC (rev 269317)
@@ -1421,6 +1421,7 @@
html/canvas/WebGLCompressedTextureETC1.cpp
html/canvas/WebGLCompressedTexturePVRTC.cpp
html/canvas/WebGLCompressedTextureS3TC.cpp
+ html/canvas/WebGLCompressedTextureS3TCsRGB.cpp
html/canvas/WebGLContextEvent.cpp
html/canvas/WebGLContextGroup.cpp
html/canvas/WebGLContextObject.cpp
@@ -1477,6 +1478,7 @@
html/canvas/WebGLCompressedTextureETC1.idl
html/canvas/WebGLCompressedTexturePVRTC.idl
html/canvas/WebGLCompressedTextureS3TC.idl
+ html/canvas/WebGLCompressedTextureS3TCsRGB.idl
html/canvas/WebGLContextAttributes.idl
html/canvas/WebGLContextEvent.idl
html/canvas/WebGLDebugRendererInfo.idl
Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/ChangeLog 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog 2020-11-03 19:14:11 UTC (rev 269317)
@@ -1,5 +1,84 @@
2020-11-02 Alan Coon <[email protected]>
+ Cherry-pick r266364. rdar://problem/70970205
+
+ Implement WEBGL_compressed_texture_s3tc_srgb extension
+ https://bugs.webkit.org/show_bug.cgi?id=215973
+
+ Patch by James Darpinian <[email protected]> on 2020-08-31
+ Reviewed by Dean Jackson.
+
+ Source/ThirdParty/ANGLE:
+
+ * src/libANGLE/renderer/gl/formatutilsgl.cpp:
+ (rx::nativegl::ExtAndVersionOrExt):
+ (rx::nativegl::BuildInternalFormatInfoMap):
+
+ Source/WebCore:
+
+ Tested by webgl/2.0.0/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMConvertWebGL.cpp:
+ (WebCore::convertToJSValue):
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.cpp: Added.
+ (WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB):
+ (WebCore::WebGLCompressedTextureS3TCsRGB::getName const):
+ (WebCore::WebGLCompressedTextureS3TCsRGB::supported):
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.h: Added.
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: Added.
+ * html/canvas/WebGLExtension.h:
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getExtension):
+ (WebCore::WebGLRenderingContext::getSupportedExtensions):
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::extensionIsEnabled):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexSubDimensions):
+ * html/canvas/WebGLRenderingContextBase.h:
+ * platform/graphics/ExtensionsGL.h:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-08-31 James Darpinian <[email protected]>
+
+ Implement WEBGL_compressed_texture_s3tc_srgb extension
+ https://bugs.webkit.org/show_bug.cgi?id=215973
+
+ Reviewed by Dean Jackson.
+
+ Tested by webgl/2.0.0/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMConvertWebGL.cpp:
+ (WebCore::convertToJSValue):
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.cpp: Added.
+ (WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB):
+ (WebCore::WebGLCompressedTextureS3TCsRGB::getName const):
+ (WebCore::WebGLCompressedTextureS3TCsRGB::supported):
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.h: Added.
+ * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: Added.
+ * html/canvas/WebGLExtension.h:
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getExtension):
+ (WebCore::WebGLRenderingContext::getSupportedExtensions):
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::extensionIsEnabled):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
+ (WebCore::WebGLRenderingContextBase::validateCompressedTexSubDimensions):
+ * html/canvas/WebGLRenderingContextBase.h:
+ * platform/graphics/ExtensionsGL.h:
+
+2020-11-02 Alan Coon <[email protected]>
+
Cherry-pick r266362. rdar://problem/70970398
WebGL goes in a bad state where glContext.createProgram() returns null
Modified: branches/safari-610-branch/Source/WebCore/DerivedSources.make (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/DerivedSources.make 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/DerivedSources.make 2020-11-03 19:14:11 UTC (rev 269317)
@@ -938,6 +938,7 @@
$(WebCore)/html/canvas/WebGLCompressedTextureETC1.idl \
$(WebCore)/html/canvas/WebGLCompressedTexturePVRTC.idl \
$(WebCore)/html/canvas/WebGLCompressedTextureS3TC.idl \
+ $(WebCore)/html/canvas/WebGLCompressedTextureS3TCsRGB.idl \
$(WebCore)/html/canvas/WebGLContextAttributes.idl \
$(WebCore)/html/canvas/WebGLContextEvent.idl \
$(WebCore)/html/canvas/WebGLDebugRendererInfo.idl \
Modified: branches/safari-610-branch/Source/WebCore/Sources.txt (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/Sources.txt 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/Sources.txt 2020-11-03 19:14:11 UTC (rev 269317)
@@ -1259,6 +1259,7 @@
html/canvas/WebGLCompressedTextureETC1.cpp
html/canvas/WebGLCompressedTexturePVRTC.cpp
html/canvas/WebGLCompressedTextureS3TC.cpp
+html/canvas/WebGLCompressedTextureS3TCsRGB.cpp
html/canvas/WebGLContextEvent.cpp
html/canvas/WebGLContextGroup.cpp
html/canvas/WebGLContextObject.cpp
@@ -3532,6 +3533,7 @@
JSWebGLCompressedTextureETC1.cpp
JSWebGLCompressedTexturePVRTC.cpp
JSWebGLCompressedTextureS3TC.cpp
+JSWebGLCompressedTextureS3TCsRGB.cpp
JSWebGLContextAttributes.cpp
JSWebGLContextEvent.cpp
JSWebGLDebugRendererInfo.cpp
Modified: branches/safari-610-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-11-03 19:14:11 UTC (rev 269317)
@@ -11957,6 +11957,9 @@
A31C4E5116E02B08002F7957 /* JSOESTextureHalfFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESTextureHalfFloat.cpp; sourceTree = "<group>"; };
A31C4E5316E02B40002F7957 /* JSOESTextureHalfFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESTextureHalfFloat.h; sourceTree = "<group>"; };
A334BD822194E4610000D77F /* SSLKeyGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SSLKeyGenerator.cpp; sourceTree = "<group>"; };
+ A33C9F9124F835AA000F0845 /* WebGLCompressedTextureS3TCsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureS3TCsRGB.h; sourceTree = "<group>"; };
+ A33C9F9324F835AB000F0845 /* WebGLCompressedTextureS3TCsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureS3TCsRGB.cpp; sourceTree = "<group>"; };
+ A33C9F9424F835AB000F0845 /* WebGLCompressedTextureS3TCsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLCompressedTextureS3TCsRGB.idl; sourceTree = "<group>"; };
A3AF9D81203252EE006CAD06 /* UserAgentCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentCocoa.mm; sourceTree = "<group>"; };
A3AF9D8220325324006CAD06 /* UserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserAgent.h; sourceTree = "<group>"; };
A3AF9D8320325691006CAD06 /* UserAgentIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentIOS.mm; sourceTree = "<group>"; };
@@ -19280,6 +19283,9 @@
6E3FAE8C14733FDB00E42306 /* WebGLCompressedTextureS3TC.cpp */,
6E3FAE8D14733FDB00E42306 /* WebGLCompressedTextureS3TC.h */,
6E3FAE9014733FEA00E42306 /* WebGLCompressedTextureS3TC.idl */,
+ A33C9F9324F835AB000F0845 /* WebGLCompressedTextureS3TCsRGB.cpp */,
+ A33C9F9124F835AA000F0845 /* WebGLCompressedTextureS3TCsRGB.h */,
+ A33C9F9424F835AB000F0845 /* WebGLCompressedTextureS3TCsRGB.idl */,
6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */,
6E4E91AB10F7FB3100A2779C /* WebGLContextAttributes.idl */,
93F6F1EA127F70B10055CB06 /* WebGLContextEvent.cpp */,
Modified: branches/safari-610-branch/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp 2020-11-03 19:14:11 UTC (rev 269317)
@@ -52,6 +52,7 @@
#include "JSWebGLCompressedTextureETC1.h"
#include "JSWebGLCompressedTexturePVRTC.h"
#include "JSWebGLCompressedTextureS3TC.h"
+#include "JSWebGLCompressedTextureS3TCsRGB.h"
#include "JSWebGLDebugRendererInfo.h"
#include "JSWebGLDebugShaders.h"
#include "JSWebGLDepthTexture.h"
@@ -204,6 +205,8 @@
return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTexturePVRTC&>(extension));
case WebGLExtension::WebGLCompressedTextureS3TCName:
return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureS3TC&>(extension));
+ case WebGLExtension::WebGLCompressedTextureS3TCsRGBName:
+ return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureS3TCsRGB&>(extension));
case WebGLExtension::WebGLCompressedTextureASTCName:
return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureASTC&>(extension));
case WebGLExtension::WebGLDepthTextureName:
Added: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.cpp (0 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.cpp (rev 0)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.cpp 2020-11-03 19:14:11 UTC (rev 269317)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2020 Google 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 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 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 "config.h"
+
+#if ENABLE(WEBGL)
+#include "WebGLCompressedTextureS3TCsRGB.h"
+
+#include "ExtensionsGL.h"
+#include "WebGLRenderingContextBase.h"
+
+namespace WebCore {
+
+WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB(WebGLRenderingContextBase& context)
+ : WebGLExtension(context)
+{
+ auto& extensions = context.graphicsContextGL()->getExtensions();
+ extensions.ensureEnabled("GL_EXT_texture_compression_s3tc_srgb");
+
+ context.addCompressedTextureFormat(ExtensionsGL::COMPRESSED_SRGB_S3TC_DXT1_EXT);
+ context.addCompressedTextureFormat(ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT);
+ context.addCompressedTextureFormat(ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT);
+ context.addCompressedTextureFormat(ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT);
+}
+
+WebGLCompressedTextureS3TCsRGB::~WebGLCompressedTextureS3TCsRGB() = default;
+
+WebGLExtension::ExtensionName WebGLCompressedTextureS3TCsRGB::getName() const
+{
+ return WebGLCompressedTextureS3TCsRGBName;
+}
+
+bool WebGLCompressedTextureS3TCsRGB::supported(WebGLRenderingContextBase& context)
+{
+ auto& extensions = context.graphicsContextGL()->getExtensions();
+ return extensions.supports("GL_EXT_texture_compression_s3tc_srgb");
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)
Added: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.h (0 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.h (rev 0)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.h 2020-11-03 19:14:11 UTC (rev 269317)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2020 Google 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 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 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.
+ */
+
+#pragma once
+
+#if ENABLE(WEBGL)
+
+#include "WebGLExtension.h"
+
+namespace WebCore {
+
+class WebGLTexture;
+
+class WebGLCompressedTextureS3TCsRGB final : public WebGLExtension {
+public:
+ explicit WebGLCompressedTextureS3TCsRGB(WebGLRenderingContextBase&);
+ virtual ~WebGLCompressedTextureS3TCsRGB();
+
+ static bool supported(WebGLRenderingContextBase&);
+
+ ExtensionName getName() const override;
+};
+
+} // namespace WebCore
+
+#endif
Added: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.idl (0 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.idl (rev 0)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLCompressedTextureS3TCsRGB.idl 2020-11-03 19:14:11 UTC (rev 269317)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 Google 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 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 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.
+ */
+
+[
+ Conditional=WEBGL,
+ DoNotCheckConstants,
+ GenerateIsReachable=ImplWebGLRenderingContext,
+ NoInterfaceObject,
+] interface WebGLCompressedTextureS3TCsRGB {
+ const unsigned long COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
+ const unsigned long COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
+ const unsigned long COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
+ const unsigned long COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
+};
Modified: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLExtension.h (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLExtension.h 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLExtension.h 2020-11-03 19:14:11 UTC (rev 269317)
@@ -52,6 +52,7 @@
WebGLDebugRendererInfoName,
WebGLDebugShadersName,
WebGLCompressedTextureS3TCName,
+ WebGLCompressedTextureS3TCsRGBName,
WebGLDepthTextureName,
WebGLDrawBuffersName,
OESElementIndexUintName,
Modified: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContext.cpp 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContext.cpp 2020-11-03 19:14:11 UTC (rev 269317)
@@ -58,6 +58,7 @@
#include "WebGLCompressedTextureETC1.h"
#include "WebGLCompressedTexturePVRTC.h"
#include "WebGLCompressedTextureS3TC.h"
+#include "WebGLCompressedTextureS3TCsRGB.h"
#include "WebGLDebugRendererInfo.h"
#include "WebGLDebugShaders.h"
#include "WebGLDepthTexture.h"
@@ -164,6 +165,7 @@
ENABLE_IF_REQUESTED(WebGLCompressedTextureETC1, m_webglCompressedTextureETC1, "WEBGL_compressed_texture_etc1", WebGLCompressedTextureETC1::supported(*this));
ENABLE_IF_REQUESTED(WebGLCompressedTexturePVRTC, m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc", WebGLCompressedTexturePVRTC::supported(*this));
ENABLE_IF_REQUESTED(WebGLCompressedTextureS3TC, m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc", WebGLCompressedTextureS3TC::supported(*this));
+ ENABLE_IF_REQUESTED(WebGLCompressedTextureS3TCsRGB, m_webglCompressedTextureS3TCsRGB, "WEBGL_compressed_texture_s3tc_srgb", WebGLCompressedTextureS3TCsRGB::supported(*this));
ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*m_context));
if (equalIgnoringASCIICase(name, "WEBGL_draw_buffers")) {
if (!m_webglDrawBuffers) {
@@ -243,6 +245,8 @@
result.append("WEBKIT_WEBGL_compressed_texture_pvrtc"_s);
if (WebGLCompressedTextureS3TC::supported(*this))
result.append("WEBGL_compressed_texture_s3tc"_s);
+ if (WebGLCompressedTextureS3TCsRGB::supported(*this))
+ result.append("WEBGL_compressed_texture_s3tc_srgb"_s);
if (WebGLDepthTexture::supported(*m_context))
result.append("WEBGL_depth_texture"_s);
if (supportsDrawBuffers())
Modified: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2020-11-03 19:14:11 UTC (rev 269317)
@@ -81,6 +81,7 @@
#include "WebGLCompressedTextureETC1.h"
#include "WebGLCompressedTexturePVRTC.h"
#include "WebGLCompressedTextureS3TC.h"
+#include "WebGLCompressedTextureS3TCsRGB.h"
#include "WebGLContextAttributes.h"
#include "WebGLContextEvent.h"
#include "WebGLContextGroup.h"
@@ -3728,6 +3729,7 @@
CHECK_EXTENSION(m_webglCompressedTextureETC1, "WEBGL_compressed_texture_etc1");
CHECK_EXTENSION(m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc");
CHECK_EXTENSION(m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc");
+ CHECK_EXTENSION(m_webglCompressedTextureS3TCsRGB, "WEBGL_compressed_texture_s3tc_srgb");
CHECK_EXTENSION(m_webglDepthTexture, "WEBGL_depth_texture");
CHECK_EXTENSION(m_webglDrawBuffers, "WEBGL_draw_buffers");
CHECK_EXTENSION(m_angleInstancedArrays, "ANGLE_instanced_arrays");
@@ -6615,6 +6617,8 @@
switch (format) {
case ExtensionsGL::COMPRESSED_RGB_S3TC_DXT1_EXT:
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
case ExtensionsGL::COMPRESSED_ATC_RGB_AMD:
case ExtensionsGL::ETC1_RGB8_OES: {
const int kBlockSize = 8;
@@ -6627,6 +6631,8 @@
}
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT3_EXT:
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
case ExtensionsGL::COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD:
case ExtensionsGL::COMPRESSED_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
{
@@ -6737,7 +6743,11 @@
case ExtensionsGL::COMPRESSED_RGB_S3TC_DXT1_EXT:
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT1_EXT:
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT5_EXT: {
+ case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: {
const GCGLsizei kBlockWidth = 4;
const GCGLsizei kBlockHeight = 4;
const GCGLint maxTextureSize = target ? m_maxTextureSize : m_maxCubeMapTextureSize;
@@ -6817,7 +6827,11 @@
case ExtensionsGL::COMPRESSED_RGB_S3TC_DXT1_EXT:
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT1_EXT:
case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT3_EXT:
- case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT5_EXT: {
+ case ExtensionsGL::COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ case ExtensionsGL::COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: {
const int kBlockWidth = 4;
const int kBlockHeight = 4;
if ((xoffset % kBlockWidth) || (yoffset % kBlockHeight)) {
Modified: branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2020-11-03 19:14:11 UTC (rev 269317)
@@ -96,6 +96,7 @@
class WebGLCompressedTextureETC1;
class WebGLCompressedTexturePVRTC;
class WebGLCompressedTextureS3TC;
+class WebGLCompressedTextureS3TCsRGB;
class WebGLContextGroup;
class WebGLContextObject;
class WebGLDebugRendererInfo;
@@ -436,6 +437,7 @@
friend class WebGLCompressedTextureETC1;
friend class WebGLCompressedTexturePVRTC;
friend class WebGLCompressedTextureS3TC;
+ friend class WebGLCompressedTextureS3TCsRGB;
friend class WebGLRenderingContextErrorMessageCallback;
friend class WebGLVertexArrayObjectOES;
friend class WebGLVertexArrayObject;
@@ -683,6 +685,7 @@
RefPtr<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1;
RefPtr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
RefPtr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;
+ RefPtr<WebGLCompressedTextureS3TCsRGB> m_webglCompressedTextureS3TCsRGB;
RefPtr<WebGLDepthTexture> m_webglDepthTexture;
RefPtr<WebGLDrawBuffers> m_webglDrawBuffers;
RefPtr<ANGLEInstancedArrays> m_angleInstancedArrays;
Modified: branches/safari-610-branch/Source/WebCore/platform/graphics/ExtensionsGL.h (269316 => 269317)
--- branches/safari-610-branch/Source/WebCore/platform/graphics/ExtensionsGL.h 2020-11-03 19:14:05 UTC (rev 269316)
+++ branches/safari-610-branch/Source/WebCore/platform/graphics/ExtensionsGL.h 2020-11-03 19:14:11 UTC (rev 269317)
@@ -67,6 +67,7 @@
// on this extension)
// GL_EXT_texture_compression_dxt1
// GL_EXT_texture_compression_s3tc
+ // GL_EXT_texture_compression_s3tc_srgb
// GL_OES_compressed_ETC1_RGB8_texture
// GL_IMG_texture_compression_pvrtc
// GL_KHR_texture_compression_astc_hdr
@@ -155,6 +156,12 @@
COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2,
COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3,
+ // GL_EXT_texture_compression_s3tc_srgb
+ COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C,
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D,
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E,
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F,
+
// GL_OES_compressed_ETC1_RGB8_texture
ETC1_RGB8_OES = 0x8D64,