Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoreAnimation] Add missing CAMetalLayer properties. Fixes #17340. #17345

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions src/coreanimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using OpenGL;
#else
using UIKit;
using CAEdrMetadata = Foundation.NSObject;
#endif
#if HAS_OPENGLES
using OpenGLES;
Expand All @@ -50,6 +49,10 @@
using Metal;
using SceneKit; // For SCNAnimationEvent

#if __WATCHOS__ || __TVOS__
using CAEdrMetadata = Foundation.NSObject;
#endif

#if !MONOMAC
using CGLPixelFormat = Foundation.NSObject;
using CVTimeStamp = Foundation.NSObject;
Expand Down Expand Up @@ -754,12 +757,30 @@ interface CAMetalLayer {
IMTLDevice PreferredDevice { get; }

[NoWatch]
[NoiOS]
[iOS (16, 0)]
[NoTV]
[Mac (10, 15)]
[MacCatalyst (13, 0)]
[MacCatalyst (16, 0)]
[NullAllowed, Export ("EDRMetadata", ArgumentSemantic.Strong)]
CAEdrMetadata EdrMetadata { get; set; }

[NoWatch]
[NoTV]
[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (11, 0)]
[Export ("wantsExtendedDynamicRangeContent")]
bool WantsExtendedDynamicRangeContent { get; set; }

[NoWatch]
[TV (16, 0)]
[iOS (16, 0)]
[MacCatalyst (16, 0)]
[Mac (13, 0)]
[Export ("developerHUDProperties", ArgumentSemantic.Copy)]
[NullAllowed]
// There's no documentation about which values are valid in this dictionary, so we can't create any strong bindings for it.
NSDictionary DeveloperHudProperties { get; set; }
}

[BaseType (typeof (CALayer))]
Expand Down Expand Up @@ -2038,9 +2059,9 @@ interface CARenderer {
}

[NoWatch]
[NoiOS]
[iOS (16, 0)]
[NoTV]
[MacCatalyst (13, 1)]
[MacCatalyst (16, 0)]
[Mac (10, 15)]
[BaseType (typeof (NSObject), Name = "CAEDRMetadata")]
[DisableDefaultCtor]
Expand All @@ -2057,5 +2078,10 @@ interface CAEdrMetadata {
[Static]
[Export ("HLGMetadata", ArgumentSemantic.Retain)]
CAEdrMetadata HlgMetadata { get; }

[Mac (13, 0)]
[Static]
[Export ("available")]
bool Available { [Bind ("isAvailable")] get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@
!missing-selector! CAConstraint::offset not bound
!missing-selector! +CALayer::layerWithRemoteClientId: not bound
!missing-selector! +CARemoteLayerServer::sharedServer not bound
!missing-selector! CAMetalLayer::setWantsExtendedDynamicRangeContent: not bound
!missing-selector! CAMetalLayer::wantsExtendedDynamicRangeContent not bound
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
!missing-field! kCARendererColorSpace not bound
!missing-field! kCARendererMetalCommandQueue not bound
!missing-selector! +CAEDRMetadata::isAvailable not bound
!missing-selector! +CARenderer::rendererWithMTLTexture:options: not bound
!missing-selector! CAMetalLayer::developerHUDProperties not bound
!missing-selector! CAMetalLayer::setDeveloperHUDProperties: not bound
!missing-selector! CARenderer::addUpdateRect: not bound
!missing-selector! CARenderer::beginFrameAtTime:timeStamp: not bound
!missing-selector! CARenderer::bounds not bound
Expand Down
11 changes: 0 additions & 11 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreAnimation.todo
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
!missing-field! kCARendererColorSpace not bound
!missing-field! kCARendererMetalCommandQueue not bound
!missing-selector! +CAEDRMetadata::HDR10MetadataWithDisplayInfo:contentInfo:opticalOutputScale: not bound
!missing-selector! +CAEDRMetadata::HDR10MetadataWithMinLuminance:maxLuminance:opticalOutputScale: not bound
!missing-selector! +CAEDRMetadata::HLGMetadata not bound
!missing-selector! +CAEDRMetadata::isAvailable not bound
!missing-selector! +CARenderer::rendererWithMTLTexture:options: not bound
!missing-selector! CAMetalLayer::developerHUDProperties not bound
!missing-selector! CAMetalLayer::EDRMetadata not bound
!missing-selector! CAMetalLayer::setDeveloperHUDProperties: not bound
!missing-selector! CAMetalLayer::setEDRMetadata: not bound
!missing-selector! CAMetalLayer::setWantsExtendedDynamicRangeContent: not bound
!missing-selector! CAMetalLayer::wantsExtendedDynamicRangeContent not bound
!missing-selector! CARenderer::addUpdateRect: not bound
!missing-selector! CARenderer::beginFrameAtTime:timeStamp: not bound
!missing-selector! CARenderer::bounds not bound
Expand All @@ -22,5 +12,4 @@
!missing-selector! CARenderer::setDestination: not bound
!missing-selector! CARenderer::setLayer: not bound
!missing-selector! CARenderer::updateBounds not bound
!missing-type! CAEDRMetadata not bound
!missing-type! CARenderer not bound
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
!missing-protocol-conformance! CAConstraintLayoutManager should conform to CALayoutManager
!missing-selector! +CALayer::layerWithRemoteClientId: not bound
!missing-selector! CAConstraint::offset not bound
!missing-selector! CAMetalLayer::setWantsExtendedDynamicRangeContent: not bound
!missing-selector! CAMetalLayer::wantsExtendedDynamicRangeContent not bound
!missing-selector! CARemoteLayerClient::clientId not bound
!missing-selector! CARemoteLayerClient::initWithServerPort: not bound
!missing-selector! CARemoteLayerClient::layer not bound
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
!missing-field! kCARendererColorSpace not bound
!missing-field! kCARendererMetalCommandQueue not bound
!missing-selector! +CARenderer::rendererWithMTLTexture:options: not bound
!missing-selector! CAMetalLayer::developerHUDProperties not bound
!missing-selector! CAMetalLayer::setDeveloperHUDProperties: not bound
!missing-selector! CARenderer::addUpdateRect: not bound
!missing-selector! CARenderer::beginFrameAtTime:timeStamp: not bound
!missing-selector! CARenderer::bounds not bound
Expand Down
11 changes: 0 additions & 11 deletions tests/xtro-sharpie/iOS-CoreAnimation.todo
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
!missing-field! kCARendererColorSpace not bound
!missing-field! kCARendererMetalCommandQueue not bound
!missing-selector! +CAEDRMetadata::HDR10MetadataWithDisplayInfo:contentInfo:opticalOutputScale: not bound
!missing-selector! +CAEDRMetadata::HDR10MetadataWithMinLuminance:maxLuminance:opticalOutputScale: not bound
!missing-selector! +CAEDRMetadata::HLGMetadata not bound
!missing-selector! +CAEDRMetadata::isAvailable not bound
!missing-selector! +CARenderer::rendererWithMTLTexture:options: not bound
!missing-selector! CAMetalLayer::developerHUDProperties not bound
!missing-selector! CAMetalLayer::EDRMetadata not bound
!missing-selector! CAMetalLayer::setDeveloperHUDProperties: not bound
!missing-selector! CAMetalLayer::setEDRMetadata: not bound
!missing-selector! CAMetalLayer::setWantsExtendedDynamicRangeContent: not bound
!missing-selector! CAMetalLayer::wantsExtendedDynamicRangeContent not bound
!missing-selector! CARenderer::addUpdateRect: not bound
!missing-selector! CARenderer::beginFrameAtTime:timeStamp: not bound
!missing-selector! CARenderer::bounds not bound
Expand All @@ -22,5 +12,4 @@
!missing-selector! CARenderer::setDestination: not bound
!missing-selector! CARenderer::setLayer: not bound
!missing-selector! CARenderer::updateBounds not bound
!missing-type! CAEDRMetadata not bound
!missing-type! CARenderer not bound
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-CoreAnimation.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
!missing-protocol-conformance! CAConstraintLayoutManager should conform to CALayoutManager
!missing-selector! +CALayer::layerWithRemoteClientId: not bound
!missing-selector! CAConstraint::offset not bound
!missing-selector! CAMetalLayer::setWantsExtendedDynamicRangeContent: not bound
!missing-selector! CAMetalLayer::wantsExtendedDynamicRangeContent not bound
!missing-selector! CARemoteLayerClient::clientId not bound
!missing-selector! CARemoteLayerClient::initWithServerPort: not bound
!missing-selector! CARemoteLayerClient::layer not bound
Expand Down
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/macOS-CoreAnimation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/tvOS-CoreAnimation.todo
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
!missing-field! kCARendererColorSpace not bound
!missing-field! kCARendererMetalCommandQueue not bound
!missing-selector! +CARenderer::rendererWithMTLTexture:options: not bound
!missing-selector! CAMetalLayer::developerHUDProperties not bound
!missing-selector! CAMetalLayer::setDeveloperHUDProperties: not bound
!missing-selector! CARenderer::addUpdateRect: not bound
!missing-selector! CARenderer::beginFrameAtTime:timeStamp: not bound
!missing-selector! CARenderer::bounds not bound
Expand Down