Title: [252226] trunk/Source/WebCore
Revision
252226
Author
[email protected]
Date
2019-11-07 17:38:26 -0800 (Thu, 07 Nov 2019)

Log Message

Please support WEBGL_compressed_texture_etc1 extension (and possibly WEBGL_compressed_texture_etc too)
https://bugs.webkit.org/show_bug.cgi?id=197900

Patch by Kenneth Russell <[email protected]> on 2019-11-07
Reviewed by Dean Jackson.

Support the ETC1 and ETC2 compressed texture formats in WebKit's WebGL
implementation.

Tested by changing the code to allocate an OpenGL ES 3.0 context for WebGL,
and running in the iOS Simulator. The WebGL conformance tests
webgl-compressed-texture-etc.html and webgl-compressed-texture-etc1.html all
pass with these changes.

When an ANGLE backend is supported on iOS, these extensions will
automatically be supported, and some of the new validation code can be
removed.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* 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/WebGLCompressedTextureETC.cpp: Added.
(WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
(WebCore::WebGLCompressedTextureETC::getName const):
(WebCore::WebGLCompressedTextureETC::supported):
* html/canvas/WebGLCompressedTextureETC.h: Added.
* html/canvas/WebGLCompressedTextureETC.idl: Added.
* html/canvas/WebGLCompressedTextureETC1.cpp: Added.
(WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
(WebCore::WebGLCompressedTextureETC1::getName const):
(WebCore::WebGLCompressedTextureETC1::supported):
* html/canvas/WebGLCompressedTextureETC1.h: Added.
* html/canvas/WebGLCompressedTextureETC1.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/Extensions3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (252225 => 252226)


--- trunk/Source/WebCore/CMakeLists.txt	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/CMakeLists.txt	2019-11-08 01:38:26 UTC (rev 252226)
@@ -1314,6 +1314,8 @@
         html/canvas/WebGLBuffer.cpp
         html/canvas/WebGLCompressedTextureASTC.cpp
         html/canvas/WebGLCompressedTextureATC.cpp
+        html/canvas/WebGLCompressedTextureETC.cpp
+        html/canvas/WebGLCompressedTextureETC1.cpp
         html/canvas/WebGLCompressedTexturePVRTC.cpp
         html/canvas/WebGLCompressedTextureS3TC.cpp
         html/canvas/WebGLContextEvent.cpp
@@ -1363,6 +1365,8 @@
         html/canvas/WebGLBuffer.idl
         html/canvas/WebGLCompressedTextureASTC.idl
         html/canvas/WebGLCompressedTextureATC.idl
+        html/canvas/WebGLCompressedTextureETC.idl
+        html/canvas/WebGLCompressedTextureETC1.idl
         html/canvas/WebGLCompressedTexturePVRTC.idl
         html/canvas/WebGLCompressedTextureS3TC.idl
         html/canvas/WebGLContextAttributes.idl

Modified: trunk/Source/WebCore/ChangeLog (252225 => 252226)


--- trunk/Source/WebCore/ChangeLog	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/ChangeLog	2019-11-08 01:38:26 UTC (rev 252226)
@@ -1,3 +1,61 @@
+2019-11-07  Kenneth Russell  <[email protected]>
+
+        Please support WEBGL_compressed_texture_etc1 extension (and possibly WEBGL_compressed_texture_etc too)
+        https://bugs.webkit.org/show_bug.cgi?id=197900
+
+        Reviewed by Dean Jackson.
+
+        Support the ETC1 and ETC2 compressed texture formats in WebKit's WebGL
+        implementation.
+
+        Tested by changing the code to allocate an OpenGL ES 3.0 context for WebGL,
+        and running in the iOS Simulator. The WebGL conformance tests
+        webgl-compressed-texture-etc.html and webgl-compressed-texture-etc1.html all
+        pass with these changes.
+
+        When an ANGLE backend is supported on iOS, these extensions will
+        automatically be supported, and some of the new validation code can be
+        removed.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * 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/WebGLCompressedTextureETC.cpp: Added.
+        (WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
+        (WebCore::WebGLCompressedTextureETC::getName const):
+        (WebCore::WebGLCompressedTextureETC::supported):
+        * html/canvas/WebGLCompressedTextureETC.h: Added.
+        * html/canvas/WebGLCompressedTextureETC.idl: Added.
+        * html/canvas/WebGLCompressedTextureETC1.cpp: Added.
+        (WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
+        (WebCore::WebGLCompressedTextureETC1::getName const):
+        (WebCore::WebGLCompressedTextureETC1::supported):
+        * html/canvas/WebGLCompressedTextureETC1.h: Added.
+        * html/canvas/WebGLCompressedTextureETC1.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/Extensions3D.h:
+        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::supportsExtension):
+
 2019-11-07  Ryosuke Niwa  <[email protected]>
 
         WindowEventLoop should be shared among similar origin documents

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (252225 => 252226)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-11-08 01:38:26 UTC (rev 252226)
@@ -825,6 +825,8 @@
 $(PROJECT_DIR)/html/canvas/WebGLBuffer.idl
 $(PROJECT_DIR)/html/canvas/WebGLCompressedTextureASTC.idl
 $(PROJECT_DIR)/html/canvas/WebGLCompressedTextureATC.idl
+$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureETC.idl
+$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureETC1.idl
 $(PROJECT_DIR)/html/canvas/WebGLCompressedTexturePVRTC.idl
 $(PROJECT_DIR)/html/canvas/WebGLCompressedTextureS3TC.idl
 $(PROJECT_DIR)/html/canvas/WebGLContextAttributes.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (252225 => 252226)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-11-08 01:38:26 UTC (rev 252226)
@@ -1927,6 +1927,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureASTC.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureATC.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureATC.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTexturePVRTC.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTexturePVRTC.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureS3TC.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (252225 => 252226)


--- trunk/Source/WebCore/DerivedSources.make	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/DerivedSources.make	2019-11-08 01:38:26 UTC (rev 252226)
@@ -829,6 +829,8 @@
     $(WebCore)/html/canvas/WebGLBuffer.idl \
     $(WebCore)/html/canvas/WebGLCompressedTextureASTC.idl \
     $(WebCore)/html/canvas/WebGLCompressedTextureATC.idl \
+    $(WebCore)/html/canvas/WebGLCompressedTextureETC.idl \
+    $(WebCore)/html/canvas/WebGLCompressedTextureETC1.idl \
     $(WebCore)/html/canvas/WebGLCompressedTexturePVRTC.idl \
     $(WebCore)/html/canvas/WebGLCompressedTextureS3TC.idl \
     $(WebCore)/html/canvas/WebGLContextAttributes.idl \

Modified: trunk/Source/WebCore/Sources.txt (252225 => 252226)


--- trunk/Source/WebCore/Sources.txt	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/Sources.txt	2019-11-08 01:38:26 UTC (rev 252226)
@@ -1287,6 +1287,8 @@
 html/canvas/WebGLBuffer.cpp
 html/canvas/WebGLCompressedTextureASTC.cpp
 html/canvas/WebGLCompressedTextureATC.cpp
+html/canvas/WebGLCompressedTextureETC.cpp
+html/canvas/WebGLCompressedTextureETC1.cpp
 html/canvas/WebGLCompressedTexturePVRTC.cpp
 html/canvas/WebGLCompressedTextureS3TC.cpp
 html/canvas/WebGLContextEvent.cpp
@@ -3556,6 +3558,8 @@
 JSWebGLBuffer.cpp
 JSWebGLCompressedTextureASTC.cpp
 JSWebGLCompressedTextureATC.cpp
+JSWebGLCompressedTextureETC.cpp
+JSWebGLCompressedTextureETC1.cpp
 JSWebGLCompressedTexturePVRTC.cpp
 JSWebGLCompressedTextureS3TC.cpp
 JSWebGLContextAttributes.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (252225 => 252226)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-11-08 01:38:26 UTC (rev 252226)
@@ -1987,8 +1987,11 @@
 		6C4C96DF1AD4483500365672 /* JSReadableStreamBYOBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500365672 /* JSReadableStreamBYOBRequest.h */; };
 		6C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6C638895A96CCEE50C8C946C /* CachedResourceRequestInitiators.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		6E0B90692321A68D006223B2 /* WebGLCompressedTextureETC1.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E0B90652321A68C006223B2 /* WebGLCompressedTextureETC1.h */; };
 		6E0E569C183BFFE600E0E8D5 /* FloatRoundedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E0E569A183BFFE600E0E8D5 /* FloatRoundedRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */; };
+		6E242B2B23359405002CADD4 /* JSWebGLCompressedTextureETC1.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E242B2A233593D8002CADD4 /* JSWebGLCompressedTextureETC1.h */; };
+		6E242B2C23359409002CADD4 /* JSWebGLCompressedTextureETC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E242B28233593D7002CADD4 /* JSWebGLCompressedTextureETC.h */; };
 		6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAD3714733F4000E42306 /* JSWebGLCompressedTextureS3TC.h */; };
 		6E3FAD3914733F4000E42307 /* JSWebGLDepthTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAD3714733F4000E42307 /* JSWebGLDepthTexture.h */; };
 		6E3FAD3914733F4011E42307 /* JSWebGLDebugRendererInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAD3714733F4011E42307 /* JSWebGLDebugRendererInfo.h */; };
@@ -2006,6 +2009,7 @@
 		6E72F550229DCD1700B3E151 /* Extensions3DANGLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E27F244229C9F8D00F1F632 /* Extensions3DANGLE.h */; };
 		6E72F551229DCD1A00B3E151 /* TemporaryANGLESetting.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E290863229DB970000986E2 /* TemporaryANGLESetting.h */; };
 		6E84E9E117668BF100815B68 /* RasterShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E84E9DF17668BAD00815B68 /* RasterShape.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		6E8ACDED23345CBC0024AAF5 /* WebGLCompressedTextureETC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E8ACDEB23345CAF0024AAF5 /* WebGLCompressedTextureETC.h */; };
 		6EBF0E4912A8926100DB1709 /* OESTextureFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */; };
 		6EBF0E5512A8929800DB1709 /* WebGLExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E5312A8929800DB1709 /* WebGLExtension.h */; };
 		6EBF0E7712A9868800DB1709 /* JSOESTextureFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E7512A9868800DB1709 /* JSOESTextureFloat.h */; };
@@ -9170,10 +9174,17 @@
 		6C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamDefaultController.h; sourceTree = "<group>"; };
 		6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceRequestInitiators.h; sourceTree = "<group>"; };
 		6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceRequestInitiators.cpp; sourceTree = "<group>"; };
+		6E0B90652321A68C006223B2 /* WebGLCompressedTextureETC1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureETC1.h; sourceTree = "<group>"; };
+		6E0B90672321A68C006223B2 /* WebGLCompressedTextureETC1.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLCompressedTextureETC1.idl; sourceTree = "<group>"; };
+		6E0B90682321A68D006223B2 /* WebGLCompressedTextureETC1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureETC1.cpp; sourceTree = "<group>"; };
 		6E0E5699183BFFE600E0E8D5 /* FloatRoundedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatRoundedRect.cpp; sourceTree = "<group>"; };
 		6E0E569A183BFFE600E0E8D5 /* FloatRoundedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatRoundedRect.h; sourceTree = "<group>"; };
 		6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3D.cpp; sourceTree = "<group>"; };
 		6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
+		6E242B26233593D7002CADD4 /* JSWebGLCompressedTextureETC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebGLCompressedTextureETC.cpp; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC.cpp; sourceTree = "<group>"; };
+		6E242B28233593D7002CADD4 /* JSWebGLCompressedTextureETC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSWebGLCompressedTextureETC.h; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC.h; sourceTree = "<group>"; };
+		6E242B29233593D7002CADD4 /* JSWebGLCompressedTextureETC1.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebGLCompressedTextureETC1.cpp; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.cpp; sourceTree = "<group>"; };
+		6E242B2A233593D8002CADD4 /* JSWebGLCompressedTextureETC1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSWebGLCompressedTextureETC1.h; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.h; sourceTree = "<group>"; };
 		6E27F2422298CE4B00F1F632 /* GraphicsContext3DANGLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DANGLE.cpp; sourceTree = "<group>"; };
 		6E27F243229C9F8400F1F632 /* Extensions3DANGLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Extensions3DANGLE.cpp; sourceTree = "<group>"; };
 		6E27F244229C9F8D00F1F632 /* Extensions3DANGLE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Extensions3DANGLE.h; sourceTree = "<group>"; };
@@ -9203,6 +9214,9 @@
 		6E67D2A81280E8BD008758F7 /* Extensions3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Extensions3D.h; sourceTree = "<group>"; };
 		6E84E9DE17668BAD00815B68 /* RasterShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RasterShape.cpp; sourceTree = "<group>"; };
 		6E84E9DF17668BAD00815B68 /* RasterShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RasterShape.h; sourceTree = "<group>"; };
+		6E8ACDE923345CAF0024AAF5 /* WebGLCompressedTextureETC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureETC.cpp; sourceTree = "<group>"; };
+		6E8ACDEB23345CAF0024AAF5 /* WebGLCompressedTextureETC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureETC.h; sourceTree = "<group>"; };
+		6E8ACDEC23345CB00024AAF5 /* WebGLCompressedTextureETC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureETC.idl; sourceTree = "<group>"; };
 		6EBF0E4512A8926100DB1709 /* OESTextureFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESTextureFloat.cpp; sourceTree = "<group>"; };
 		6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OESTextureFloat.h; sourceTree = "<group>"; };
 		6EBF0E4712A8926100DB1709 /* OESTextureFloat.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OESTextureFloat.idl; sourceTree = "<group>"; };
@@ -18453,6 +18467,12 @@
 				7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */,
 				7E66E23216D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h */,
 				7EA30F6216DFD62700257D0B /* WebGLCompressedTextureATC.idl */,
+				6E8ACDE923345CAF0024AAF5 /* WebGLCompressedTextureETC.cpp */,
+				6E8ACDEB23345CAF0024AAF5 /* WebGLCompressedTextureETC.h */,
+				6E8ACDEC23345CB00024AAF5 /* WebGLCompressedTextureETC.idl */,
+				6E0B90682321A68D006223B2 /* WebGLCompressedTextureETC1.cpp */,
+				6E0B90652321A68C006223B2 /* WebGLCompressedTextureETC1.h */,
+				6E0B90672321A68C006223B2 /* WebGLCompressedTextureETC1.idl */,
 				7E66E23117E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.cpp */,
 				7E66E23217E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h */,
 				7EA30F6217EFD62700257D0B /* WebGLCompressedTexturePVRTC.idl */,
@@ -23259,6 +23279,10 @@
 				49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */,
 				7EA30F6716DFFE7500257D0B /* JSWebGLCompressedTextureATC.cpp */,
 				7EA30F6816DFFE7500257D0B /* JSWebGLCompressedTextureATC.h */,
+				6E242B26233593D7002CADD4 /* JSWebGLCompressedTextureETC.cpp */,
+				6E242B28233593D7002CADD4 /* JSWebGLCompressedTextureETC.h */,
+				6E242B29233593D7002CADD4 /* JSWebGLCompressedTextureETC1.cpp */,
+				6E242B2A233593D8002CADD4 /* JSWebGLCompressedTextureETC1.h */,
 				7EA30F6717EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.cpp */,
 				7EA30F6817EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.h */,
 				6E3FAD3614733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp */,
@@ -30971,6 +30995,8 @@
 				A7D20F63107F406900A80392 /* JSWebGLActiveInfo.h in Headers */,
 				49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */,
 				7EA30F6A16DFFE7500257D0B /* JSWebGLCompressedTextureATC.h in Headers */,
+				6E242B2C23359409002CADD4 /* JSWebGLCompressedTextureETC.h in Headers */,
+				6E242B2B23359405002CADD4 /* JSWebGLCompressedTextureETC1.h in Headers */,
 				7EA30F6A17EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.h in Headers */,
 				6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */,
 				6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */,
@@ -32696,6 +32722,8 @@
 				49C7B9C91042D32F0009D447 /* WebGLBuffer.h in Headers */,
 				D08B00E420A282590004BC0A /* WebGLCompressedTextureASTC.h in Headers */,
 				7E66E23416D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h in Headers */,
+				6E8ACDED23345CBC0024AAF5 /* WebGLCompressedTextureETC.h in Headers */,
+				6E0B90692321A68D006223B2 /* WebGLCompressedTextureETC1.h in Headers */,
 				7E66E23417E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h in Headers */,
 				6E3FAE8F14733FDB00E42306 /* WebGLCompressedTextureS3TC.h in Headers */,
 				6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */,

Modified: trunk/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp (252225 => 252226)


--- trunk/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -45,6 +45,8 @@
 #include "JSWebGLBuffer.h"
 #include "JSWebGLCompressedTextureASTC.h"
 #include "JSWebGLCompressedTextureATC.h"
+#include "JSWebGLCompressedTextureETC.h"
+#include "JSWebGLCompressedTextureETC1.h"
 #include "JSWebGLCompressedTexturePVRTC.h"
 #include "JSWebGLCompressedTextureS3TC.h"
 #include "JSWebGLDebugRendererInfo.h"
@@ -176,6 +178,10 @@
         return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLDebugShaders&>(extension));
     case WebGLExtension::WebGLCompressedTextureATCName:
         return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureATC&>(extension));
+    case WebGLExtension::WebGLCompressedTextureETCName:
+        return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureETC&>(extension));
+    case WebGLExtension::WebGLCompressedTextureETC1Name:
+        return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureETC1&>(extension));
     case WebGLExtension::WebGLCompressedTexturePVRTCName:
         return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTexturePVRTC&>(extension));
     case WebGLExtension::WebGLCompressedTextureS3TCName:

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (252225 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -45,6 +45,8 @@
 #include "WebGLActiveInfo.h"
 #include "WebGLCompressedTextureASTC.h"
 #include "WebGLCompressedTextureATC.h"
+#include "WebGLCompressedTextureETC.h"
+#include "WebGLCompressedTextureETC1.h"
 #include "WebGLCompressedTexturePVRTC.h"
 #include "WebGLCompressedTextureS3TC.h"
 #include "WebGLDebugRendererInfo.h"
@@ -1373,10 +1375,12 @@
     ENABLE_IF_REQUESTED(OESTextureHalfFloat, m_oesTextureHalfFloat, "OES_texture_half_float", enableSupportedExtension("GL_OES_texture_half_float"_s));
     ENABLE_IF_REQUESTED(OESTextureHalfFloatLinear, m_oesTextureHalfFloatLinear, "OES_texture_half_float_linear", enableSupportedExtension("GL_OES_texture_half_float_linear"_s));
     ENABLE_IF_REQUESTED(WebGLLoseContext, m_webglLoseContext, "WEBGL_lose_context", true);
+    ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
     ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::supported(*this));
+    ENABLE_IF_REQUESTED(WebGLCompressedTextureETC, m_webglCompressedTextureETC, "WEBGL_compressed_texture_etc", WebGLCompressedTextureETC::supported(*this));
+    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(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("GL_ANGLE_translated_shader_source"_s));
@@ -1404,14 +1408,18 @@
         result.append("OES_texture_half_float_linear"_s);
     if (extensions.supports("GL_EXT_texture_filter_anisotropic"_s))
         result.append("WEBKIT_EXT_texture_filter_anisotropic"_s);
+    if (WebGLCompressedTextureASTC::supported(*this))
+        result.append("WEBGL_compressed_texture_astc"_s);
     if (WebGLCompressedTextureATC::supported(*this))
         result.append("WEBKIT_WEBGL_compressed_texture_atc"_s);
+    if (WebGLCompressedTextureETC::supported(*this))
+        result.append("WEBGL_compressed_texture_etc"_s);
+    if (WebGLCompressedTextureETC1::supported(*this))
+        result.append("WEBGL_compressed_texture_etc1"_s);
     if (WebGLCompressedTexturePVRTC::supported(*this))
         result.append("WEBKIT_WEBGL_compressed_texture_pvrtc"_s);
     if (WebGLCompressedTextureS3TC::supported(*this))
         result.append("WEBGL_compressed_texture_s3tc"_s);
-    if (WebGLCompressedTextureASTC::supported(*this))
-        result.append("WEBGL_compressed_texture_astc"_s);
     if (WebGLDepthTexture::supported(*graphicsContext3D()))
         result.append("WEBGL_depth_texture"_s);
     result.append("WEBGL_lose_context"_s);

Added: trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.cpp (0 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.cpp	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2019 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 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 "WebGLCompressedTextureETC.h"
+
+#include "Extensions3D.h"
+#include "WebGLRenderingContextBase.h"
+
+namespace WebCore {
+
+WebGLCompressedTextureETC::WebGLCompressedTextureETC(WebGLRenderingContextBase& context)
+    : WebGLExtension(context)
+{
+    context.graphicsContext3D()->getExtensions().ensureEnabled("GL_ANGLE_compressed_texture_etc");
+
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_R11_EAC);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SIGNED_R11_EAC);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RG11_EAC);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SIGNED_RG11_EAC);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGB8_ETC2);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ETC2);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA8_ETC2_EAC);
+    context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC);
+}
+
+WebGLCompressedTextureETC::~WebGLCompressedTextureETC() = default;
+
+WebGLExtension::ExtensionName WebGLCompressedTextureETC::getName() const
+{
+    return WebGLCompressedTextureETCName;
+}
+
+bool WebGLCompressedTextureETC::supported(WebGLRenderingContextBase& context)
+{
+    return context.graphicsContext3D()->getExtensions().supports("GL_ANGLE_compressed_texture_etc");
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)

Added: trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.h (0 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.h	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.h	2019-11-08 01:38:26 UTC (rev 252226)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 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 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
+
+#if ENABLE(WEBGL)
+
+#include "WebGLExtension.h"
+
+namespace WebCore {
+
+class WebGLCompressedTextureETC final : public WebGLExtension {
+public:
+    explicit WebGLCompressedTextureETC(WebGLRenderingContextBase&);
+    virtual ~WebGLCompressedTextureETC();
+
+    static bool supported(WebGLRenderingContextBase&);
+    ExtensionName getName() const override;
+};
+
+} // namespace WebCore
+
+#endif

Added: trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.idl (0 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.idl	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC.idl	2019-11-08 01:38:26 UTC (rev 252226)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 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 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.
+ */
+
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/
+
+[
+    Conditional=WEBGL,
+    DoNotCheckConstants,
+    GenerateIsReachable=ImplWebGLRenderingContext,
+    NoInterfaceObject,
+] interface WebGLCompressedTextureETC {
+    /* Compressed Texture Format */
+    const unsigned long COMPRESSED_R11_EAC                        = 0x9270;
+    const unsigned long COMPRESSED_SIGNED_R11_EAC                 = 0x9271;
+    const unsigned long COMPRESSED_RG11_EAC                       = 0x9272;
+    const unsigned long COMPRESSED_SIGNED_RG11_EAC                = 0x9273;
+    const unsigned long COMPRESSED_RGB8_ETC2                      = 0x9274;
+    const unsigned long COMPRESSED_SRGB8_ETC2                     = 0x9275;
+    const unsigned long COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2  = 0x9276;
+    const unsigned long COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
+    const unsigned long COMPRESSED_RGBA8_ETC2_EAC                 = 0x9278;
+    const unsigned long COMPRESSED_SRGB8_ALPHA8_ETC2_EAC          = 0x9279;
+};

Added: trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.cpp (0 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.cpp	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2019 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 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 "WebGLCompressedTextureETC1.h"
+
+#include "Extensions3D.h"
+#include "WebGLRenderingContextBase.h"
+
+namespace WebCore {
+
+WebGLCompressedTextureETC1::WebGLCompressedTextureETC1(WebGLRenderingContextBase& context)
+    : WebGLExtension(context)
+{
+    context.graphicsContext3D()->getExtensions().ensureEnabled("GL_OES_compressed_ETC1_RGB8_texture");
+
+    context.addCompressedTextureFormat(Extensions3D::ETC1_RGB8_OES);
+}
+
+WebGLCompressedTextureETC1::~WebGLCompressedTextureETC1() = default;
+
+WebGLExtension::ExtensionName WebGLCompressedTextureETC1::getName() const
+{
+    return WebGLCompressedTextureETC1Name;
+}
+
+bool WebGLCompressedTextureETC1::supported(WebGLRenderingContextBase& context)
+{
+    return context.graphicsContext3D()->getExtensions().supports("GL_OES_compressed_ETC1_RGB8_texture");
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)

Added: trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.h (0 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.h	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.h	2019-11-08 01:38:26 UTC (rev 252226)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 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 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
+
+#if ENABLE(WEBGL)
+
+#include "WebGLExtension.h"
+
+namespace WebCore {
+
+class WebGLCompressedTextureETC1 final : public WebGLExtension {
+public:
+    explicit WebGLCompressedTextureETC1(WebGLRenderingContextBase&);
+    virtual ~WebGLCompressedTextureETC1();
+
+    static bool supported(WebGLRenderingContextBase&);
+    ExtensionName getName() const override;
+};
+
+} // namespace WebCore
+
+#endif

Added: trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.idl (0 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.idl	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLCompressedTextureETC1.idl	2019-11-08 01:38:26 UTC (rev 252226)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2019 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 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.
+ */
+
+// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/
+
+[
+    Conditional=WEBGL,
+    DoNotCheckConstants,
+    GenerateIsReachable=ImplWebGLRenderingContext,
+    NoInterfaceObject,
+] interface WebGLCompressedTextureETC1 {
+    /* Compressed Texture Formats */
+    const unsigned long COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
+};

Modified: trunk/Source/WebCore/html/canvas/WebGLExtension.h (252225 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLExtension.h	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/html/canvas/WebGLExtension.h	2019-11-08 01:38:26 UTC (rev 252226)
@@ -55,6 +55,8 @@
         WebGLDrawBuffersName,
         OESElementIndexUintName,
         WebGLCompressedTextureATCName,
+        WebGLCompressedTextureETCName,
+        WebGLCompressedTextureETC1Name,
         WebGLCompressedTexturePVRTCName,
         WebGLCompressedTextureASTCName,
         ANGLEInstancedArraysName,

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (252225 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -51,6 +51,8 @@
 #include "RenderBox.h"
 #include "WebGLCompressedTextureASTC.h"
 #include "WebGLCompressedTextureATC.h"
+#include "WebGLCompressedTextureETC.h"
+#include "WebGLCompressedTextureETC1.h"
 #include "WebGLCompressedTexturePVRTC.h"
 #include "WebGLCompressedTextureS3TC.h"
 #include "WebGLDebugRendererInfo.h"
@@ -148,10 +150,12 @@
     ENABLE_IF_REQUESTED(OESVertexArrayObject, m_oesVertexArrayObject, "OES_vertex_array_object", enableSupportedExtension("GL_OES_vertex_array_object"_s));
     ENABLE_IF_REQUESTED(OESElementIndexUint, m_oesElementIndexUint, "OES_element_index_uint", enableSupportedExtension("GL_OES_element_index_uint"_s));
     ENABLE_IF_REQUESTED(WebGLLoseContext, m_webglLoseContext, "WEBGL_lose_context", true);
+    ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
     ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::supported(*this));
+    ENABLE_IF_REQUESTED(WebGLCompressedTextureETC, m_webglCompressedTextureETC, "WEBGL_compressed_texture_etc", WebGLCompressedTextureETC::supported(*this));
+    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(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,14 +221,18 @@
     if (m_context->getExtensions().supports("GL_OES_element_index_uint"_s))
         result.append("OES_element_index_uint"_s);
     result.append("WEBGL_lose_context"_s);
+    if (WebGLCompressedTextureASTC::supported(*this))
+        result.append("WEBGL_compressed_texture_astc"_s);
     if (WebGLCompressedTextureATC::supported(*this))
         result.append("WEBKIT_WEBGL_compressed_texture_atc"_s);
+    if (WebGLCompressedTextureETC::supported(*this))
+        result.append("WEBGL_compressed_texture_etc"_s);
+    if (WebGLCompressedTextureETC1::supported(*this))
+        result.append("WEBGL_compressed_texture_etc1"_s);
     if (WebGLCompressedTexturePVRTC::supported(*this))
         result.append("WEBKIT_WEBGL_compressed_texture_pvrtc"_s);
     if (WebGLCompressedTextureS3TC::supported(*this))
         result.append("WEBGL_compressed_texture_s3tc"_s);
-    if (WebGLCompressedTextureASTC::supported(*this))
-        result.append("WEBGL_compressed_texture_astc"_s);
     if (WebGLDepthTexture::supported(*m_context))
         result.append("WEBGL_depth_texture"_s);
     if (supportsDrawBuffers())

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (252225 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -3091,7 +3091,10 @@
     CHECK_EXTENSION(m_webglLoseContext, "WEBGL_lose_context");
     CHECK_EXTENSION(m_webglDebugRendererInfo, "WEBGL_debug_renderer_info");
     CHECK_EXTENSION(m_webglDebugShaders, "WEBGL_debug_shaders");
+    CHECK_EXTENSION(m_webglCompressedTextureASTC, "WEBKIT_WEBGL_compressed_texture_astc");
     CHECK_EXTENSION(m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc");
+    CHECK_EXTENSION(m_webglCompressedTextureETC, "WEBKIT_WEBGL_compressed_texture_etc");
+    CHECK_EXTENSION(m_webglCompressedTextureETC1, "WEBKIT_WEBGL_compressed_texture_etc1");
     CHECK_EXTENSION(m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc");
     CHECK_EXTENSION(m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc");
     CHECK_EXTENSION(m_webglDepthTexture, "WEBGL_depth_texture");
@@ -5562,19 +5565,21 @@
     const GC3Denum ASTCEnumStartRGBA = Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR;
     const GC3Denum ASTCEnumStartSRGB8 = Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
 
+    const int kEACAndETC2BlockSize = 4;
+
     switch (format) {
     case Extensions3D::COMPRESSED_RGB_S3TC_DXT1_EXT:
     case Extensions3D::COMPRESSED_RGBA_S3TC_DXT1_EXT:
     case Extensions3D::COMPRESSED_ATC_RGB_AMD:
-        {
-            const int kBlockSize = 8;
-            const int kBlockWidth = 4;
-            const int kBlockHeight = 4;
-            int numBlocksAcross = (width + kBlockWidth - 1) / kBlockWidth;
-            int numBlocksDown = (height + kBlockHeight - 1) / kBlockHeight;
-            bytesRequired = numBlocksAcross * numBlocksDown * kBlockSize;
-        }
+    case Extensions3D::ETC1_RGB8_OES: {
+        const int kBlockSize = 8;
+        const int kBlockWidth = 4;
+        const int kBlockHeight = 4;
+        int numBlocksAcross = (width + kBlockWidth - 1) / kBlockWidth;
+        int numBlocksDown = (height + kBlockHeight - 1) / kBlockHeight;
+        bytesRequired = numBlocksAcross * numBlocksDown * kBlockSize;
         break;
+    }
     case Extensions3D::COMPRESSED_RGBA_S3TC_DXT3_EXT:
     case Extensions3D::COMPRESSED_RGBA_S3TC_DXT5_EXT:
     case Extensions3D::COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD:
@@ -5638,6 +5643,36 @@
     case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
         bytesRequired = calculateBytesForASTC(width, height, ASTCParameters[format - ASTCEnumStartSRGB8]);
         break;
+    case Extensions3D::COMPRESSED_R11_EAC:
+    case Extensions3D::COMPRESSED_SIGNED_R11_EAC:
+    case Extensions3D::COMPRESSED_RGB8_ETC2:
+    case Extensions3D::COMPRESSED_SRGB8_ETC2:
+    case Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+    case Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: {
+        Checked<unsigned, RecordOverflow> checkedBytesRequired = (width + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
+        checkedBytesRequired *= (height + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
+        checkedBytesRequired *= 8;
+        if (checkedBytesRequired.hasOverflowed()) {
+            synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "too large dimensions");
+            return false;
+        }
+        bytesRequired = checkedBytesRequired.unsafeGet();
+        break;
+    }
+    case Extensions3D::COMPRESSED_RG11_EAC:
+    case Extensions3D::COMPRESSED_SIGNED_RG11_EAC:
+    case Extensions3D::COMPRESSED_RGBA8_ETC2_EAC:
+    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: {
+        Checked<unsigned, RecordOverflow> checkedBytesRequired = (width + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
+        checkedBytesRequired *= (height + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
+        checkedBytesRequired *= 16;
+        if (checkedBytesRequired.hasOverflowed()) {
+            synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "too large dimensions");
+            return false;
+        }
+        bytesRequired = checkedBytesRequired.unsafeGet();
+        break;
+    }
     default:
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid format");
         return false;
@@ -5708,7 +5743,18 @@
     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.
+    case Extensions3D::ETC1_RGB8_OES:
+    case Extensions3D::COMPRESSED_R11_EAC:
+    case Extensions3D::COMPRESSED_SIGNED_R11_EAC:
+    case Extensions3D::COMPRESSED_RG11_EAC:
+    case Extensions3D::COMPRESSED_SIGNED_RG11_EAC:
+    case Extensions3D::COMPRESSED_RGB8_ETC2:
+    case Extensions3D::COMPRESSED_SRGB8_ETC2:
+    case Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+    case Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+    case Extensions3D::COMPRESSED_RGBA8_ETC2_EAC:
+    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
+        // No height and width restrictions on ASTC, ETC1 or ETC2.
         return true;
     default:
         return false;
@@ -5756,6 +5802,34 @@
         }
         return validateCompressedTexDimensions(functionName, target, level, width, height, format);
     }
+    case Extensions3D::ETC1_RGB8_OES:
+        // Not supported for ETC1_RGB8_OES textures.
+        return false;
+    case Extensions3D::COMPRESSED_R11_EAC:
+    case Extensions3D::COMPRESSED_SIGNED_R11_EAC:
+    case Extensions3D::COMPRESSED_RG11_EAC:
+    case Extensions3D::COMPRESSED_SIGNED_RG11_EAC:
+    case Extensions3D::COMPRESSED_RGB8_ETC2:
+    case Extensions3D::COMPRESSED_SRGB8_ETC2:
+    case Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+    case Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+    case Extensions3D::COMPRESSED_RGBA8_ETC2_EAC:
+    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: {
+        if (target == GraphicsContext3D::TEXTURE_3D) {
+            synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "not supported on TEXTURE_3D textures");
+            return false;
+        }
+        const int kBlockSize = 4;
+        int texWidth = tex->getWidth(target, level);
+        int texHeight = tex->getHeight(target, level);
+        if ((xoffset % kBlockSize) || (yoffset % kBlockSize)
+            || ((width % kBlockSize) && xoffset + width != texWidth)
+            || ((height % kBlockSize) && yoffset + height != texHeight)) {
+            synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "dimensions must match existing texture level dimensions");
+            return false;
+        }
+        return true;
+    }
     default:
         return false;
     }

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (252225 => 252226)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h	2019-11-08 01:38:26 UTC (rev 252226)
@@ -77,6 +77,8 @@
 class WebGLContextObject;
 class WebGLCompressedTextureASTC;
 class WebGLCompressedTextureATC;
+class WebGLCompressedTextureETC;
+class WebGLCompressedTextureETC1;
 class WebGLCompressedTexturePVRTC;
 class WebGLCompressedTextureS3TC;
 class WebGLDebugRendererInfo;
@@ -385,6 +387,8 @@
     friend class WebGLDebugShaders;
     friend class WebGLCompressedTextureASTC;
     friend class WebGLCompressedTextureATC;
+    friend class WebGLCompressedTextureETC;
+    friend class WebGLCompressedTextureETC1;
     friend class WebGLCompressedTexturePVRTC;
     friend class WebGLCompressedTextureS3TC;
     friend class WebGLRenderingContextErrorMessageCallback;
@@ -613,6 +617,8 @@
     std::unique_ptr<WebGLDebugShaders> m_webglDebugShaders;
     std::unique_ptr<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC;
     std::unique_ptr<WebGLCompressedTextureATC> m_webglCompressedTextureATC;
+    std::unique_ptr<WebGLCompressedTextureETC> m_webglCompressedTextureETC;
+    std::unique_ptr<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1;
     std::unique_ptr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
     std::unique_ptr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;
     std::unique_ptr<WebGLDepthTexture> m_webglDepthTexture;

Modified: trunk/Source/WebCore/platform/graphics/Extensions3D.h (252225 => 252226)


--- trunk/Source/WebCore/platform/graphics/Extensions3D.h	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/platform/graphics/Extensions3D.h	2019-11-08 01:38:26 UTC (rev 252226)
@@ -158,6 +158,18 @@
         // GL_OES_compressed_ETC1_RGB8_texture
         ETC1_RGB8_OES = 0x8D64,
 
+        // WEBGL_compressed_texture_etc
+        COMPRESSED_R11_EAC = 0x9270,
+        COMPRESSED_SIGNED_R11_EAC = 0x9271,
+        COMPRESSED_RG11_EAC = 0x9272,
+        COMPRESSED_SIGNED_RG11_EAC = 0x9273,
+        COMPRESSED_RGB8_ETC2 = 0x9274,
+        COMPRESSED_SRGB8_ETC2 = 0x9275,
+        COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276,
+        COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277,
+        COMPRESSED_RGBA8_ETC2_EAC = 0x9278,
+        COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279,
+
         // GL_IMG_texture_compression_pvrtc
         COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00,
         COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01,

Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm (252225 => 252226)


--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm	2019-11-08 01:38:26 UTC (rev 252226)
@@ -243,7 +243,7 @@
         attribs.append(static_cast<CGLPixelFormatAttribute>(4));
     }
 
-    if (attrs.isWebGL2) {
+    if (m_attrs.isWebGL2) {
         // FIXME: Instead of backing a WebGL2 GraphicsContext3D with a OpenGL 4 context, we should instead back it with ANGLE.
         // Use an OpenGL 4 context for now until the ANGLE backend is ready.
         attribs.append(kCGLPFAOpenGLProfile);
@@ -278,7 +278,7 @@
         return;
     }
 
-    m_isForWebGL2 = attrs.isWebGL2;
+    m_isForWebGL2 = m_attrs.isWebGL2;
 
     CGLSetCurrentContext(m_contextObj);
 
@@ -326,7 +326,7 @@
     }
 
     std::vector<EGLint> contextAttributes;
-    if (attrs.isWebGL2) {
+    if (m_attrs.isWebGL2) {
         contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
         contextAttributes.push_back(3);
     } else {

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (252225 => 252226)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp	2019-11-08 01:35:31 UTC (rev 252225)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp	2019-11-08 01:38:26 UTC (rev 252226)
@@ -227,9 +227,15 @@
 #endif
     }
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) || PLATFORM(IOS_FAMILY_SIMULATOR)
     if (name == "GL_EXT_packed_depth_stencil")
         return m_availableExtensions.contains("GL_OES_packed_depth_stencil");
+
+    if (name == "GL_OES_compressed_ETC1_RGB8_texture"
+        || name == "GL_ANGLE_compressed_texture_etc") {
+        // Implicitly enabled with ES 3.0 contexts.
+        return m_context->m_isForWebGL2;
+    }
 #endif
 
     return m_availableExtensions.contains(name);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to