2020-12-16 Alan Coon Cherry-pick r269900. rdar://problem/72298580 Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Patch by Kimmo Kinnunen on 2020-11-17 Reviewed by Antti Koivisto. Fix compile for simulator builds. Rename HAVE_CV_AGX_420_PIXEL_FORMAT_TYPES to HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES to better reflect what the ifdef does. Source/WebCore: * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::pixelRangeFromPixelFormat): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): Source/WebCore/PAL: * pal/spi/cf/CoreVideoSPI.h: Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269900 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-17 Kimmo Kinnunen Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Reviewed by Antti Koivisto. Fix compile for simulator builds. Rename HAVE_CV_AGX_420_PIXEL_FORMAT_TYPES to HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES to better reflect what the ifdef does. * pal/spi/cf/CoreVideoSPI.h: 2020-12-16 Alan Coon Cherry-pick r269898. rdar://problem/72298580 Build fails on internal Catalina due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219026 Patch by Kimmo Kinnunen on 2020-11-17 Reviewed by Antti Koivisto. Fix compile for macOS versions before Big Sur. On macOS, only use the private header on Big Sur. On Catalina, use the manual enums. Regressed in: Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2] * pal/spi/cf/CoreVideoSPI.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269898 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-17 Kimmo Kinnunen Build fails on internal Catalina due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219026 Reviewed by Antti Koivisto. Fix compile for macOS versions before Big Sur. On macOS, only use the private header on Big Sur. On Catalina, use the manual enums. Regressed in: Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2] * pal/spi/cf/CoreVideoSPI.h: 2020-12-14 Alan Coon Cherry-pick r269893. rdar://problem/72298580 Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2] https://bugs.webkit.org/show_bug.cgi?id=218637 Patch by Kimmo Kinnunen on 2020-11-16 Reviewed by Eric Carlson. Patch by Jer Noble. Treat internal compressed YUV pixel formats kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when using the OpenGL shader to convert video IOSurface to a WebGL texture. Fixes cases where the decoder outputs the compressed formats. No new tests, adding more comprehensive test content suite is tracked in another bug. Source/WebCore: * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::pixelRangeFromPixelFormat): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): Source/WebCore/PAL: * PAL.xcodeproj/project.pbxproj: * pal/spi/cf/CoreVideoSPI.h: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269893 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-11-16 Kimmo Kinnunen Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2] https://bugs.webkit.org/show_bug.cgi?id=218637 Reviewed by Eric Carlson. Patch by Jer Noble. Treat internal compressed YUV pixel formats kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when using the OpenGL shader to convert video IOSurface to a WebGL texture. Fixes cases where the decoder outputs the compressed formats. No new tests, adding more comprehensive test content suite is tracked in another bug. * PAL.xcodeproj/project.pbxproj: * pal/spi/cf/CoreVideoSPI.h: Added. 2020-11-13 Russell Epstein Cherry-pick r269208. rdar://problem/71378171 AX: Incorrect list of voices being displayed on iOS https://bugs.webkit.org/show_bug.cgi?id=218293 Reviewed by Per Arne Vollan. Source/WebCore: Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact" decision, but some mobile assets have compact voices, which are not available WebContent. * platform/ios/PlatformSpeechSynthesizerIOS.mm: (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): Source/WebCore/PAL: * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/spi/cocoa/AXSpeechManagerSPI.h: Added. Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269208 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-30 Chris Fleizach AX: Incorrect list of voices being displayed on iOS https://bugs.webkit.org/show_bug.cgi?id=218293 Reviewed by Per Arne Vollan. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/spi/cocoa/AXSpeechManagerSPI.h: Added. 2020-10-15 Russell Epstein Cherry-pick r268308. rdar://problem/70321629 [Mac] AirPlay menu does not show up when AirPlay button is clicked https://bugs.webkit.org/show_bug.cgi?id=217536 Reviewed by Eric Carlson. Source/WebCore: PAL tries to soft-link the AVRoutePickerView from the AVFoundation framework, rather than the (correct) AVKit framework. Remove AVRoutePickerView from AVFoundationSoftLink.h and use the already declared version inside AVRoutePickerViewTargetPicker.mm. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: (WebCore::AVRoutePickerViewTargetPicker::isAvailable): Source/WebCore/PAL: * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268308 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-09 Jer Noble [Mac] AirPlay menu does not show up when AirPlay button is clicked https://bugs.webkit.org/show_bug.cgi?id=217536 Reviewed by Eric Carlson. * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: 2020-10-14 Alan Coon Cherry-pick r268371. rdar://problem/70267767 [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin on 2020-10-12 Reviewed by Darin Adler. The previous workaround turns out to be ineffective because we can't set the value of TARGET_MAC_OS_X_VERSION_MAJOR based on a previous value of itself. Introduce a new variable TARGET_MAC_OS_X_VERSION_MAJOR to determine whether we need to explicitly adjust MAC_OS_X_VERSION_MAJOR to 110000. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268371 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-12 Luming Yin [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Reviewed by Darin Adler. The previous workaround turns out to be ineffective because we can't set the value of TARGET_MAC_OS_X_VERSION_MAJOR based on a previous value of itself. Introduce a new variable TARGET_MAC_OS_X_VERSION_MAJOR to determine whether we need to explicitly adjust MAC_OS_X_VERSION_MAJOR to 110000. * Configurations/DebugRelease.xcconfig: 2020-10-14 Alan Coon Cherry-pick r268353. rdar://problem/70267767 [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Patch by Luming Yin on 2020-10-12 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after is resolved. PerformanceTests: * DecoderTest/Configurations/DebugRelease.xcconfig: * MediaTime/Configurations/DebugRelease.xcconfig: Source/bmalloc: * Configurations/DebugRelease.xcconfig: Source/JavaScriptCore: * Configurations/DebugRelease.xcconfig: Source/ThirdParty: * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: * Configurations/DebugRelease.xcconfig: Source/ThirdParty/libwebrtc: * Configurations/DebugRelease.xcconfig: Source/WebCore: * Configurations/DebugRelease.xcconfig: Source/WebCore/PAL: * Configurations/DebugRelease.xcconfig: Source/WebInspectorUI: * Configurations/DebugRelease.xcconfig: Source/WebKit: * Configurations/DebugRelease.xcconfig: Source/WebKitLegacy/mac: * Configurations/DebugRelease.xcconfig: Source/WTF: * Configurations/DebugRelease.xcconfig: Tools: * ContentExtensionTester/Configurations/DebugRelease.xcconfig: * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: * ImageDiff/cg/Configurations/DebugRelease.xcconfig: * MiniBrowser/Configurations/DebugRelease.xcconfig: * TestWebKitAPI/Configurations/DebugRelease.xcconfig: * WebEditingTester/Configurations/DebugRelease.xcconfig: * WebKitTestRunner/Configurations/DebugRelease.xcconfig: * lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268353 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-12 Luming Yin [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after is resolved. * Configurations/DebugRelease.xcconfig: 2020-10-11 Kocsen Chung Cherry-pick r268330. rdar://problem/70189394 Strip patch version from TARGET_MAC_OS_X_VERSION_MAJOR when building for macOS Big Sur or later https://bugs.webkit.org/show_bug.cgi?id=217594 rdar://70188497 Patch by Luming Yin on 2020-10-11 Reviewed by Darin Adler. To ensure successful Mac Catalyst WebKit builds, strip the patch version from TARGET_MAC_OS_X_VERSION_MAJOR by using two `base:`s on MACOSX_DEPLOYMENT_TARGET. * Configurations/Base.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268330 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-11 Luming Yin Strip patch version from TARGET_MAC_OS_X_VERSION_MAJOR when building for macOS Big Sur or later https://bugs.webkit.org/show_bug.cgi?id=217594 rdar://70188497 Reviewed by Darin Adler. To ensure successful Mac Catalyst WebKit builds, strip the patch version from TARGET_MAC_OS_X_VERSION_MAJOR by using two `base:`s on MACOSX_DEPLOYMENT_TARGET. * Configurations/Base.xcconfig: 2020-10-11 Kocsen Chung Cherry-pick r268327. rdar://problem/70189401 Ignore deployment suffix and identifier when computing major OS version for macOS Big Sur and newer https://bugs.webkit.org/show_bug.cgi?id=217584 rdar://70168426 Patch by Luming Yin on 2020-10-11 Reviewed by Darin Adler. Stop using MACOSX_DEPLOYMENT_TARGET:suffix:identifier to compute major OS versions. Only use the deployment target base for macOS Big Sur and newer. Keep the manual definitions for legacy versions of macOS. * Configurations/Base.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268327 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-11 Luming Yin Ignore deployment suffix and identifier when computing major OS version for macOS Big Sur and newer https://bugs.webkit.org/show_bug.cgi?id=217584 rdar://70168426 Reviewed by Darin Adler. Stop using MACOSX_DEPLOYMENT_TARGET:suffix:identifier to compute major OS versions. Only use the deployment target base for macOS Big Sur and newer. Keep the manual definitions for legacy versions of macOS. * Configurations/Base.xcconfig: 2020-10-06 Alan Coon Cherry-pick r267870. rdar://problem/70025703 Add AVAssetWriter SPI header https://bugs.webkit.org/show_bug.cgi?id=217169 Reviewed by Eric Carlson. Source/WebCore: No change of behavior, include SPI header instead of private SDK header. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Source/WebCore/PAL: * PAL.xcodeproj/project.pbxproj: * pal/spi/cocoa/AVAssetWriterSPI.h: Added. Source/WTF: * wtf/PlatformHave.h: Remove dependency on AVAssetWriter_private.h. Introduce HAVE_AVASSETWRITERDELEGATE_API for older OSes that only have delegate as SPI. LayoutTests: Enable tests by default on Catalina+, disable them on Mojave and WK1. Disable tests for iOS13. * TestExpectations: * platform/ios-13/TestExpectations: * platform/mac/TestExpectations: * platform/mac-wk1/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267870 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-10-02 Youenn Fablet Add AVAssetWriter SPI header https://bugs.webkit.org/show_bug.cgi?id=217169 Reviewed by Eric Carlson. * PAL.xcodeproj/project.pbxproj: * pal/spi/cocoa/AVAssetWriterSPI.h: Added. 2020-10-05 Alan Coon Cherry-pick r267602. rdar://problem/69904386 WebGL should use GLES in iOS apps running on Apple Silicon https://bugs.webkit.org/show_bug.cgi?id=216722 Reviewed by Tim Horton and Ken Russell. Source/ThirdParty/ANGLE: Change ANGLE to dynamically load either EAGL (OpenGLES) or CGL (OpenGL) depending on both compile and runtime configurations. Intel Mac -> CGL Intel Mac Catalyst -> CGL Intel iOS Simulator -> EAGL iOS Device -> EAGL Apple Silicon Mac -> CGL Apple Silicon Mac Catalyst (with Mac app) -> CGL Apple Silicon Mac Catalyst (with iOS app) -> EAGL The trickiest bit is Apple Silicon Mac Catalyst, which depends on the type of the application it is attempting to run. In that case ANGLE must compile both the CGL and EAGL interfaces and then pick one to use after launch. * ANGLE.xcodeproj/project.pbxproj: Add new files. * Configurations/ANGLE-dynamic.xcconfig: Remove all the OpenGL* linking. * Configurations/ANGLE-static.xcconfig: * GLESv2.cmake: New files. * src/common/platform.h: New definitions for CPU type on Apple Systems. * src/gpu_info_util/SystemInfo.h: Split SystemInfo for Apple into two files, for iOS and Mac. Added a field for isiOSAppOnMac that will only be true when running an iOS binary on Apple Silicon. * src/gpu_info_util/SystemInfo_apple.mm: Added. Decides which SystemInfo to call. (angle::GetSystemInfo): * src/gpu_info_util/SystemInfo_ios.cpp: (angle::GetSystemInfo_ios): (angle::GetSystemInfo): Deleted. * src/gpu_info_util/SystemInfo_macos.mm: (angle::GetSystemInfo_mac): (angle::GetSystemInfo): Deleted. * src/libANGLE/Caps.cpp: Can no longer just check for PLATFORM_IOS. This might still need a runtime check. (gl::DetermineDepthTextureANGLESupport): (gl::DetermineDepthTextureOESSupport): * src/libANGLE/Display.cpp: This is the main initialization point for ANGLE, which decides at compile/runtime which variant of Display to create. * src/libANGLE/formatutils.cpp: Add the correct formats. (gl::BuildInternalFormatInfoMap): * src/libANGLE/renderer/gl/SoftLinking_apple.h: Added. Macros to help soft-link functions and ObjC classes. * src/libANGLE/renderer/gl/cgl/CGLFunctions.cpp: Added. Where we soft-link all the OpenGL/CGL API. * src/libANGLE/renderer/gl/cgl/CGLFunctions.h: Added. * src/libANGLE/renderer/gl/cgl/DisplayCGL.mm: Use the soft-linked methods. * src/libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.cpp: * src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h: * src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm: Rename WebSwapLayer to WebSwapLayerCGL otherwise it clashes with the EAGL version. (rx::WindowSurfaceCGL::initialize): (-[WebSwapLayer initWithSharedState:withContext:withFunctions:]): Deleted. (-[WebSwapLayer copyCGLPixelFormatForDisplayMask:]): Deleted. (-[WebSwapLayer copyCGLContextForPixelFormat:]): Deleted. (-[WebSwapLayer canDrawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted. (-[WebSwapLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted. * src/libANGLE/renderer/gl/eagl/DeviceEAGL.cpp: Similar changes to the CGL implementation. * src/libANGLE/renderer/gl/eagl/DeviceEAGL.h: * src/libANGLE/renderer/gl/eagl/DisplayEAGL.h: * src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm: (rx::DisplayEAGL::initialize): (rx::DisplayEAGL::terminate): (rx::WorkerContextEAGL::~WorkerContextEAGL): (rx::WorkerContextEAGL::makeCurrent): (rx::WorkerContextEAGL::unmakeCurrent): (rx::DisplayEAGL::createWorkerContext): * src/libANGLE/renderer/gl/eagl/EAGLFunctions.h: Added. * src/libANGLE/renderer/gl/eagl/EAGLFunctions.mm: Added. * 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.h: * src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm: (-[WebSwapLayerEAGL display]): (rx::WindowSurfaceEAGL::initialize): (-[WebSwapLayer initWithSharedState:withContext:withFunctions:]): Deleted. (-[WebSwapLayer display]): Deleted. * src/libANGLE/renderer/gl/renderergl_utils.cpp: Runtime check. (rx::nativegl_gl::GenerateCaps): Source/WebCore: * Configurations/WebCore.xcconfig: Remove all OpenGL/OpenGLES linking. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContextGL.h: Change the ANGLE IOSurface texture binding enums into functions, because they have to be calculated at run-time. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: Use the new soft-linked functions from PAL. Also implement the IOSurface texture binding helpers that were previously enums. * platform/mac/PlatformScreenMac.mm: * platform/mac/WebGLBlocklist.mm: Source/WebCore/PAL: Add soft-linking content for OpenGL/OpenGLES. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/cocoa/OpenGLSoftLinkCocoa.h: Added. * pal/cocoa/OpenGLSoftLinkCocoa.mm: Added. Source/WebKit: * Configurations/WebKit.xcconfig: Remove OpenGL linking. * UIProcess/mac/HighPerformanceGPUManager.mm: Renamed to .mm. Use the PAL soft-linked OpenGL API. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267602 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-24 Dean Jackson WebGL should use GLES in iOS apps running on Apple Silicon https://bugs.webkit.org/show_bug.cgi?id=216722 Reviewed by Tim Horton. Add soft-linking content for OpenGL/OpenGLES. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/cocoa/OpenGLSoftLinkCocoa.h: Added. * pal/cocoa/OpenGLSoftLinkCocoa.mm: Added. 2020-09-27 Alan Coon Cherry-pick r267215. rdar://problem/69594225 Per-app accent color overrides are broken https://bugs.webkit.org/show_bug.cgi?id=216674 Reviewed by Wenson Hsieh. Source/WebCore/PAL: * pal/spi/mac/NSApplicationSPI.h: Source/WebKit: No new tests; I've no idea how to write a test that would have caught this; any test I can imagine would have also written to _accentColor and worked fine. * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::accentColor): AppKit changed the meaning of the IPI. Use the correct version. We still write to _accentColor; it is now purely an override. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267215 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-17 Tim Horton Per-app accent color overrides are broken https://bugs.webkit.org/show_bug.cgi?id=216674 Reviewed by Wenson Hsieh. * pal/spi/mac/NSApplicationSPI.h: 2020-09-14 Alan Coon Cherry-pick r266932. rdar://problem/68881008 Fix undeclared identifier issue due to clashes in soft link headers https://bugs.webkit.org/show_bug.cgi?id=216412 Reviewed by Geoffrey Garen. Source/WebCore/PAL: r266898 broke builds on certain SDKs. The reason for this is that it includes MediaToolbox/FigPhoto.h, which transitively includes CoreMedia/CMTimePrivate.h. The latter header has a bunch of inline code in certain SDKs which conflicts with the CoreMediaSoftLink.h header. For instance, CoreMediaSoftLink.h redefines CMTimeCompare to softLink_CoreMedia_CMTimeCompare, which messes up the inline code in the CMTimePrivate.h header that references CMTimeCompare. For now, we just avoid including FigPhoto.h altogether and use a constant. We'll clean this up once we start weak linking rather than soft linking CoreMedia and MediaToolbox (216388). * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: * pal/spi/cocoa/MediaToolboxSPI.h: Source/WebKit: Use the workaround constant kPALFigPhotoContainerFormat_JFIF instead of the enum value kFigPhotoContainerFormat_JFIF. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266932 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-11 Ben Nham Fix undeclared identifier issue due to clashes in soft link headers https://bugs.webkit.org/show_bug.cgi?id=216412 Reviewed by Geoffrey Garen. r266898 broke builds on certain SDKs. The reason for this is that it includes MediaToolbox/FigPhoto.h, which transitively includes CoreMedia/CMTimePrivate.h. The latter header has a bunch of inline code in certain SDKs which conflicts with the CoreMediaSoftLink.h header. For instance, CoreMediaSoftLink.h redefines CMTimeCompare to softLink_CoreMedia_CMTimeCompare, which messes up the inline code in the CMTimePrivate.h header that references CMTimeCompare. For now, we just avoid including FigPhoto.h altogether and use a constant. We'll clean this up once we start weak linking rather than soft linking CoreMedia and MediaToolbox (216388). * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: * pal/spi/cocoa/MediaToolboxSPI.h: 2020-09-14 Alan Coon Cherry-pick r266898. rdar://problem/68881029 Disable hardware JPEG decoding on x86 Mac https://bugs.webkit.org/show_bug.cgi?id=216377 Reviewed by Geoff Garen. Source/WebCore/PAL: Add wrappers for a new MediaToolbox SPI that allows us to disable HW JPEG decoding. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: Source/WebKit: In Big Sur, ImageIO uses hardware JPEG decoding automatically for certain JPEGs. This caused a small regression in our battery life benchmark since the one-time setup cost for the decoder (~20-30 ms per process) was higher than the per-decode win we got from the HW decoder. For now, we're reverting to the Catalina behavior of not using hardware JPEG on x86 Macs by calling a MediaToolbox SPI. (The tradeoffs for Apple Silicon are different so we use ImageIO's default heuristics on that architecture.) We plan to revisit this decision once we move to a GPUProcess world. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WTF: Add macros to disable HW JPEG decoding on x86 Macs and indicate the presence of a new MediaToolbox SPI. (The latter is to prevent unnecessary dlopen/dlsym calls since we soft-link MediaToolbox.) * wtf/PlatformEnableCocoa.h: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266898 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2020-09-10 Ben Nham Disable hardware JPEG decoding on x86 Mac https://bugs.webkit.org/show_bug.cgi?id=216377 Reviewed by Geoff Garen. Add wrappers for a new MediaToolbox SPI that allows us to disable HW JPEG decoding. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: 2020-09-14 Alan Coon Cherry-pick r266844. rdar://problem/68880990 [Cocoa] PERF: Don't instantiate AVPlayer-based audio decoders or renderers if an element is initially muted. https://bugs.webkit.org/show_bug.cgi?id=216299 Reviewed by Eric Carlson. Source/WebCore: When an AVPlayer is created, even if muted, it will still instantiate an audio decoder and renderer if the AVAsset in the current player item has an audio track. Ostensibly, this is so that an unmute operation is instantaneous, as it's merely applying a zero gain to the decoded audio. However for web content, there's many autoplaying, muted