Changeset 252226 in webkit


Ignore:
Timestamp:
Nov 7, 2019 5:38:26 PM (4 years ago)
Author:
commit-queue@webkit.org
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 <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):

Location:
trunk/Source/WebCore
Files:
6 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r252086 r252226  
    13151315        html/canvas/WebGLCompressedTextureASTC.cpp
    13161316        html/canvas/WebGLCompressedTextureATC.cpp
     1317        html/canvas/WebGLCompressedTextureETC.cpp
     1318        html/canvas/WebGLCompressedTextureETC1.cpp
    13171319        html/canvas/WebGLCompressedTexturePVRTC.cpp
    13181320        html/canvas/WebGLCompressedTextureS3TC.cpp
     
    13641366        html/canvas/WebGLCompressedTextureASTC.idl
    13651367        html/canvas/WebGLCompressedTextureATC.idl
     1368        html/canvas/WebGLCompressedTextureETC.idl
     1369        html/canvas/WebGLCompressedTextureETC1.idl
    13661370        html/canvas/WebGLCompressedTexturePVRTC.idl
    13671371        html/canvas/WebGLCompressedTextureS3TC.idl
  • trunk/Source/WebCore/ChangeLog

    r252221 r252226  
     12019-11-07  Kenneth Russell  <kbr@chromium.org>
     2
     3        Please support WEBGL_compressed_texture_etc1 extension (and possibly WEBGL_compressed_texture_etc too)
     4        https://bugs.webkit.org/show_bug.cgi?id=197900
     5
     6        Reviewed by Dean Jackson.
     7
     8        Support the ETC1 and ETC2 compressed texture formats in WebKit's WebGL
     9        implementation.
     10
     11        Tested by changing the code to allocate an OpenGL ES 3.0 context for WebGL,
     12        and running in the iOS Simulator. The WebGL conformance tests
     13        webgl-compressed-texture-etc.html and webgl-compressed-texture-etc1.html all
     14        pass with these changes.
     15
     16        When an ANGLE backend is supported on iOS, these extensions will
     17        automatically be supported, and some of the new validation code can be
     18        removed.
     19
     20        * CMakeLists.txt:
     21        * DerivedSources-input.xcfilelist:
     22        * DerivedSources-output.xcfilelist:
     23        * DerivedSources.make:
     24        * Sources.txt:
     25        * WebCore.xcodeproj/project.pbxproj:
     26        * bindings/js/JSDOMConvertWebGL.cpp:
     27        (WebCore::convertToJSValue):
     28        * html/canvas/WebGL2RenderingContext.cpp:
     29        (WebCore::WebGL2RenderingContext::getExtension):
     30        (WebCore::WebGL2RenderingContext::getSupportedExtensions):
     31        * html/canvas/WebGLCompressedTextureETC.cpp: Added.
     32        (WebCore::WebGLCompressedTextureETC::WebGLCompressedTextureETC):
     33        (WebCore::WebGLCompressedTextureETC::getName const):
     34        (WebCore::WebGLCompressedTextureETC::supported):
     35        * html/canvas/WebGLCompressedTextureETC.h: Added.
     36        * html/canvas/WebGLCompressedTextureETC.idl: Added.
     37        * html/canvas/WebGLCompressedTextureETC1.cpp: Added.
     38        (WebCore::WebGLCompressedTextureETC1::WebGLCompressedTextureETC1):
     39        (WebCore::WebGLCompressedTextureETC1::getName const):
     40        (WebCore::WebGLCompressedTextureETC1::supported):
     41        * html/canvas/WebGLCompressedTextureETC1.h: Added.
     42        * html/canvas/WebGLCompressedTextureETC1.idl: Added.
     43        * html/canvas/WebGLExtension.h:
     44        * html/canvas/WebGLRenderingContext.cpp:
     45        (WebCore::WebGLRenderingContext::getExtension):
     46        (WebCore::WebGLRenderingContext::getSupportedExtensions):
     47        * html/canvas/WebGLRenderingContextBase.cpp:
     48        (WebCore::WebGLRenderingContextBase::extensionIsEnabled):
     49        (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
     50        (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
     51        (WebCore::WebGLRenderingContextBase::validateCompressedTexSubDimensions):
     52        * html/canvas/WebGLRenderingContextBase.h:
     53        * platform/graphics/Extensions3D.h:
     54        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
     55        (WebCore::GraphicsContext3D::GraphicsContext3D):
     56        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
     57        (WebCore::Extensions3DOpenGL::supportsExtension):
     58
    1592019-11-07  Ryosuke Niwa  <rniwa@webkit.org>
    260
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r251737 r252226  
    826826$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureASTC.idl
    827827$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureATC.idl
     828$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureETC.idl
     829$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureETC1.idl
    828830$(PROJECT_DIR)/html/canvas/WebGLCompressedTexturePVRTC.idl
    829831$(PROJECT_DIR)/html/canvas/WebGLCompressedTextureS3TC.idl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r251864 r252226  
    19281928$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureATC.cpp
    19291929$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureATC.h
     1930$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC.cpp
     1931$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC.h
     1932$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.cpp
     1933$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.h
    19301934$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTexturePVRTC.cpp
    19311935$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGLCompressedTexturePVRTC.h
  • trunk/Source/WebCore/DerivedSources.make

    r251841 r252226  
    830830    $(WebCore)/html/canvas/WebGLCompressedTextureASTC.idl \
    831831    $(WebCore)/html/canvas/WebGLCompressedTextureATC.idl \
     832    $(WebCore)/html/canvas/WebGLCompressedTextureETC.idl \
     833    $(WebCore)/html/canvas/WebGLCompressedTextureETC1.idl \
    832834    $(WebCore)/html/canvas/WebGLCompressedTexturePVRTC.idl \
    833835    $(WebCore)/html/canvas/WebGLCompressedTextureS3TC.idl \
  • trunk/Source/WebCore/Sources.txt

    r252208 r252226  
    12881288html/canvas/WebGLCompressedTextureASTC.cpp
    12891289html/canvas/WebGLCompressedTextureATC.cpp
     1290html/canvas/WebGLCompressedTextureETC.cpp
     1291html/canvas/WebGLCompressedTextureETC1.cpp
    12901292html/canvas/WebGLCompressedTexturePVRTC.cpp
    12911293html/canvas/WebGLCompressedTextureS3TC.cpp
     
    35573559JSWebGLCompressedTextureASTC.cpp
    35583560JSWebGLCompressedTextureATC.cpp
     3561JSWebGLCompressedTextureETC.cpp
     3562JSWebGLCompressedTextureETC1.cpp
    35593563JSWebGLCompressedTexturePVRTC.cpp
    35603564JSWebGLCompressedTextureS3TC.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r252208 r252226  
    19881988                6C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19891989                6C638895A96CCEE50C8C946C /* CachedResourceRequestInitiators.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1990                6E0B90692321A68D006223B2 /* WebGLCompressedTextureETC1.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E0B90652321A68C006223B2 /* WebGLCompressedTextureETC1.h */; };
    19901991                6E0E569C183BFFE600E0E8D5 /* FloatRoundedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E0E569A183BFFE600E0E8D5 /* FloatRoundedRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19911992                6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */; };
     1993                6E242B2B23359405002CADD4 /* JSWebGLCompressedTextureETC1.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E242B2A233593D8002CADD4 /* JSWebGLCompressedTextureETC1.h */; };
     1994                6E242B2C23359409002CADD4 /* JSWebGLCompressedTextureETC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E242B28233593D7002CADD4 /* JSWebGLCompressedTextureETC.h */; };
    19921995                6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAD3714733F4000E42306 /* JSWebGLCompressedTextureS3TC.h */; };
    19931996                6E3FAD3914733F4000E42307 /* JSWebGLDepthTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAD3714733F4000E42307 /* JSWebGLDepthTexture.h */; };
     
    20072010                6E72F551229DCD1A00B3E151 /* TemporaryANGLESetting.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E290863229DB970000986E2 /* TemporaryANGLESetting.h */; };
    20082011                6E84E9E117668BF100815B68 /* RasterShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E84E9DF17668BAD00815B68 /* RasterShape.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2012                6E8ACDED23345CBC0024AAF5 /* WebGLCompressedTextureETC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E8ACDEB23345CAF0024AAF5 /* WebGLCompressedTextureETC.h */; };
    20092013                6EBF0E4912A8926100DB1709 /* OESTextureFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */; };
    20102014                6EBF0E5512A8929800DB1709 /* WebGLExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E5312A8929800DB1709 /* WebGLExtension.h */; };
     
    91719175                6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceRequestInitiators.h; sourceTree = "<group>"; };
    91729176                6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceRequestInitiators.cpp; sourceTree = "<group>"; };
     9177                6E0B90652321A68C006223B2 /* WebGLCompressedTextureETC1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureETC1.h; sourceTree = "<group>"; };
     9178                6E0B90672321A68C006223B2 /* WebGLCompressedTextureETC1.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLCompressedTextureETC1.idl; sourceTree = "<group>"; };
     9179                6E0B90682321A68D006223B2 /* WebGLCompressedTextureETC1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureETC1.cpp; sourceTree = "<group>"; };
    91739180                6E0E5699183BFFE600E0E8D5 /* FloatRoundedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatRoundedRect.cpp; sourceTree = "<group>"; };
    91749181                6E0E569A183BFFE600E0E8D5 /* FloatRoundedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatRoundedRect.h; sourceTree = "<group>"; };
    91759182                6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3D.cpp; sourceTree = "<group>"; };
    91769183                6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
     9184                6E242B26233593D7002CADD4 /* JSWebGLCompressedTextureETC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebGLCompressedTextureETC.cpp; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC.cpp; sourceTree = "<group>"; };
     9185                6E242B28233593D7002CADD4 /* JSWebGLCompressedTextureETC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSWebGLCompressedTextureETC.h; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC.h; sourceTree = "<group>"; };
     9186                6E242B29233593D7002CADD4 /* JSWebGLCompressedTextureETC1.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebGLCompressedTextureETC1.cpp; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.cpp; sourceTree = "<group>"; };
     9187                6E242B2A233593D8002CADD4 /* JSWebGLCompressedTextureETC1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSWebGLCompressedTextureETC1.h; path = ../../../../../../WebKitBuild/Debug/DerivedSources/WebCore/JSWebGLCompressedTextureETC1.h; sourceTree = "<group>"; };
    91779188                6E27F2422298CE4B00F1F632 /* GraphicsContext3DANGLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DANGLE.cpp; sourceTree = "<group>"; };
    91789189                6E27F243229C9F8400F1F632 /* Extensions3DANGLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Extensions3DANGLE.cpp; sourceTree = "<group>"; };
     
    92049215                6E84E9DE17668BAD00815B68 /* RasterShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RasterShape.cpp; sourceTree = "<group>"; };
    92059216                6E84E9DF17668BAD00815B68 /* RasterShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RasterShape.h; sourceTree = "<group>"; };
     9217                6E8ACDE923345CAF0024AAF5 /* WebGLCompressedTextureETC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureETC.cpp; sourceTree = "<group>"; };
     9218                6E8ACDEB23345CAF0024AAF5 /* WebGLCompressedTextureETC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureETC.h; sourceTree = "<group>"; };
     9219                6E8ACDEC23345CB00024AAF5 /* WebGLCompressedTextureETC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureETC.idl; sourceTree = "<group>"; };
    92069220                6EBF0E4512A8926100DB1709 /* OESTextureFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESTextureFloat.cpp; sourceTree = "<group>"; };
    92079221                6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OESTextureFloat.h; sourceTree = "<group>"; };
     
    1845418468                                7E66E23216D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h */,
    1845518469                                7EA30F6216DFD62700257D0B /* WebGLCompressedTextureATC.idl */,
     18470                                6E8ACDE923345CAF0024AAF5 /* WebGLCompressedTextureETC.cpp */,
     18471                                6E8ACDEB23345CAF0024AAF5 /* WebGLCompressedTextureETC.h */,
     18472                                6E8ACDEC23345CB00024AAF5 /* WebGLCompressedTextureETC.idl */,
     18473                                6E0B90682321A68D006223B2 /* WebGLCompressedTextureETC1.cpp */,
     18474                                6E0B90652321A68C006223B2 /* WebGLCompressedTextureETC1.h */,
     18475                                6E0B90672321A68C006223B2 /* WebGLCompressedTextureETC1.idl */,
    1845618476                                7E66E23117E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.cpp */,
    1845718477                                7E66E23217E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h */,
     
    2326023280                                7EA30F6716DFFE7500257D0B /* JSWebGLCompressedTextureATC.cpp */,
    2326123281                                7EA30F6816DFFE7500257D0B /* JSWebGLCompressedTextureATC.h */,
     23282                                6E242B26233593D7002CADD4 /* JSWebGLCompressedTextureETC.cpp */,
     23283                                6E242B28233593D7002CADD4 /* JSWebGLCompressedTextureETC.h */,
     23284                                6E242B29233593D7002CADD4 /* JSWebGLCompressedTextureETC1.cpp */,
     23285                                6E242B2A233593D8002CADD4 /* JSWebGLCompressedTextureETC1.h */,
    2326223286                                7EA30F6717EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.cpp */,
    2326323287                                7EA30F6817EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.h */,
     
    3097230996                                49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */,
    3097330997                                7EA30F6A16DFFE7500257D0B /* JSWebGLCompressedTextureATC.h in Headers */,
     30998                                6E242B2C23359409002CADD4 /* JSWebGLCompressedTextureETC.h in Headers */,
     30999                                6E242B2B23359405002CADD4 /* JSWebGLCompressedTextureETC1.h in Headers */,
    3097431000                                7EA30F6A17EFFE7500257D0B /* JSWebGLCompressedTexturePVRTC.h in Headers */,
    3097531001                                6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */,
     
    3269732723                                D08B00E420A282590004BC0A /* WebGLCompressedTextureASTC.h in Headers */,
    3269832724                                7E66E23416D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h in Headers */,
     32725                                6E8ACDED23345CBC0024AAF5 /* WebGLCompressedTextureETC.h in Headers */,
     32726                                6E0B90692321A68D006223B2 /* WebGLCompressedTextureETC1.h in Headers */,
    3269932727                                7E66E23417E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h in Headers */,
    3270032728                                6E3FAE8F14733FDB00E42306 /* WebGLCompressedTextureS3TC.h in Headers */,
  • trunk/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp

    r251425 r252226  
    4646#include "JSWebGLCompressedTextureASTC.h"
    4747#include "JSWebGLCompressedTextureATC.h"
     48#include "JSWebGLCompressedTextureETC.h"
     49#include "JSWebGLCompressedTextureETC1.h"
    4850#include "JSWebGLCompressedTexturePVRTC.h"
    4951#include "JSWebGLCompressedTextureS3TC.h"
     
    177179    case WebGLExtension::WebGLCompressedTextureATCName:
    178180        return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureATC&>(extension));
     181    case WebGLExtension::WebGLCompressedTextureETCName:
     182        return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureETC&>(extension));
     183    case WebGLExtension::WebGLCompressedTextureETC1Name:
     184        return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTextureETC1&>(extension));
    179185    case WebGLExtension::WebGLCompressedTexturePVRTCName:
    180186        return toJS(&lexicalGlobalObject, &globalObject, static_cast<WebGLCompressedTexturePVRTC&>(extension));
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r248846 r252226  
    4646#include "WebGLCompressedTextureASTC.h"
    4747#include "WebGLCompressedTextureATC.h"
     48#include "WebGLCompressedTextureETC.h"
     49#include "WebGLCompressedTextureETC1.h"
    4850#include "WebGLCompressedTexturePVRTC.h"
    4951#include "WebGLCompressedTextureS3TC.h"
     
    13741376    ENABLE_IF_REQUESTED(OESTextureHalfFloatLinear, m_oesTextureHalfFloatLinear, "OES_texture_half_float_linear", enableSupportedExtension("GL_OES_texture_half_float_linear"_s));
    13751377    ENABLE_IF_REQUESTED(WebGLLoseContext, m_webglLoseContext, "WEBGL_lose_context", true);
     1378    ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
    13761379    ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::supported(*this));
     1380    ENABLE_IF_REQUESTED(WebGLCompressedTextureETC, m_webglCompressedTextureETC, "WEBGL_compressed_texture_etc", WebGLCompressedTextureETC::supported(*this));
     1381    ENABLE_IF_REQUESTED(WebGLCompressedTextureETC1, m_webglCompressedTextureETC1, "WEBGL_compressed_texture_etc1", WebGLCompressedTextureETC1::supported(*this));
    13771382    ENABLE_IF_REQUESTED(WebGLCompressedTexturePVRTC, m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc", WebGLCompressedTexturePVRTC::supported(*this));
    13781383    ENABLE_IF_REQUESTED(WebGLCompressedTextureS3TC, m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc", WebGLCompressedTextureS3TC::supported(*this));
    1379     ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
    13801384    ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*graphicsContext3D()));
    13811385    ENABLE_IF_REQUESTED(WebGLDebugRendererInfo, m_webglDebugRendererInfo, "WEBGL_debug_renderer_info", true);
     
    14051409    if (extensions.supports("GL_EXT_texture_filter_anisotropic"_s))
    14061410        result.append("WEBKIT_EXT_texture_filter_anisotropic"_s);
     1411    if (WebGLCompressedTextureASTC::supported(*this))
     1412        result.append("WEBGL_compressed_texture_astc"_s);
    14071413    if (WebGLCompressedTextureATC::supported(*this))
    14081414        result.append("WEBKIT_WEBGL_compressed_texture_atc"_s);
     1415    if (WebGLCompressedTextureETC::supported(*this))
     1416        result.append("WEBGL_compressed_texture_etc"_s);
     1417    if (WebGLCompressedTextureETC1::supported(*this))
     1418        result.append("WEBGL_compressed_texture_etc1"_s);
    14091419    if (WebGLCompressedTexturePVRTC::supported(*this))
    14101420        result.append("WEBKIT_WEBGL_compressed_texture_pvrtc"_s);
    14111421    if (WebGLCompressedTextureS3TC::supported(*this))
    14121422        result.append("WEBGL_compressed_texture_s3tc"_s);
    1413     if (WebGLCompressedTextureASTC::supported(*this))
    1414         result.append("WEBGL_compressed_texture_astc"_s);
    14151423    if (WebGLDepthTexture::supported(*graphicsContext3D()))
    14161424        result.append("WEBGL_depth_texture"_s);
  • trunk/Source/WebCore/html/canvas/WebGLExtension.h

    r247452 r252226  
    5656        OESElementIndexUintName,
    5757        WebGLCompressedTextureATCName,
     58        WebGLCompressedTextureETCName,
     59        WebGLCompressedTextureETC1Name,
    5860        WebGLCompressedTexturePVRTCName,
    5961        WebGLCompressedTextureASTCName,
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r248846 r252226  
    5252#include "WebGLCompressedTextureASTC.h"
    5353#include "WebGLCompressedTextureATC.h"
     54#include "WebGLCompressedTextureETC.h"
     55#include "WebGLCompressedTextureETC1.h"
    5456#include "WebGLCompressedTexturePVRTC.h"
    5557#include "WebGLCompressedTextureS3TC.h"
     
    149151    ENABLE_IF_REQUESTED(OESElementIndexUint, m_oesElementIndexUint, "OES_element_index_uint", enableSupportedExtension("GL_OES_element_index_uint"_s));
    150152    ENABLE_IF_REQUESTED(WebGLLoseContext, m_webglLoseContext, "WEBGL_lose_context", true);
     153    ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
    151154    ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::supported(*this));
     155    ENABLE_IF_REQUESTED(WebGLCompressedTextureETC, m_webglCompressedTextureETC, "WEBGL_compressed_texture_etc", WebGLCompressedTextureETC::supported(*this));
     156    ENABLE_IF_REQUESTED(WebGLCompressedTextureETC1, m_webglCompressedTextureETC1, "WEBGL_compressed_texture_etc1", WebGLCompressedTextureETC1::supported(*this));
    152157    ENABLE_IF_REQUESTED(WebGLCompressedTexturePVRTC, m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc", WebGLCompressedTexturePVRTC::supported(*this));
    153158    ENABLE_IF_REQUESTED(WebGLCompressedTextureS3TC, m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc", WebGLCompressedTextureS3TC::supported(*this));
    154     ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
    155159    ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*m_context));
    156160    if (equalIgnoringASCIICase(name, "WEBGL_draw_buffers")) {
     
    218222        result.append("OES_element_index_uint"_s);
    219223    result.append("WEBGL_lose_context"_s);
     224    if (WebGLCompressedTextureASTC::supported(*this))
     225        result.append("WEBGL_compressed_texture_astc"_s);
    220226    if (WebGLCompressedTextureATC::supported(*this))
    221227        result.append("WEBKIT_WEBGL_compressed_texture_atc"_s);
     228    if (WebGLCompressedTextureETC::supported(*this))
     229        result.append("WEBGL_compressed_texture_etc"_s);
     230    if (WebGLCompressedTextureETC1::supported(*this))
     231        result.append("WEBGL_compressed_texture_etc1"_s);
    222232    if (WebGLCompressedTexturePVRTC::supported(*this))
    223233        result.append("WEBKIT_WEBGL_compressed_texture_pvrtc"_s);
    224234    if (WebGLCompressedTextureS3TC::supported(*this))
    225235        result.append("WEBGL_compressed_texture_s3tc"_s);
    226     if (WebGLCompressedTextureASTC::supported(*this))
    227         result.append("WEBGL_compressed_texture_astc"_s);
    228236    if (WebGLDepthTexture::supported(*m_context))
    229237        result.append("WEBGL_depth_texture"_s);
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r251630 r252226  
    30923092    CHECK_EXTENSION(m_webglDebugRendererInfo, "WEBGL_debug_renderer_info");
    30933093    CHECK_EXTENSION(m_webglDebugShaders, "WEBGL_debug_shaders");
     3094    CHECK_EXTENSION(m_webglCompressedTextureASTC, "WEBKIT_WEBGL_compressed_texture_astc");
    30943095    CHECK_EXTENSION(m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc");
     3096    CHECK_EXTENSION(m_webglCompressedTextureETC, "WEBKIT_WEBGL_compressed_texture_etc");
     3097    CHECK_EXTENSION(m_webglCompressedTextureETC1, "WEBKIT_WEBGL_compressed_texture_etc1");
    30953098    CHECK_EXTENSION(m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc");
    30963099    CHECK_EXTENSION(m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc");
     
    55635566    const GC3Denum ASTCEnumStartSRGB8 = Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
    55645567
     5568    const int kEACAndETC2BlockSize = 4;
     5569
    55655570    switch (format) {
    55665571    case Extensions3D::COMPRESSED_RGB_S3TC_DXT1_EXT:
    55675572    case Extensions3D::COMPRESSED_RGBA_S3TC_DXT1_EXT:
    55685573    case Extensions3D::COMPRESSED_ATC_RGB_AMD:
    5569         {
    5570             const int kBlockSize = 8;
    5571             const int kBlockWidth = 4;
    5572             const int kBlockHeight = 4;
    5573             int numBlocksAcross = (width + kBlockWidth - 1) / kBlockWidth;
    5574             int numBlocksDown = (height + kBlockHeight - 1) / kBlockHeight;
    5575             bytesRequired = numBlocksAcross * numBlocksDown * kBlockSize;
    5576         }
    5577         break;
     5574    case Extensions3D::ETC1_RGB8_OES: {
     5575        const int kBlockSize = 8;
     5576        const int kBlockWidth = 4;
     5577        const int kBlockHeight = 4;
     5578        int numBlocksAcross = (width + kBlockWidth - 1) / kBlockWidth;
     5579        int numBlocksDown = (height + kBlockHeight - 1) / kBlockHeight;
     5580        bytesRequired = numBlocksAcross * numBlocksDown * kBlockSize;
     5581        break;
     5582    }
    55785583    case Extensions3D::COMPRESSED_RGBA_S3TC_DXT3_EXT:
    55795584    case Extensions3D::COMPRESSED_RGBA_S3TC_DXT5_EXT:
     
    56395644        bytesRequired = calculateBytesForASTC(width, height, ASTCParameters[format - ASTCEnumStartSRGB8]);
    56405645        break;
     5646    case Extensions3D::COMPRESSED_R11_EAC:
     5647    case Extensions3D::COMPRESSED_SIGNED_R11_EAC:
     5648    case Extensions3D::COMPRESSED_RGB8_ETC2:
     5649    case Extensions3D::COMPRESSED_SRGB8_ETC2:
     5650    case Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
     5651    case Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: {
     5652        Checked<unsigned, RecordOverflow> checkedBytesRequired = (width + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
     5653        checkedBytesRequired *= (height + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
     5654        checkedBytesRequired *= 8;
     5655        if (checkedBytesRequired.hasOverflowed()) {
     5656            synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "too large dimensions");
     5657            return false;
     5658        }
     5659        bytesRequired = checkedBytesRequired.unsafeGet();
     5660        break;
     5661    }
     5662    case Extensions3D::COMPRESSED_RG11_EAC:
     5663    case Extensions3D::COMPRESSED_SIGNED_RG11_EAC:
     5664    case Extensions3D::COMPRESSED_RGBA8_ETC2_EAC:
     5665    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: {
     5666        Checked<unsigned, RecordOverflow> checkedBytesRequired = (width + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
     5667        checkedBytesRequired *= (height + kEACAndETC2BlockSize - 1) / kEACAndETC2BlockSize;
     5668        checkedBytesRequired *= 16;
     5669        if (checkedBytesRequired.hasOverflowed()) {
     5670            synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "too large dimensions");
     5671            return false;
     5672        }
     5673        bytesRequired = checkedBytesRequired.unsafeGet();
     5674        break;
     5675    }
    56415676    default:
    56425677        synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid format");
     
    57095744    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
    57105745    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
    5711         // No height and width restrictions on ASTC.
     5746    case Extensions3D::ETC1_RGB8_OES:
     5747    case Extensions3D::COMPRESSED_R11_EAC:
     5748    case Extensions3D::COMPRESSED_SIGNED_R11_EAC:
     5749    case Extensions3D::COMPRESSED_RG11_EAC:
     5750    case Extensions3D::COMPRESSED_SIGNED_RG11_EAC:
     5751    case Extensions3D::COMPRESSED_RGB8_ETC2:
     5752    case Extensions3D::COMPRESSED_SRGB8_ETC2:
     5753    case Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
     5754    case Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
     5755    case Extensions3D::COMPRESSED_RGBA8_ETC2_EAC:
     5756    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
     5757        // No height and width restrictions on ASTC, ETC1 or ETC2.
    57125758        return true;
    57135759    default:
     
    57565802        }
    57575803        return validateCompressedTexDimensions(functionName, target, level, width, height, format);
     5804    }
     5805    case Extensions3D::ETC1_RGB8_OES:
     5806        // Not supported for ETC1_RGB8_OES textures.
     5807        return false;
     5808    case Extensions3D::COMPRESSED_R11_EAC:
     5809    case Extensions3D::COMPRESSED_SIGNED_R11_EAC:
     5810    case Extensions3D::COMPRESSED_RG11_EAC:
     5811    case Extensions3D::COMPRESSED_SIGNED_RG11_EAC:
     5812    case Extensions3D::COMPRESSED_RGB8_ETC2:
     5813    case Extensions3D::COMPRESSED_SRGB8_ETC2:
     5814    case Extensions3D::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
     5815    case Extensions3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
     5816    case Extensions3D::COMPRESSED_RGBA8_ETC2_EAC:
     5817    case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: {
     5818        if (target == GraphicsContext3D::TEXTURE_3D) {
     5819            synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "not supported on TEXTURE_3D textures");
     5820            return false;
     5821        }
     5822        const int kBlockSize = 4;
     5823        int texWidth = tex->getWidth(target, level);
     5824        int texHeight = tex->getHeight(target, level);
     5825        if ((xoffset % kBlockSize) || (yoffset % kBlockSize)
     5826            || ((width % kBlockSize) && xoffset + width != texWidth)
     5827            || ((height % kBlockSize) && yoffset + height != texHeight)) {
     5828            synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "dimensions must match existing texture level dimensions");
     5829            return false;
     5830        }
     5831        return true;
    57585832    }
    57595833    default:
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h

    r251630 r252226  
    7878class WebGLCompressedTextureASTC;
    7979class WebGLCompressedTextureATC;
     80class WebGLCompressedTextureETC;
     81class WebGLCompressedTextureETC1;
    8082class WebGLCompressedTexturePVRTC;
    8183class WebGLCompressedTextureS3TC;
     
    386388    friend class WebGLCompressedTextureASTC;
    387389    friend class WebGLCompressedTextureATC;
     390    friend class WebGLCompressedTextureETC;
     391    friend class WebGLCompressedTextureETC1;
    388392    friend class WebGLCompressedTexturePVRTC;
    389393    friend class WebGLCompressedTextureS3TC;
     
    614618    std::unique_ptr<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC;
    615619    std::unique_ptr<WebGLCompressedTextureATC> m_webglCompressedTextureATC;
     620    std::unique_ptr<WebGLCompressedTextureETC> m_webglCompressedTextureETC;
     621    std::unique_ptr<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1;
    616622    std::unique_ptr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
    617623    std::unique_ptr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;
  • trunk/Source/WebCore/platform/graphics/Extensions3D.h

    r232450 r252226  
    158158        // GL_OES_compressed_ETC1_RGB8_texture
    159159        ETC1_RGB8_OES = 0x8D64,
     160
     161        // WEBGL_compressed_texture_etc
     162        COMPRESSED_R11_EAC = 0x9270,
     163        COMPRESSED_SIGNED_R11_EAC = 0x9271,
     164        COMPRESSED_RG11_EAC = 0x9272,
     165        COMPRESSED_SIGNED_RG11_EAC = 0x9273,
     166        COMPRESSED_RGB8_ETC2 = 0x9274,
     167        COMPRESSED_SRGB8_ETC2 = 0x9275,
     168        COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276,
     169        COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277,
     170        COMPRESSED_RGBA8_ETC2_EAC = 0x9278,
     171        COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279,
    160172
    161173        // GL_IMG_texture_compression_pvrtc
  • trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm

    r252055 r252226  
    244244    }
    245245
    246     if (attrs.isWebGL2) {
     246    if (m_attrs.isWebGL2) {
    247247        // FIXME: Instead of backing a WebGL2 GraphicsContext3D with a OpenGL 4 context, we should instead back it with ANGLE.
    248248        // Use an OpenGL 4 context for now until the ANGLE backend is ready.
     
    279279    }
    280280
    281     m_isForWebGL2 = attrs.isWebGL2;
     281    m_isForWebGL2 = m_attrs.isWebGL2;
    282282
    283283    CGLSetCurrentContext(m_contextObj);
     
    327327
    328328    std::vector<EGLint> contextAttributes;
    329     if (attrs.isWebGL2) {
     329    if (m_attrs.isWebGL2) {
    330330        contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
    331331        contextAttributes.push_back(3);
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp

    r246554 r252226  
    228228    }
    229229
    230 #if PLATFORM(IOS_FAMILY)
     230#if PLATFORM(IOS_FAMILY) || PLATFORM(IOS_FAMILY_SIMULATOR)
    231231    if (name == "GL_EXT_packed_depth_stencil")
    232232        return m_availableExtensions.contains("GL_OES_packed_depth_stencil");
     233
     234    if (name == "GL_OES_compressed_ETC1_RGB8_texture"
     235        || name == "GL_ANGLE_compressed_texture_etc") {
     236        // Implicitly enabled with ES 3.0 contexts.
     237        return m_context->m_isForWebGL2;
     238    }
    233239#endif
    234240
Note: See TracChangeset for help on using the changeset viewer.