WebKit Bugzilla
Attachment 339503 Details for
Bug 185272
: [WebGL] WEBGL_compressed_texture_astc support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185272-20180503185949.patch (text/plain), 40.60 KB, created by
Justin Fan
on 2018-05-03 18:59:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Fan
Created:
2018-05-03 18:59:50 PDT
Size:
40.60 KB
patch
obsolete
>Subversion Revision: 231339 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index beade0fe96be23841d9ab9d3207ef180ec0674c4..8c564b66993c60003a87b7fc8bc0356194bd8a96 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,39 @@ >+2018-05-03 Justin Fan <justin_fan@apple.com> >+ >+ Hooked up ASTC support in WebGL. Requires OpenGL ES 3 context to work. >+ Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite, >+ although again, this requires OpenGL ES 3 context for WebKit to detect proper support. >+ https://bugs.webkit.org/show_bug.cgi?id=185272 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fast/canvas/webgl/webgl-compressed-texture-astc.html >+ >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/JSDOMConvertWebGL.cpp: >+ (WebCore::convertToJSValue): >+ * html/canvas/WebGL2RenderingContext.cpp: >+ (WebCore::WebGL2RenderingContext::getExtension): >+ (WebCore::WebGL2RenderingContext::getSupportedExtensions): >+ * html/canvas/WebGLCompressedTextureASTC.cpp: Added. >+ (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC): >+ (WebCore::WebGLCompressedTextureASTC::getName const): >+ (WebCore::WebGLCompressedTextureASTC::supported): >+ (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles): >+ * html/canvas/WebGLCompressedTextureASTC.h: Added. >+ * html/canvas/WebGLCompressedTextureASTC.idl: Added. >+ * html/canvas/WebGLExtension.h: >+ * html/canvas/WebGLRenderingContext.cpp: >+ (WebCore::WebGLRenderingContext::getExtension): >+ (WebCore::WebGLRenderingContext::getSupportedExtensions): >+ * html/canvas/WebGLRenderingContextBase.cpp: >+ (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData): >+ (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions): >+ * html/canvas/WebGLRenderingContextBase.h: >+ * platform/graphics/Extensions3D.h: >+ > 2018-05-03 Filip Pizlo <fpizlo@apple.com> > > Strings should not be allocated in a gigacage >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 23c95bf9681507da7c83c8378c2e608039bf1f32..264414e49a7c15e7cc733ecf7ec954f5123d454f 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -1169,6 +1169,7 @@ if (ENABLE_WEBGL) > html/canvas/OESVertexArrayObject.cpp > html/canvas/WebGL2RenderingContext.cpp > html/canvas/WebGLBuffer.cpp >+ html/canvas/WebGLCompressedTextureASTC.cpp > html/canvas/WebGLCompressedTextureATC.cpp > html/canvas/WebGLCompressedTexturePVRTC.cpp > html/canvas/WebGLCompressedTextureS3TC.cpp >@@ -1217,6 +1218,7 @@ if (ENABLE_WEBGL) > html/canvas/WebGL2RenderingContext.idl > html/canvas/WebGLActiveInfo.idl > html/canvas/WebGLBuffer.idl >+ html/canvas/WebGLCompressedTextureASTC.idl > html/canvas/WebGLCompressedTextureATC.idl > html/canvas/WebGLCompressedTexturePVRTC.idl > html/canvas/WebGLCompressedTextureS3TC.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index ac0b6f1692776c5e4be9a663fd306c277ceb162c..b660e322817f18bfe17bce67bdff01e5cc05d9ce 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -693,6 +693,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/html/canvas/WebGL2RenderingContext.idl \ > $(WebCore)/html/canvas/WebGLActiveInfo.idl \ > $(WebCore)/html/canvas/WebGLBuffer.idl \ >+ $(WebCore)/html/canvas/WebGLCompressedTextureASTC.idl \ > $(WebCore)/html/canvas/WebGLCompressedTextureATC.idl \ > $(WebCore)/html/canvas/WebGLCompressedTexturePVRTC.idl \ > $(WebCore)/html/canvas/WebGLCompressedTextureS3TC.idl \ >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 599b54b0e99ce411d50ab968e85c5cc5b83ffadc..48f1097a010e437baef1a20fdb405e16d63dd9c4 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -3193,6 +3193,7 @@ JSOESVertexArrayObject.cpp > JSWebGL2RenderingContext.cpp > JSWebGLActiveInfo.cpp > JSWebGLBuffer.cpp >+JSWebGLCompressedTextureASTC.cpp > JSWebGLCompressedTextureATC.cpp > JSWebGLCompressedTexturePVRTC.cpp > JSWebGLCompressedTextureS3TC.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index bf68d47ec2065e9281e45126b44db6a43cf3f91c..63869a14d73935003b0772bf0690c1883eacfa42 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -4105,6 +4105,8 @@ > D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */; }; > D07DEABA0A36554A00CA30F8 /* InsertListCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D07DEAB80A36554A00CA30F8 /* InsertListCommand.h */; }; > D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D086FE9609D53AAB005BC74D /* UnlinkCommand.h */; }; >+ D0A20D572092A0A700E0C259 /* WebGLCompressedTextureASTC.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */; }; >+ D0A20D582092A0A700E0C259 /* WebGLCompressedTextureASTC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */; }; > D0A3A7311405A39800FB8ED3 /* ResourceLoaderOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; > D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B0556609C6700100307E43 /* CreateLinkCommand.h */; }; > D0BC54491443AC4A00E105DA /* CachedStyleSheetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -13469,6 +13471,7 @@ > D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; }; > D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DictationPhraseWithAlternativesDot.png; sourceTree = "<group>"; }; > D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "DictationPhraseWithAlternativesDot@2x.png"; sourceTree = "<group>"; }; >+ D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureASTC.idl; sourceTree = "<group>"; }; > D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; }; > D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; }; > D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoveFormatCommand.h; sourceTree = "<group>"; }; >@@ -13477,6 +13480,8 @@ > D07DEAB80A36554A00CA30F8 /* InsertListCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InsertListCommand.h; sourceTree = "<group>"; }; > D086FE9609D53AAB005BC74D /* UnlinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkCommand.h; sourceTree = "<group>"; }; > D086FE9709D53AAB005BC74D /* UnlinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkCommand.cpp; sourceTree = "<group>"; }; >+ D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureASTC.h; sourceTree = "<group>"; }; >+ D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureASTC.cpp; sourceTree = "<group>"; }; > D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderOptions.h; sourceTree = "<group>"; }; > D0B0556609C6700100307E43 /* CreateLinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateLinkCommand.h; sourceTree = "<group>"; }; > D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CreateLinkCommand.cpp; sourceTree = "<group>"; }; >@@ -17248,6 +17253,9 @@ > 49C7B9A81042D32E0009D447 /* WebGLBuffer.cpp */, > 49C7B9A91042D32E0009D447 /* WebGLBuffer.h */, > 49C7B9AA1042D32E0009D447 /* WebGLBuffer.idl */, >+ D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */, >+ D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */, >+ D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */, > 7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */, > 7E66E23216D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h */, > 7EA30F6216DFD62700257D0B /* WebGLCompressedTextureATC.idl */, >@@ -30727,6 +30735,7 @@ > 6E47E66110B7944B00B186C8 /* WebGLAny.h in Headers */, > 1AFFC4581D5E865500267A66 /* WebGLBlacklist.h in Headers */, > 49C7B9C91042D32F0009D447 /* WebGLBuffer.h in Headers */, >+ D0A20D572092A0A700E0C259 /* WebGLCompressedTextureASTC.h in Headers */, > 7E66E23416D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h in Headers */, > 7E66E23417E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h in Headers */, > 6E3FAE8F14733FDB00E42306 /* WebGLCompressedTextureS3TC.h in Headers */, >@@ -32014,6 +32023,7 @@ > 93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */, > D3F3D36D1A69B7DC0059FC2B /* WebGL2RenderingContext.cpp in Sources */, > 49C7B9C81042D32F0009D447 /* WebGLBuffer.cpp in Sources */, >+ D0A20D582092A0A700E0C259 /* WebGLCompressedTextureASTC.cpp in Sources */, > 7E66E23316D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp in Sources */, > 7E66E23317E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.cpp in Sources */, > 6E3FAE8E14733FDB00E42306 /* WebGLCompressedTextureS3TC.cpp in Sources */, >diff --git a/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp b/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp >index 126af2ac09b2f9061918bc20a652d91a0c0b8b7e..0b977318dcd08c660a93d3b048c7b0ce2d322d15 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp >+++ b/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp >@@ -43,6 +43,7 @@ > #include "JSOESTextureHalfFloatLinear.h" > #include "JSOESVertexArrayObject.h" > #include "JSWebGLBuffer.h" >+#include "JSWebGLCompressedTextureASTC.h" > #include "JSWebGLCompressedTextureATC.h" > #include "JSWebGLCompressedTexturePVRTC.h" > #include "JSWebGLCompressedTextureS3TC.h" >@@ -179,6 +180,8 @@ JSValue convertToJSValue(ExecState& state, JSDOMGlobalObject& globalObject, WebG > return toJS(&state, &globalObject, static_cast<WebGLCompressedTexturePVRTC&>(extension)); > case WebGLExtension::WebGLCompressedTextureS3TCName: > return toJS(&state, &globalObject, static_cast<WebGLCompressedTextureS3TC&>(extension)); >+ case WebGLExtension::WebGLCompressedTextureASTCName: >+ return toJS(&state, &globalObject, static_cast<WebGLCompressedTextureASTC&>(extension)); > case WebGLExtension::WebGLDepthTextureName: > return toJS(&state, &globalObject, static_cast<WebGLDepthTexture&>(extension)); > case WebGLExtension::WebGLDrawBuffersName: >diff --git a/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp b/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp >index 5e45bee680fadf2d05b05f4a806f082157056751..d6386aab47ebd97085ac57d209e8c067f5683d94 100644 >--- a/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp >+++ b/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp >@@ -42,6 +42,7 @@ > #include "OESTextureHalfFloatLinear.h" > #include "RenderBox.h" > #include "WebGLActiveInfo.h" >+#include "WebGLCompressedTextureASTC.h" > #include "WebGLCompressedTextureATC.h" > #include "WebGLCompressedTexturePVRTC.h" > #include "WebGLCompressedTextureS3TC.h" >@@ -1123,6 +1124,7 @@ WebGLExtension* WebGL2RenderingContext::getExtension(const String& name) > ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::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(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this)); > ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*graphicsContext3D())); > ENABLE_IF_REQUESTED(WebGLDebugRendererInfo, m_webglDebugRendererInfo, "WEBGL_debug_renderer_info", true); > ENABLE_IF_REQUESTED(WebGLDebugShaders, m_webglDebugShaders, "WEBGL_debug_shaders", m_context->getExtensions().supports(ASCIILiteral { "GL_ANGLE_translated_shader_source" })); >@@ -1156,6 +1158,8 @@ std::optional<Vector<String>> WebGL2RenderingContext::getSupportedExtensions() > result.append(ASCIILiteral { "WEBKIT_WEBGL_compressed_texture_pvrtc" }); > if (WebGLCompressedTextureS3TC::supported(*this)) > result.append(ASCIILiteral { "WEBGL_compressed_texture_s3tc" }); >+ if (WebGLCompressedTextureASTC::supported(*this)) >+ result.append(ASCIILiteral { "WEBGL_compressed_texture_astc" }); > if (WebGLDepthTexture::supported(*graphicsContext3D())) > result.append(ASCIILiteral { "WEBGL_depth_texture" }); > result.append(ASCIILiteral { "WEBGL_lose_context" }); >diff --git a/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.cpp b/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..9378c36da1d1a2fb2c8df0bacf7bec88a3e3af45 >--- /dev/null >+++ b/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.cpp >@@ -0,0 +1,98 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#if ENABLE(WEBGL) >+#include "WebGLCompressedTextureASTC.h" >+ >+#include "Extensions3D.h" >+#include "RuntimeEnabledFeatures.h" >+#include "WebGLRenderingContextBase.h" >+ >+namespace WebCore { >+ >+WebGLCompressedTextureASTC::WebGLCompressedTextureASTC(WebGLRenderingContextBase& context) >+ : WebGLExtension(context) >+{ >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_5x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_6x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_6x6_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_8x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_8x6_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_8x8_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x6_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x8_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x10_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_12x10_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_12x12_KHR); >+ >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR); >+ context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR); >+} >+ >+WebGLCompressedTextureASTC::~WebGLCompressedTextureASTC() = default; >+ >+WebGLExtension::ExtensionName WebGLCompressedTextureASTC::getName() const >+{ >+ return WebGLCompressedTextureASTCName; >+} >+ >+bool WebGLCompressedTextureASTC::supported(WebGLRenderingContextBase& context) >+{ >+ return RuntimeEnabledFeatures::sharedFeatures().webGLCompressedTextureASTCSupportEnabled() >+ && (context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_hdr" }) >+ || context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_ldr" })); >+} >+ >+Vector<String> WebGLCompressedTextureASTC::getSupportedProfiles() >+{ >+ Vector<String> result; >+ >+ if (m_context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_hdr" })) >+ result.append(ASCIILiteral { "hdr" }); >+ if (m_context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_ldr" })) >+ result.append(ASCIILiteral { "ldr" }); >+ >+ return result; >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGL) >diff --git a/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.h b/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.h >new file mode 100644 >index 0000000000000000000000000000000000000000..87e9dd5ae7a95ead766ac34d89394ae6ff13ae50 >--- /dev/null >+++ b/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.h >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "WebGLExtension.h" >+ >+namespace WebCore { >+ >+class WebGLCompressedTextureASTC final : public WebGLExtension { >+public: >+ explicit WebGLCompressedTextureASTC(WebGLRenderingContextBase&); >+ virtual ~WebGLCompressedTextureASTC(); >+ >+ Vector<String> getSupportedProfiles(); >+ >+ static bool supported(WebGLRenderingContextBase&); >+ ExtensionName getName() const override; >+}; >+ >+} // namespace WebCore >diff --git a/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.idl b/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..19213cc36e879ad01a12d733bcbe5d68ae466055 >--- /dev/null >+++ b/Source/WebCore/html/canvas/WebGLCompressedTextureASTC.idl >@@ -0,0 +1,65 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+[ >+ Conditional=WEBGL, >+ DoNotCheckConstants, >+ GenerateIsReachable=ImplWebGLRenderingContext, >+ NoInterfaceObject, >+] interface WebGLCompressedTextureASTC { >+ /* Compressed Texture Format */ >+ const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; >+ const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; >+ const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; >+ const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; >+ const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; >+ const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; >+ const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; >+ const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; >+ const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; >+ const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; >+ const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; >+ const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; >+ const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; >+ const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; >+ >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; >+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; >+ >+ // Profile query support. >+ sequence<DOMString> getSupportedProfiles(); >+}; >diff --git a/Source/WebCore/html/canvas/WebGLExtension.h b/Source/WebCore/html/canvas/WebGLExtension.h >index 7f709b4458037aec71e72a4d724833e919e83dfc..0f601fa82ffd826750e195042c548f49a5ffc287 100644 >--- a/Source/WebCore/html/canvas/WebGLExtension.h >+++ b/Source/WebCore/html/canvas/WebGLExtension.h >@@ -54,6 +54,7 @@ public: > OESElementIndexUintName, > WebGLCompressedTextureATCName, > WebGLCompressedTexturePVRTCName, >+ WebGLCompressedTextureASTCName, > ANGLEInstancedArraysName, > }; > >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp >index dbc1418595b722ffd6985391173f856aad03114b..a1a51c71704b3a114a9f95712d358a30b8d8defe 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp >@@ -49,6 +49,7 @@ > #include "OESTextureHalfFloatLinear.h" > #include "OESVertexArrayObject.h" > #include "RenderBox.h" >+#include "WebGLCompressedTextureASTC.h" > #include "WebGLCompressedTextureATC.h" > #include "WebGLCompressedTexturePVRTC.h" > #include "WebGLCompressedTextureS3TC.h" >@@ -147,6 +148,7 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name) > ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::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(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this)); > ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*m_context)); > if (equalIgnoringASCIICase(name, "WEBGL_draw_buffers")) { > if (!m_webglDrawBuffers) { >@@ -217,7 +219,9 @@ std::optional<Vector<String>> WebGLRenderingContext::getSupportedExtensions() > if (WebGLCompressedTexturePVRTC::supported(*this)) > result.append(ASCIILiteral { "WEBKIT_WEBGL_compressed_texture_pvrtc" }); > if (WebGLCompressedTextureS3TC::supported(*this)) >- result.append("WEBGL_compressed_texture_s3tc"); >+ result.append(ASCIILiteral { "WEBGL_compressed_texture_s3tc" }); >+ if (WebGLCompressedTextureASTC::supported(*this)) >+ result.append(ASCIILiteral { "WEBGL_compressed_texture_astc" }); > if (WebGLDepthTexture::supported(*m_context)) > result.append(ASCIILiteral { "WEBGL_depth_texture" }); > if (supportsDrawBuffers()) >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >index 7875da8de5c9118d03551b3811a2213db7742085..58b71c186406d041c61046d746adc183ae2564b6 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >@@ -71,6 +71,7 @@ > #include "WebGL2RenderingContext.h" > #include "WebGLActiveInfo.h" > #include "WebGLBuffer.h" >+#include "WebGLCompressedTextureASTC.h" > #include "WebGLCompressedTextureATC.h" > #include "WebGLCompressedTexturePVRTC.h" > #include "WebGLCompressedTextureS3TC.h" >@@ -5417,6 +5418,132 @@ bool WebGLRenderingContextBase::validateCompressedTexFuncData(const char* functi > bytesRequired = (std::max(width, kBlockWidth) * std::max(height, kBlockHeight) * 2 + 7) / kBlockSize; > } > break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 4; >+ const int kBlockHeight = 4; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 5; >+ const int kBlockHeight = 4; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_5x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 5; >+ const int kBlockHeight = 5; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_6x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 6; >+ const int kBlockHeight = 5; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_6x6_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 6; >+ const int kBlockHeight = 6; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_8x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 8; >+ const int kBlockHeight = 5; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_8x6_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 8; >+ const int kBlockHeight = 6; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_8x8_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 8; >+ const int kBlockHeight = 8; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 10; >+ const int kBlockHeight = 5; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x6_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 10; >+ const int kBlockHeight = 6; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x8_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 10; >+ const int kBlockHeight = 8; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x10_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 10; >+ const int kBlockHeight = 10; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_12x10_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 12; >+ const int kBlockHeight = 10; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_12x12_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: >+ { >+ const int kBlockSize = 16; >+ const int kBlockWidth = 12; >+ const int kBlockHeight = 12; >+ bytesRequired = ((width + kBlockWidth - 1) / kBlockWidth) * ((height + kBlockHeight - 1) / kBlockHeight) * kBlockSize; >+ } >+ break; > default: > synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid format"); > return false; >@@ -5459,6 +5586,36 @@ bool WebGLRenderingContextBase::validateCompressedTexDimensions(const char* func > return false; > } > return true; >+ case Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_5x5_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_6x5_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_6x6_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_8x5_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_8x6_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_8x8_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x5_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x6_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x8_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_10x10_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_12x10_KHR: >+ case Extensions3D::COMPRESSED_RGBA_ASTC_12x12_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: >+ case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: >+ // No height and width restrictions on ASTC. >+ return true; > default: > return false; > } >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >index d2a391959dbc14eecafb0a0e00eb7e889662f7bd..6098a4b2f56c6d130934c8e9395d54f4d804afb5 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >@@ -71,6 +71,7 @@ class OffscreenCanvas; > class WebGLActiveInfo; > class WebGLContextGroup; > class WebGLContextObject; >+class WebGLCompressedTextureASTC; > class WebGLCompressedTextureATC; > class WebGLCompressedTexturePVRTC; > class WebGLCompressedTextureS3TC; >@@ -366,6 +367,7 @@ protected: > friend class WebGLObject; > friend class OESVertexArrayObject; > friend class WebGLDebugShaders; >+ friend class WebGLCompressedTextureASTC; > friend class WebGLCompressedTextureATC; > friend class WebGLCompressedTexturePVRTC; > friend class WebGLCompressedTextureS3TC; >@@ -591,6 +593,7 @@ protected: > std::unique_ptr<WebGLLoseContext> m_webglLoseContext; > std::unique_ptr<WebGLDebugRendererInfo> m_webglDebugRendererInfo; > std::unique_ptr<WebGLDebugShaders> m_webglDebugShaders; >+ std::unique_ptr<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; > std::unique_ptr<WebGLCompressedTextureATC> m_webglCompressedTextureATC; > std::unique_ptr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; > std::unique_ptr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; >diff --git a/Source/WebCore/platform/graphics/Extensions3D.h b/Source/WebCore/platform/graphics/Extensions3D.h >index 0048fe89faba2abf73ba86a84064a6b73811ffde..eb4613726fa9c755569d59297837342462bb356d 100644 >--- a/Source/WebCore/platform/graphics/Extensions3D.h >+++ b/Source/WebCore/platform/graphics/Extensions3D.h >@@ -70,6 +70,8 @@ public: > // GL_EXT_texture_compression_s3tc > // GL_OES_compressed_ETC1_RGB8_texture > // GL_IMG_texture_compression_pvrtc >+ // GL_KHR_texture_compression_astc_hdr >+ // GL_KHR_texture_compression_astc_ldr > // EXT_texture_filter_anisotropic > // GL_EXT_debug_marker > // GL_ARB_draw_buffers / GL_EXT_draw_buffers >@@ -165,6 +167,37 @@ public: > COMPRESSED_ATC_RGB_AMD = 0x8C92, > COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93, > COMPRESSED_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE, >+ >+ // GL_KHR_texture_compression_astc_hdr >+ COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0, >+ COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1, >+ COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2, >+ COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3, >+ COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4, >+ COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5, >+ COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6, >+ COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7, >+ COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8, >+ COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9, >+ COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA, >+ COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB, >+ COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC, >+ COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD, >+ >+ COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC, >+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD, > > // GL_EXT_texture_filter_anisotropic > TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185272
:
339500
|
339503
|
339545
|
339607
|
339698
|
339777
|
339901
|
339905
|
339910
|
340005