Add ANGLE backend for iOS device
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2019 19:55:56 +0000 (19:55 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2019 19:55:56 +0000 (19:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202159
<rdar://57000166>

Build fixes for Mac Catalyst, tvOS and watchOS.

* src/common/PackedEnums.cpp:
(egl_gl::EGLTextureTargetToTextureType):
* src/common/platform.h:
* src/gpu_info_util/SystemInfo_ios.cpp:
* src/gpu_info_util/SystemInfo_macos.cpp:
* src/libANGLE/Display.cpp:
* src/libANGLE/formatutils.cpp:
(gl::BuildInternalFormatInfoMap):
* src/libANGLE/renderer/gl/cgl/DeviceCGL.cpp:
* src/libANGLE/renderer/gl/cgl/DisplayCGL.mm:
* src/libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.cpp:
* src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.cpp:
* src/libANGLE/renderer/gl/cgl/RendererCGL.cpp:
* src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm:
* src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm:
* src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm:
* src/libANGLE/renderer/gl/eagl/PbufferSurfaceEAGL.cpp:
* src/libANGLE/renderer/gl/eagl/RendererEAGL.cpp:
* src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm:
* src/libANGLE/renderer/gl/renderergl_utils.cpp:
(rx::nativegl_gl::GenerateCaps):
* src/libANGLE/validationES2.cpp:
(gl::ValidateFramebufferTexture2D):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/ThirdParty/ANGLE/src/common/PackedEnums.cpp
Source/ThirdParty/ANGLE/src/common/platform.h
Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_ios.cpp
Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.cpp
Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp
Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/DeviceCGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/RendererCGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/PbufferSurfaceEAGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/RendererEAGL.cpp
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm
Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp
Source/ThirdParty/ANGLE/src/libANGLE/validationES2.cpp

index 8cb9e50..b531775 100644 (file)
@@ -374,7 +374,7 @@ gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget)
             return gl::TextureType::_2D;
 
         case EGL_TEXTURE_RECTANGLE_ANGLE:
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
             return gl::TextureType::_2D;
 #else
             return gl::TextureType::Rectangle;
index e957d12..04c747a 100644 (file)
 #    include <TargetConditionals.h>
 #    if TARGET_OS_OSX
 #        define ANGLE_PLATFORM_MACOS 1
-#    elif TARGET_OS_IOS
+#    elif TARGET_OS_IPHONE
 #        define ANGLE_PLATFORM_IOS 1
 #        define GLES_SILENCE_DEPRECATION
 #        if TARGET_OS_SIMULATOR
 #            define ANGLE_PLATFORM_IOS_SIMULATOR 1
 #        endif
+#        if TARGET_OS_MACCATALYST
+#            define ANGLE_PLATFORM_MACCATALYST
+#        endif
 #    endif
 #endif
 
index dace74a..f133c22 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "gpu_info_util/SystemInfo_internal.h"
 
index 71321c5..b128fd6 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "gpu_info_util/SystemInfo_internal.h"
 
index b0ae518..e6942f6 100644 (file)
@@ -52,7 +52,7 @@
 #        include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
 #    elif defined(ANGLE_USE_X11)
 #        include "libANGLE/renderer/gl/glx/DisplayGLX.h"
-#    elif defined(ANGLE_PLATFORM_MACOS)
+#    elif defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 #        include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
 #    elif defined(ANGLE_PLATFORM_IOS)
 #        include "libANGLE/renderer/gl/eagl/DisplayEAGL.h"
@@ -234,7 +234,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap, const D
             impl = new rx::DisplayWGL(state);
 #    elif defined(ANGLE_USE_X11)
             impl = new rx::DisplayGLX(state);
-#    elif defined(ANGLE_PLATFORM_MACOS)
+#    elif defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
             impl = new rx::DisplayCGL(state);
 #    elif defined(ANGLE_PLATFORM_IOS)
             impl = new rx::DisplayEAGL(state);
index c55d455..9865861 100644 (file)
@@ -975,7 +975,7 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
     AddRGBAFormat(&map, GL_RGBA,           false,  8,  8,  8,  8, 0, GL_RGBA,           GL_BYTE,                        GL_SIGNED_NORMALIZED,   false, NeverSupported,                                   NeverSupported,  NeverSupported,                                 NeverSupported);
     AddRGBAFormat(&map, GL_SRGB,           false,  8,  8,  8,  0, 0, GL_SRGB,           GL_UNSIGNED_BYTE,               GL_UNSIGNED_NORMALIZED, true,  RequireExt<&Extensions::sRGB>,                    AlwaysSupported, NeverSupported,                                 NeverSupported);
     AddRGBAFormat(&map, GL_SRGB_ALPHA_EXT, false,  8,  8,  8,  8, 0, GL_SRGB_ALPHA_EXT, GL_UNSIGNED_BYTE,               GL_UNSIGNED_NORMALIZED, true,  RequireExt<&Extensions::sRGB>,                    AlwaysSupported, RequireExt<&Extensions::sRGB>,                  NeverSupported);
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
     AddRGBAFormat(&map, GL_BGRA_EXT,       false,  8,  8,  8,  8, 0, GL_BGRA_EXT,       GL_UNSIGNED_BYTE,               GL_UNSIGNED_NORMALIZED, false, RequireES<2, 0>,   AlwaysSupported, RequireES<2, 0>, NeverSupported);
 #else
     AddRGBAFormat(&map, GL_BGRA_EXT,       false,  8,  8,  8,  8, 0, GL_BGRA_EXT,       GL_UNSIGNED_BYTE,               GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::textureFormatBGRA8888>,   AlwaysSupported, RequireExt<&Extensions::textureFormatBGRA8888>, NeverSupported);
index b81a2e8..a113152 100644 (file)
@@ -8,7 +8,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "libANGLE/renderer/gl/cgl/DeviceCGL.h"
 
index 63e166b..ca74a2b 100644 (file)
@@ -8,7 +8,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #import "libANGLE/renderer/gl/cgl/DisplayCGL.h"
 
index 106dff7..1b554cb 100644 (file)
@@ -9,7 +9,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.h"
 
index 4094442..1b532a9 100644 (file)
@@ -9,7 +9,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.h"
 
index ac4b921..20f9ff9 100644 (file)
@@ -8,7 +8,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
 #include "libANGLE/renderer/gl/cgl/RendererCGL.h"
index 4c084d8..e8fd588 100644 (file)
@@ -8,7 +8,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
 
 #import "libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h"
 
index 9507aac..8be13cf 100644 (file)
@@ -27,7 +27,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
 
 #import "libANGLE/renderer/gl/eagl/DisplayEAGL.h"
 
index 0327f03..96a4da3 100644 (file)
@@ -25,7 +25,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
 
 #import "libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.h"
 
index 58e861e..d7d4775 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "libANGLE/renderer/gl/eagl/PbufferSurfaceEAGL.h"
 
index 726c86f..a58751a 100644 (file)
@@ -27,7 +27,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
 
 #include "libANGLE/renderer/gl/eagl/DisplayEAGL.h"
 #include "libANGLE/renderer/gl/eagl/RendererEAGL.h"
index 766e82c..65f3eb7 100644 (file)
@@ -27,7 +27,7 @@
 
 #import "common/platform.h"
 
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
 
 #import "libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.h"
 
index 6020a60..d4b6823 100644 (file)
@@ -1258,7 +1258,7 @@ void GenerateCaps(const FunctionsGL *functions,
     extensions->textureSRGBDecode = functions->hasGLExtension("GL_EXT_texture_sRGB_decode") ||
                                     functions->hasGLESExtension("GL_EXT_texture_sRGB_decode");
 
-#if defined(ANGLE_PLATFORM_MACOS)
+#if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
     VendorID vendor = GetVendorID(functions);
     if ((IsAMD(vendor) || IsIntel(vendor)) && *maxSupportedESVersion >= gl::Version(3, 0))
     {
index 7174588..4f0a928 100644 (file)
@@ -6387,7 +6387,7 @@ bool ValidateFramebufferTexture2D(Context *context,
                     context->validationError(GL_INVALID_VALUE, kInvalidMipLevel);
                     return false;
                 }
-#if defined(ANGLE_PLATFORM_IOS)
+#if defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)
                 const TextureType expectedType { TextureType::_2D };
 #else
                 const TextureType expectedType { TextureType::Rectangle };