Please support WEBGL_compressed_texture_etc1 extension (and possibly WEBGL_compressed...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2019 01:38:26 +0000 (01:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2019 01:38:26 +0000 (01:38 +0000)
commit2e1934dedac3dd150e839acb6ed8c9c739c7dca6
tree9c665de8955e90b2190cb5051a3352028db67863
parentc49ba63844f859de6afe3105641f16c3c34fdb97
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 <kbr@chromium.org> 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources-output.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp
Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
Source/WebCore/html/canvas/WebGLCompressedTextureETC.cpp [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLCompressedTextureETC.h [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLCompressedTextureETC.idl [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLCompressedTextureETC1.cpp [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLCompressedTextureETC1.h [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLCompressedTextureETC1.idl [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLExtension.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Source/WebCore/platform/graphics/Extensions3D.h
Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp