diff --git a/Examples/DamageRegionSmoke/main.swift b/Examples/DamageRegionSmoke/main.swift index 0d4bc6a5..05d9fc55 100644 --- a/Examples/DamageRegionSmoke/main.swift +++ b/Examples/DamageRegionSmoke/main.swift @@ -86,7 +86,9 @@ enum DamageRegionSmoke { let geometry = try await window.geometry let frame = try await animation.nextFrame(logicalSize: geometry.logicalSize) - try await window.redraw(damage: frame.damage) { softwareFrame in + try await window.redraw( + metadata: SurfaceFrameMetadata(damage: frame.damage) + ) { softwareFrame in draw(softwareFrame, phase: frame.phase) } log("operation: submit-partial-damage pass") diff --git a/Examples/GraphicsPreviewColorMetadataSmoke/main.swift b/Examples/GraphicsPreviewColorMetadataSmoke/main.swift index 8f530673..94a9865b 100644 --- a/Examples/GraphicsPreviewColorMetadataSmoke/main.swift +++ b/Examples/GraphicsPreviewColorMetadataSmoke/main.swift @@ -73,12 +73,12 @@ enum GraphicsPreviewColorMetadataSmoke { private static func requestedMetadata( _ options: ExampleRunOptions - ) throws -> WaylandGraphicsFrameMetadata { - WaylandGraphicsFrameMetadata( + ) throws -> SurfaceFrameMetadata { + SurfaceFrameMetadata( contentType: try requestedContentType(options.contentType), presentationHint: try requestedPresentationHint(options.presentationHint), alpha: .opaque, - colorRepresentation: WaylandGraphicsColorRepresentation( + colorRepresentation: SurfaceColorRepresentation( alphaMode: .premultipliedElectrical ) ) @@ -116,7 +116,7 @@ enum GraphicsPreviewColorMetadataSmoke { private static func requestedContentType( _ rawValue: String? - ) throws -> WaylandGraphicsContentType? { + ) throws -> SurfaceContentType? { switch normalized(rawValue) { case nil, "none": nil @@ -133,7 +133,7 @@ enum GraphicsPreviewColorMetadataSmoke { private static func requestedPresentationHint( _ rawValue: String? - ) throws -> WaylandGraphicsPresentationHint? { + ) throws -> SurfacePresentationHint? { switch normalized(rawValue) { case nil, "none": nil @@ -196,7 +196,7 @@ enum GraphicsPreviewColorMetadataSmoke { } nonisolated private static func contentTypeDescription( - _ contentType: WaylandGraphicsContentType? + _ contentType: SurfaceContentType? ) -> String { switch contentType { case nil: @@ -213,7 +213,7 @@ enum GraphicsPreviewColorMetadataSmoke { } nonisolated private static func presentationHintDescription( - _ presentationHint: WaylandGraphicsPresentationHint? + _ presentationHint: SurfacePresentationHint? ) -> String { switch presentationHint { case nil: diff --git a/Examples/GraphicsPreviewManagedGPUClear/main.swift b/Examples/GraphicsPreviewManagedGPUClear/main.swift index 6f7963e5..33e37457 100644 --- a/Examples/GraphicsPreviewManagedGPUClear/main.swift +++ b/Examples/GraphicsPreviewManagedGPUClear/main.swift @@ -159,7 +159,7 @@ enum GraphicsPreviewManagedGPUClear { _ events: DisplayEvents, backing: WaylandGraphicsWindowBacking, state: ManagedGPUClearRunState, - metadata: WaylandGraphicsFrameMetadata + metadata: SurfaceFrameMetadata ) async throws { var iterator = events.makeAsyncIterator() while !Task.isCancelled, let event = try await iterator.next() { @@ -186,7 +186,7 @@ enum GraphicsPreviewManagedGPUClear { nonisolated private static func submitClearFrame( backing: WaylandGraphicsWindowBacking, state: ManagedGPUClearRunState, - metadata: WaylandGraphicsFrameMetadata + metadata: SurfaceFrameMetadata ) async throws -> WaylandGraphicsFrameResult { let lease = try await backing.nextFrame() let result = try await lease.submit( @@ -398,8 +398,8 @@ enum GraphicsPreviewManagedGPUClear { nonisolated private static func requestedFrameMetadata( _ options: ExampleRunOptions - ) throws -> WaylandGraphicsFrameMetadata { - try WaylandGraphicsFrameMetadata( + ) throws -> SurfaceFrameMetadata { + try SurfaceFrameMetadata( contentType: requestedContentType(options.contentType), presentationHint: requestedPresentationHint(options.presentationHint) ) @@ -407,12 +407,12 @@ enum GraphicsPreviewManagedGPUClear { nonisolated private static func requestedContentType( _ rawValue: String? - ) throws -> WaylandGraphicsContentType? { + ) throws -> SurfaceContentType? { switch normalized(rawValue) { case nil: nil case "none": - WaylandGraphicsContentType.none + SurfaceContentType.none case "photo": .photo case "video": @@ -426,7 +426,7 @@ enum GraphicsPreviewManagedGPUClear { nonisolated private static func requestedPresentationHint( _ rawValue: String? - ) throws -> WaylandGraphicsPresentationHint? { + ) throws -> SurfacePresentationHint? { switch normalized(rawValue) { case nil: nil @@ -498,7 +498,7 @@ enum GraphicsPreviewManagedGPUClear { } nonisolated fileprivate static func contentTypeDescription( - _ contentType: WaylandGraphicsContentType? + _ contentType: SurfaceContentType? ) -> String { guard let contentType else { return "not requested" } switch contentType { @@ -514,7 +514,7 @@ enum GraphicsPreviewManagedGPUClear { } nonisolated fileprivate static func presentationHintDescription( - _ hint: WaylandGraphicsPresentationHint? + _ hint: SurfacePresentationHint? ) -> String { guard let hint else { return "not requested" } switch hint { @@ -740,7 +740,7 @@ private struct ManagedGPUClearReport: Sendable { var synchronizationPolicy: WaylandGraphicsSynchronizationPolicy var pacingPolicy: WaylandGraphicsPacingPolicy var metadataPolicy: WaylandGraphicsMetadataPolicy - var metadata: WaylandGraphicsFrameMetadata + var metadata: SurfaceFrameMetadata var resizeRequestCount: Int var failure: String? @@ -754,7 +754,7 @@ private struct ManagedGPUClearReport: Sendable { WaylandGraphicsSynchronizationPolicy = .implicitOnly, pacingPolicy reportedPacingPolicy: WaylandGraphicsPacingPolicy = .none, metadataPolicy reportedMetadataPolicy: WaylandGraphicsMetadataPolicy = .none, - metadata reportedMetadata: WaylandGraphicsFrameMetadata = .default, + metadata reportedMetadata: SurfaceFrameMetadata = .default, resizeRequestCount reportedResizeRequestCount: Int = 0, failure reportedFailure: String? = nil ) { @@ -800,7 +800,7 @@ private actor ManagedGPUClearRunState { synchronizationPolicy: WaylandGraphicsSynchronizationPolicy, pacingPolicy: WaylandGraphicsPacingPolicy, metadataPolicy: WaylandGraphicsMetadataPolicy, - metadata: WaylandGraphicsFrameMetadata, + metadata: SurfaceFrameMetadata, resizeRequestCount: Int ) -> ManagedGPUClearReport { ManagedGPUClearReport( diff --git a/IntegrationTests/FrameworkHostClient/Tests/WaylandFrameworkHostClientTests/WaylandFrameworkHostClientTests.swift b/IntegrationTests/FrameworkHostClient/Tests/WaylandFrameworkHostClientTests/WaylandFrameworkHostClientTests.swift index aeb1baf5..33a3d7c0 100644 --- a/IntegrationTests/FrameworkHostClient/Tests/WaylandFrameworkHostClientTests/WaylandFrameworkHostClientTests.swift +++ b/IntegrationTests/FrameworkHostClient/Tests/WaylandFrameworkHostClientTests/WaylandFrameworkHostClientTests.swift @@ -43,14 +43,13 @@ struct WaylandFrameworkHostClientTests { metadataPolicy: .preferAvailable, presentationFeedbackPolicy: .requestWhenAvailable ) - let damage = WaylandGraphicsDamageRegion(rects: []) - let metadata = WaylandGraphicsFrameMetadata(damage: damage) + let metadata = SurfaceFrameMetadata() #expect(displayConfiguration.eventStreams == streams) #expect(windowConfiguration.initialSize.width.rawValue == 128) #expect(popupConfiguration.positioner.size.width.rawValue == 64) #expect(graphicsConfiguration.presentationPolicy == .software) - #expect(metadata.damage == .fullFrame) + #expect(metadata.damage == nil) } @Test diff --git a/IntegrationTests/GraphicsPreviewClient/Tests/WaylandGraphicsPreviewClientTests/WaylandGraphicsPreviewClientTests.swift b/IntegrationTests/GraphicsPreviewClient/Tests/WaylandGraphicsPreviewClientTests/WaylandGraphicsPreviewClientTests.swift index 581f44cc..255cb518 100644 --- a/IntegrationTests/GraphicsPreviewClient/Tests/WaylandGraphicsPreviewClientTests/WaylandGraphicsPreviewClientTests.swift +++ b/IntegrationTests/GraphicsPreviewClient/Tests/WaylandGraphicsPreviewClientTests/WaylandGraphicsPreviewClientTests.swift @@ -87,14 +87,13 @@ struct WaylandGraphicsPreviewClientTests { metadataPolicy: .preferAvailable, presentationFeedbackPolicy: .requestWhenAvailable ) - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( contentType: .video, presentationHint: .async, alpha: .opaque, - colorRepresentation: WaylandGraphicsColorRepresentation( + colorRepresentation: SurfaceColorRepresentation( alphaMode: .premultipliedElectrical - ), - damage: .fullFrame + ) ) let schedule = WaylandGraphicsFrameSchedule( synchronization: .preferExplicit, @@ -132,7 +131,7 @@ struct WaylandGraphicsPreviewClientTests { #expect(WaylandGraphicsReason.gbmAllocationFailed != .gbmUnavailable) #expect(metadata.contentType == .video) #expect(metadata.alpha == .opaque) - #expect(metadata.damage == .fullFrame) + #expect(metadata.damage == nil) #expect(frame == expectedFrame) #expect(result.operation == .show) #expect(result.backing == .fallback(.forcedSoftware)) @@ -154,7 +153,11 @@ struct WaylandGraphicsPreviewClientTests { let secondLease = try await backing.nextFrame() let result = try await secondLease.submitSoftware( - metadata: WaylandGraphicsFrameMetadata(damage: .fullFrame) + metadata: SurfaceFrameMetadata( + damage: try SurfaceDamageRegion([ + LogicalRect(x: 0, y: 0, width: 1, height: 1) + ]) + ) ) { frame in frame.withXRGB8888Rows { _, pixels in for index in 0.. [SoftwarePresentationOutcome] { - let simpleShow = try await window.show(requestPresentationFeedback: true) { _ in () } - let simpleRedraw = try await window.redraw(requestPresentationFeedback: true) { _ in () } - let simpleDamagedShow = try await window.show( - damage: nil, + let dirtyRectangle = try LogicalRect(x: 0, y: 0, width: 1, height: 1) + let metadata = SurfaceFrameMetadata( + contentType: .photo, + presentationHint: .vsync, + alpha: .opaque, + colorRepresentation: SurfaceColorRepresentation( + alphaMode: .premultipliedElectrical + ), + damage: try SurfaceDamageRegion([dirtyRectangle]) + ) + + let simpleShow = try await window.show( + metadata: metadata, requestPresentationFeedback: true, timeoutMilliseconds: 1_000 ) { _ in () } - let simpleDamagedRedraw = try await window.redraw( - damage: nil, + let simpleRedraw = try await window.redraw( + metadata: metadata, requestPresentationFeedback: true ) { _ in () } - let shown = try await window.show( - requestPresentationFeedback: true, - preparing: { reservation in reservation.id }, - { _, _ in () } - ) - let redrawn = try await window.redraw( + let preparedShow = try await window.show( + metadata: metadata, requestPresentationFeedback: true, - preparing: { reservation in reservation.id }, - { _, _ in () } - ) - let damagedShow = try await window.show( - damage: nil, timeoutMilliseconds: 1_000, - requestPresentationFeedback: true, preparing: { reservation in reservation.id }, { _, _ in () } ) - let damagedRedraw = try await window.redraw( - damage: nil, + let preparedRedraw = try await window.redraw( + metadata: metadata, requestPresentationFeedback: true, preparing: { reservation in reservation.id }, { _, _ in () } ) - return [ - simpleShow, - simpleRedraw, - simpleDamagedShow, - simpleDamagedRedraw, - shown, - redrawn, - damagedShow, - damagedRedraw, - ] + return [simpleShow, simpleRedraw, preparedShow, preparedRedraw] } } diff --git a/Sources/WaylandClient/Internal/Display/DisplayCore.swift b/Sources/WaylandClient/Internal/Display/DisplayCore.swift index 27b7fd9e..46d46ade 100644 --- a/Sources/WaylandClient/Internal/Display/DisplayCore.swift +++ b/Sources/WaylandClient/Internal/Display/DisplayCore.swift @@ -123,14 +123,16 @@ final class DisplayCore: RawInvariantFailureReporter, WindowFailureSink { func reserveSoftwareFrameForShow( _ windowID: WindowID, - timeoutMilliseconds: Int32 + timeoutMilliseconds: Int32, + metadata: SurfaceFrameMetadata = .default ) throws -> WindowSoftwareFrameReservationOutcome { try withFatalFailureFinalization { guard !isClosed, let window = surfaces.window(windowID) else { return .closed } return try window.reserveShowSoftwareFrameOnOwnerThread( - timeoutMilliseconds: timeoutMilliseconds + timeoutMilliseconds: timeoutMilliseconds, + metadata: metadata ) } } @@ -165,13 +167,16 @@ final class DisplayCore: RawInvariantFailureReporter, WindowFailureSink { } func reserveSoftwareFrameForRedraw( - _ windowID: WindowID + _ windowID: WindowID, + metadata frameMetadata: SurfaceFrameMetadata = .default ) throws -> WindowSoftwareFrameReservationOutcome { try withFatalFailureFinalization { guard !isClosed, let window = surfaces.window(windowID) else { return .closed } - return try window.reserveRedrawSoftwareFrameOnOwnerThread() + return try window.reserveRedrawSoftwareFrameOnOwnerThread( + metadata: frameMetadata + ) } } @@ -180,7 +185,7 @@ final class DisplayCore: RawInvariantFailureReporter, WindowFailureSink { _ windowID: WindowID, reservation: SoftwareFrameReservation, submitConstraints: SurfaceSubmitConstraints, - metadata: SurfaceCommitMetadata, + metadata: SurfaceFrameMetadata, requestPresentationFeedback: Bool, damage: SurfaceDamageRegion?, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void diff --git a/Sources/WaylandClient/Internal/Events/EventBroker.swift b/Sources/WaylandClient/Internal/Events/EventBroker.swift index e7edbab0..c7066372 100644 --- a/Sources/WaylandClient/Internal/Events/EventBroker.swift +++ b/Sources/WaylandClient/Internal/Events/EventBroker.swift @@ -1,4 +1,3 @@ -import Synchronization import WaylandRuntime @safe @@ -356,7 +355,7 @@ final class TypedEventBroker: Sendable { private let stream: EventStreamIdentity private let capacity: Int private let overflowStrategy: OverflowStrategy - private let state = Mutex(BrokerState()) + private let state = EventBrokerLockedState(BrokerState()) init( stream eventStream: EventStreamIdentity, diff --git a/Sources/WaylandClient/Internal/Events/EventBrokerLockedState.swift b/Sources/WaylandClient/Internal/Events/EventBrokerLockedState.swift new file mode 100644 index 00000000..d52672cd --- /dev/null +++ b/Sources/WaylandClient/Internal/Events/EventBrokerLockedState.swift @@ -0,0 +1,21 @@ +import Foundation + +// SAFETY: `value` is private and every access is protected by an `NSLock` +// acquired before Swift begins the sanitizer-visible inout access. +@safe +final class EventBrokerLockedState: @unchecked Sendable { + private let lock = NSLock() + private var value: State + + init(_ initialValue: consuming State) { + value = initialValue + } + + func withLock( + _ body: (inout State) throws -> Result + ) rethrows -> Result { + lock.lock() + defer { lock.unlock() } + return try body(&value) + } +} diff --git a/Sources/WaylandClient/Internal/Surfaces/SurfaceCommitMetadata.swift b/Sources/WaylandClient/Internal/Surfaces/SurfaceCommitMetadata.swift index 8ea15b20..2bd08460 100644 --- a/Sources/WaylandClient/Internal/Surfaces/SurfaceCommitMetadata.swift +++ b/Sources/WaylandClient/Internal/Surfaces/SurfaceCommitMetadata.swift @@ -1,43 +1,21 @@ import WaylandRaw -package struct SurfaceContentType: Equatable, Hashable, Sendable { - package let rawValue: UInt32 - - package static let none = Self(rawValue: 0) - package static let photo = Self(rawValue: 1) - package static let video = Self(rawValue: 2) - package static let game = Self(rawValue: 3) - - package init(rawValue value: UInt32) { - rawValue = value - } - +extension SurfaceContentType { var rawContentType: RawContentType { - RawContentType(rawValue: rawValue) - } - - var isValidOutboundValue: Bool { - Self.validOutboundValues.contains(self) + switch self { + case .none: + RawContentType(rawValue: 0) + case .photo: + RawContentType(rawValue: 1) + case .video: + RawContentType(rawValue: 2) + case .game: + RawContentType(rawValue: 3) + } } - - private static let validOutboundValues: Set = [ - .none, - .photo, - .video, - .game, - ] } -package struct SurfaceAlphaMultiplier: Equatable, Sendable { - package let rawValue: UInt32 - - package static let opaque = Self(rawValue: UInt32.max) - package static let transparent = Self(rawValue: 0) - - package init(rawValue value: UInt32) { - rawValue = value - } - +extension SurfaceAlphaMultiplier { var rawMultiplier: RawAlphaMultiplier { RawAlphaMultiplier(rawValue: rawValue) } @@ -51,10 +29,7 @@ package struct SurfaceAlphaMetadata: Equatable, Sendable { } } -package enum SurfacePresentationHint: Equatable, Sendable { - case vsync - case async - +extension SurfacePresentationHint { var rawPresentationHint: RawPresentationHint { switch self { case .vsync: @@ -169,23 +144,6 @@ package struct SurfaceChromaLocation: Equatable, Hashable, Sendable { ] } -package struct SurfaceColorRepresentation: Equatable, Sendable { - package var alphaMode: SurfaceAlphaMode? - package var coefficientsAndRange: SurfaceMatrixCoefficientsAndRange? - package var chromaLocation: SurfaceChromaLocation? - - package init( - alphaMode surfaceAlphaMode: SurfaceAlphaMode? = nil, - coefficientsAndRange surfaceCoefficientsAndRange: - SurfaceMatrixCoefficientsAndRange? = nil, - chromaLocation surfaceChromaLocation: SurfaceChromaLocation? = nil - ) { - alphaMode = surfaceAlphaMode - coefficientsAndRange = surfaceCoefficientsAndRange - chromaLocation = surfaceChromaLocation - } -} - package struct SurfaceImageDescriptionIdentity: Equatable, Hashable, Sendable { package let rawValue: UInt64 @@ -241,9 +199,6 @@ package struct SurfaceCommitMetadata: Equatable, Sendable { if contentType != nil, capabilities.contentType == .unavailable { throw .contentTypeUnavailable } - if let contentType, !contentType.isValidOutboundValue { - throw .unsupportedContentType(contentType) - } if alpha != nil, capabilities.alphaModifier == .unavailable { throw .alphaModifierUnavailable } @@ -277,7 +232,7 @@ extension SurfaceColorRepresentation { throw .colorRepresentationUnavailable } - if let alphaMode, !support.alphaModes.contains(alphaMode) { + if let alphaMode = storedAlphaMode, !support.alphaModes.contains(alphaMode) { throw .unsupportedAlphaMode(alphaMode) } if let coefficientsAndRange, @@ -313,7 +268,6 @@ package enum SurfaceCommitMetadataError: Error, Equatable, Sendable, message: String ) case invalidColorDescriptionIdentity(UInt64) - case unsupportedContentType(SurfaceContentType) case unsupportedAlphaMode(SurfaceAlphaMode) case unsupportedCoefficientsAndRange(SurfaceMatrixCoefficientsAndRange) case unsupportedChromaLocation(SurfaceChromaLocation) @@ -351,8 +305,6 @@ package enum SurfaceCommitMetadataError: Error, Equatable, Sendable, + "\(cause.rawValue): \(message)" case .invalidColorDescriptionIdentity(let identity): "color description identity \(identity) is invalid" - case .unsupportedContentType(let contentType): - "content type \(contentType.rawValue) is not supported for outbound commits" case .unsupportedAlphaMode(let alphaMode): "alpha mode \(alphaMode.rawValue) is not supported by the compositor" case .unsupportedCoefficientsAndRange(let coefficientsAndRange): diff --git a/Sources/WaylandClient/Internal/Surfaces/SurfaceMetadataObjects.swift b/Sources/WaylandClient/Internal/Surfaces/SurfaceMetadataObjects.swift index f2fce479..5f934d0a 100644 --- a/Sources/WaylandClient/Internal/Surfaces/SurfaceMetadataObjects.swift +++ b/Sources/WaylandClient/Internal/Surfaces/SurfaceMetadataObjects.swift @@ -146,7 +146,7 @@ struct SurfaceMetadataObjects { return ResolvedSurfaceColorRepresentation( object: object, - alphaMode: representation.alphaMode?.rawAlphaMode, + alphaMode: representation.storedAlphaMode?.rawAlphaMode, coefficientsAndRange: representation.coefficientsAndRange?.rawCoefficientsAndRange, chromaLocation: representation.chromaLocation?.rawChromaLocation diff --git a/Sources/WaylandClient/Internal/Windowing/TopLevelWindow.swift b/Sources/WaylandClient/Internal/Windowing/TopLevelWindow.swift index fc84ff9b..0a14c085 100644 --- a/Sources/WaylandClient/Internal/Windowing/TopLevelWindow.swift +++ b/Sources/WaylandClient/Internal/Windowing/TopLevelWindow.swift @@ -533,10 +533,13 @@ package final class TopLevelWindow { return presentationRequest } - private func reserveSoftwareFrameForCurrentRedraw() + private func reserveSoftwareFrameForCurrentRedraw( + metadata frameMetadata: SurfaceFrameMetadata = .default + ) throws -> WindowSoftwareFrameReservationOutcome { guard !model.isClosed else { return .closed } + try validateSurfaceFrameMetadataSupport(frameMetadata) guard let request = try consumeSoftwarePresentationRequest() else { return .deferred } try interpretWindowEffects( @@ -545,13 +548,14 @@ package final class TopLevelWindow { do { let geometry = try surfaceGeometry(logicalSize: request.configuration.size) + try frameMetadata.damage?.validate(within: geometry) let result = try softwarePresenter().reserve( context: WindowSoftwarePresentationContext( request: request, geometry: geometry, submitConstraints: .default, - metadata: .default, - damage: nil, + metadata: frameMetadata.surfaceCommitMetadata, + damage: frameMetadata.damage, presentationFeedback: nil ), reservationID: softwarePresentationCoordinator.allocateIdentity(), @@ -681,6 +685,7 @@ package final class TopLevelWindow { presentationFeedback: WindowPresentationFeedbackCommitRequest?, _ draw: (borrowing SoftwareFrame) throws -> Void ) throws -> RedrawOutcome { + try validateSurfaceCommitMetadataSupport(metadata) try interpretWindowEffects( model.reduce(.presentationStarted(request)) ) @@ -768,7 +773,7 @@ package final class TopLevelWindow { private func submitReservedSoftwareFrame( _ reservation: SoftwareFrameReservation, submitConstraints: SurfaceSubmitConstraints, - metadata: SurfaceCommitMetadata, + metadata frameMetadata: SurfaceFrameMetadata, damage: SurfaceDamageRegion?, makePresentationFeedback: () throws -> WindowPresentationFeedbackCommitRequest?, _ draw: (borrowing SoftwareFrame) throws -> Void @@ -787,6 +792,7 @@ package final class TopLevelWindow { guard try isCurrentSoftwarePresentation(pendingReservation) else { return try supersedeSoftwarePresentation(pendingReservation) } + try validateSurfaceFrameMetadataSupport(frameMetadata) let successStagingContext = softwarePresentationSuccessStagingContext() let presentationFeedback = try makePresentationFeedback() @@ -796,7 +802,7 @@ package final class TopLevelWindow { request: pendingReservation.request, geometry: pendingReservation.geometry, submitConstraints: submitConstraints, - metadata: metadata, + metadata: frameMetadata.surfaceCommitMetadata, damage: damage, presentationFeedback: presentationFeedback ), @@ -1810,6 +1816,20 @@ extension TopLevelWindow { } } + private func validateSurfaceFrameMetadataSupport( + _ metadata: SurfaceFrameMetadata + ) throws { + refreshMetadataCapabilitiesFromBoundGlobals() + try metadata.validate(capabilities: surfaceRuntime.capabilitySnapshot()) + } + + private func validateSurfaceCommitMetadataSupport( + _ metadata: SurfaceCommitMetadata + ) throws { + refreshMetadataCapabilitiesFromBoundGlobals() + try metadata.validate(capabilities: surfaceRuntime.capabilitySnapshot()) + } + private func refreshMetadataCapabilitiesFromBoundGlobals() { guard let extensions = connection.boundGlobals?.extensions else { surfaceRuntime.setContentTypeCapability(.unavailable) @@ -2155,6 +2175,7 @@ extension TopLevelWindow { _ draw: (borrowing SoftwareFrame) throws -> Void ) throws { connection.preconditionIsOwnerThread() + try validateSurfaceCommitMetadataSupport(metadata) if model.currentConfiguration == nil { _ = try waitForInitialConfigure(timeoutMilliseconds: timeoutMilliseconds) @@ -2170,15 +2191,17 @@ extension TopLevelWindow { } package func reserveShowSoftwareFrameOnOwnerThread( - timeoutMilliseconds: Int32 = defaultConfigureTimeoutMS + timeoutMilliseconds: Int32 = defaultConfigureTimeoutMS, + metadata frameMetadata: SurfaceFrameMetadata = .default ) throws -> WindowSoftwareFrameReservationOutcome { connection.preconditionIsOwnerThread() + try validateSurfaceFrameMetadataSupport(frameMetadata) if model.currentConfiguration == nil { _ = try waitForInitialConfigure(timeoutMilliseconds: timeoutMilliseconds) } - return try reserveSoftwareFrameForCurrentRedraw() + return try reserveSoftwareFrameForCurrentRedraw(metadata: frameMetadata) } package func setInputRegionOnOwnerThread(_ region: SurfaceRegion?) throws { @@ -2214,6 +2237,7 @@ extension TopLevelWindow { connection.preconditionIsOwnerThread() guard !model.isClosed else { return } + try validateSurfaceCommitMetadataSupport(metadata) _ = try consumeLatestConfigureIfAvailable() _ = try drawAndPresent( @@ -2225,21 +2249,24 @@ extension TopLevelWindow { ) } - package func reserveRedrawSoftwareFrameOnOwnerThread() + package func reserveRedrawSoftwareFrameOnOwnerThread( + metadata frameMetadata: SurfaceFrameMetadata = .default + ) throws -> WindowSoftwareFrameReservationOutcome { connection.preconditionIsOwnerThread() guard !model.isClosed else { return .closed } + try validateSurfaceFrameMetadataSupport(frameMetadata) _ = try consumeLatestConfigureIfAvailable() - return try reserveSoftwareFrameForCurrentRedraw() + return try reserveSoftwareFrameForCurrentRedraw(metadata: frameMetadata) } package func submitReservedSoftwareFrameOnOwnerThread( _ reservation: SoftwareFrameReservation, submitConstraints: SurfaceSubmitConstraints = .default, - metadata: SurfaceCommitMetadata = .default, + metadata: SurfaceFrameMetadata = .default, damage: SurfaceDamageRegion? = nil, makePresentationFeedback: () throws -> WindowPresentationFeedbackCommitRequest? = { nil }, _ draw: (borrowing SoftwareFrame) throws -> Void diff --git a/Sources/WaylandClient/Internal/Windowing/WindowSoftwarePresenter.swift b/Sources/WaylandClient/Internal/Windowing/WindowSoftwarePresenter.swift index 285c666c..25649f5b 100644 --- a/Sources/WaylandClient/Internal/Windowing/WindowSoftwarePresenter.swift +++ b/Sources/WaylandClient/Internal/Windowing/WindowSoftwarePresenter.swift @@ -31,6 +31,7 @@ struct WindowSoftwarePresenter { ) ) } + try validatePresentation(context, runtime: runtime) let pool = try runtime.sharedMemoryPool(for: context.geometry.bufferSize) { try createSharedMemoryPool(context.geometry.bufferSize) @@ -141,6 +142,7 @@ struct WindowSoftwarePresenter { ) ) } + try validatePresentation(context, runtime: runtime) try drawReservedFrame(reservedFrame, geometry: context.geometry, draw: draw) @@ -177,6 +179,14 @@ struct WindowSoftwarePresenter { ) } + private func validatePresentation( + _ context: WindowSoftwarePresentationContext, + runtime: borrowing SurfaceRuntime + ) throws { + try context.metadata.validate(capabilities: runtime.capabilitySnapshot()) + try context.damage?.validate(within: context.geometry) + } + private func performPreparedCommit( context: WindowSoftwareCommitContext, stageSuccess: (RedrawBufferAvailability) throws -> Void, diff --git a/Sources/WaylandClient/Public/Display/WaylandDisplay+SoftwarePresentation.swift b/Sources/WaylandClient/Public/Display/WaylandDisplay+SoftwarePresentation.swift index 37d49037..4c7cf183 100644 --- a/Sources/WaylandClient/Public/Display/WaylandDisplay+SoftwarePresentation.swift +++ b/Sources/WaylandClient/Public/Display/WaylandDisplay+SoftwarePresentation.swift @@ -38,12 +38,14 @@ extension WaylandDisplay { package func reserveSoftwareFrameForShow( _ windowID: WindowID, - timeoutMilliseconds: Int32 + timeoutMilliseconds: Int32, + metadata: SurfaceFrameMetadata = .default ) throws -> WindowSoftwareFrameReservationOutcome { guard let core = coreIfActive() else { return .closed } return try core.reserveSoftwareFrameForShow( windowID, - timeoutMilliseconds: timeoutMilliseconds + timeoutMilliseconds: timeoutMilliseconds, + metadata: metadata ) } @@ -80,10 +82,14 @@ extension WaylandDisplay { } package func reserveSoftwareFrameForRedraw( - _ windowID: WindowID + _ windowID: WindowID, + metadata frameMetadata: SurfaceFrameMetadata = .default ) throws -> WindowSoftwareFrameReservationOutcome { guard let core = coreIfActive() else { return .closed } - return try core.reserveSoftwareFrameForRedraw(windowID) + return try core.reserveSoftwareFrameForRedraw( + windowID, + metadata: frameMetadata + ) } // swiftlint:disable:next function_parameter_count @@ -91,7 +97,7 @@ extension WaylandDisplay { _ windowID: WindowID, reservation: SoftwareFrameReservation, submitConstraints: SurfaceSubmitConstraints, - metadata: SurfaceCommitMetadata, + metadata: SurfaceFrameMetadata, requestPresentationFeedback: Bool, damage: SurfaceDamageRegion? = nil, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void diff --git a/Sources/WaylandClient/Public/Rendering/SurfaceFrameMetadata.swift b/Sources/WaylandClient/Public/Rendering/SurfaceFrameMetadata.swift new file mode 100644 index 00000000..1bc9a455 --- /dev/null +++ b/Sources/WaylandClient/Public/Rendering/SurfaceFrameMetadata.swift @@ -0,0 +1,244 @@ +/// Renderer-neutral metadata applied to one surface frame commit. +/// +/// `damage == nil` is the only full-frame damage representation. A non-`nil` +/// damage region always contains one or more validated logical rectangles. +public struct SurfaceFrameMetadata: Equatable, Sendable { + /// The compositor-facing semantic class of the frame's content. + public var contentType: SurfaceContentType? + /// Whether presentation should remain synchronized or may tear. + public var presentationHint: SurfacePresentationHint? + /// The multiplier applied to the committed surface's alpha channel. + public var alpha: SurfaceAlphaMultiplier? + /// Color-representation facts that accompany the committed buffer. + public var colorRepresentation: SurfaceColorRepresentation? + package var colorDescription: SurfaceColorDescriptionReference? + /// Logical rectangles changed by this frame, or `nil` for the full frame. + public var damage: SurfaceDamageRegion? + + /// Metadata that requests no optional protocol state and full-frame damage. + public static let `default` = SurfaceFrameMetadata() + + /// Creates renderer-neutral metadata for one surface frame. + public init( + contentType surfaceContentType: SurfaceContentType? = nil, + presentationHint surfacePresentationHint: SurfacePresentationHint? = nil, + alpha surfaceAlpha: SurfaceAlphaMultiplier? = nil, + colorRepresentation surfaceColorRepresentation: SurfaceColorRepresentation? = nil, + damage surfaceDamage: SurfaceDamageRegion? = nil + ) { + contentType = surfaceContentType + presentationHint = surfacePresentationHint + alpha = surfaceAlpha + colorRepresentation = surfaceColorRepresentation + colorDescription = nil + damage = surfaceDamage + } + + package init( + colorDescription surfaceColorDescription: SurfaceColorDescriptionReference?, + contentType surfaceContentType: SurfaceContentType? = nil, + presentationHint surfacePresentationHint: SurfacePresentationHint? = nil, + alpha surfaceAlpha: SurfaceAlphaMultiplier? = nil, + colorRepresentation surfaceColorRepresentation: SurfaceColorRepresentation? = nil, + damage surfaceDamage: SurfaceDamageRegion? = nil + ) { + contentType = surfaceContentType + presentationHint = surfacePresentationHint + alpha = surfaceAlpha + colorRepresentation = surfaceColorRepresentation + colorDescription = surfaceColorDescription + damage = surfaceDamage + } +} + +/// A semantic content classification supplied to the compositor. +public enum SurfaceContentType: Equatable, Sendable { + /// No specialized content classification. + case none + /// A still photographic image. + case photo + /// Moving video content. + case video + /// Latency-sensitive game content. + case game +} + +/// A compositor presentation-mode hint for one frame. +public enum SurfacePresentationHint: Equatable, Sendable { + /// Synchronize presentation to avoid tearing. + case vsync + /// Permit asynchronous presentation and tearing. + case async +} + +/// A fixed-point multiplier applied to a surface's alpha channel. +public struct SurfaceAlphaMultiplier: Equatable, Sendable { + /// The protocol fixed-point representation of the multiplier. + public let rawValue: UInt32 + + /// Fully opaque surface content. + public static let opaque = Self(rawValue: .max) + /// Fully transparent surface content. + public static let transparent = Self(rawValue: 0) + + /// Creates a multiplier from its protocol fixed-point representation. + public init(rawValue alphaMultiplierRawValue: UInt32) { + rawValue = alphaMultiplierRawValue + } +} + +/// The alpha interpretation used by a surface color representation. +public enum SurfaceColorAlphaMode: Equatable, Sendable { + /// Alpha-premultiplied values in electrical space. + case premultipliedElectrical + /// Alpha-premultiplied values in optical space. + case premultipliedOptical + /// Straight, non-premultiplied alpha values. + case straight +} + +/// Public color-representation facts attached to a surface frame. +public struct SurfaceColorRepresentation: Equatable, Sendable { + package var storedAlphaMode: SurfaceAlphaMode? + package var coefficientsAndRange: SurfaceMatrixCoefficientsAndRange? + package var chromaLocation: SurfaceChromaLocation? + + /// The frame's alpha interpretation, when one is explicitly requested. + public var alphaMode: SurfaceColorAlphaMode? { + get { storedAlphaMode?.publicValue } + set { storedAlphaMode = newValue?.surfaceValue } + } + + /// Creates a color representation with an optional alpha interpretation. + public init(alphaMode colorAlphaMode: SurfaceColorAlphaMode? = nil) { + storedAlphaMode = colorAlphaMode?.surfaceValue + coefficientsAndRange = nil + chromaLocation = nil + } + + package init( + rawAlphaMode surfaceAlphaMode: SurfaceAlphaMode? = nil, + coefficientsAndRange surfaceCoefficientsAndRange: SurfaceMatrixCoefficientsAndRange? = nil, + chromaLocation surfaceChromaLocation: SurfaceChromaLocation? = nil + ) { + storedAlphaMode = surfaceAlphaMode + coefficientsAndRange = surfaceCoefficientsAndRange + chromaLocation = surfaceChromaLocation + } +} + +/// A typed failure raised before direct window presentation when explicitly +/// requested surface metadata is unsupported by the compositor. +public enum SurfaceFrameMetadataError: Error, Equatable, Sendable, + CustomStringConvertible +{ + /// The compositor does not expose the content-type protocol. + case contentTypeUnavailable + /// The compositor does not expose the tearing-control protocol. + case presentationHintUnavailable + /// The compositor does not expose the alpha-modifier protocol. + case alphaMultiplierUnavailable + /// The compositor does not expose the color-representation protocol. + case colorRepresentationUnavailable + /// Color-representation support discovery has not completed. + case colorRepresentationSupportPending + /// The compositor did not advertise the requested color alpha mode. + case unsupportedColorAlphaMode(SurfaceColorAlphaMode) + + /// Human-readable diagnostic text for the unsupported metadata request. + public var description: String { + switch self { + case .contentTypeUnavailable: + "content-type protocol is unavailable" + case .presentationHintUnavailable: + "tearing-control protocol is unavailable" + case .alphaMultiplierUnavailable: + "alpha-modifier protocol is unavailable" + case .colorRepresentationUnavailable: + "color-representation protocol is unavailable" + case .colorRepresentationSupportPending: + "color-representation support discovery is pending" + case .unsupportedColorAlphaMode(let alphaMode): + "color alpha mode \(alphaMode) is not supported by the compositor" + } + } +} + +extension SurfaceFrameMetadata { + package var surfaceCommitMetadata: SurfaceCommitMetadata { + SurfaceCommitMetadata( + contentType: contentType, + alpha: alpha.map(SurfaceAlphaMetadata.init(multiplier:)), + colorRepresentation: colorRepresentation, + colorDescription: colorDescription, + presentationHint: presentationHint + ) + } + + package var hasCommitMetadata: Bool { + contentType != nil + || presentationHint != nil + || alpha != nil + || colorRepresentation != nil + || colorDescription != nil + } + + package func validate( + capabilities: SurfaceCapabilitySnapshot + ) throws(SurfaceFrameMetadataError) { + if contentType != nil, capabilities.contentType == .unavailable { + throw .contentTypeUnavailable + } + if presentationHint != nil, capabilities.tearingControl == .unavailable { + throw .presentationHintUnavailable + } + if alpha != nil, capabilities.alphaModifier == .unavailable { + throw .alphaMultiplierUnavailable + } + guard let colorRepresentation else { return } + + let support: SurfaceColorRepresentationSupport + switch capabilities.colorRepresentation { + case .unavailable: + throw .colorRepresentationUnavailable + case .pending: + throw .colorRepresentationSupportPending + case .available(_, let availableSupport): + support = availableSupport + } + + if let alphaMode = colorRepresentation.alphaMode, + !support.alphaModes.contains(alphaMode.surfaceValue) + { + throw .unsupportedColorAlphaMode(alphaMode) + } + } +} + +extension SurfaceColorAlphaMode { + package var surfaceValue: SurfaceAlphaMode { + switch self { + case .premultipliedElectrical: + .premultipliedElectrical + case .premultipliedOptical: + .premultipliedOptical + case .straight: + .straight + } + } +} + +extension SurfaceAlphaMode { + package var publicValue: SurfaceColorAlphaMode? { + if self == .premultipliedElectrical { + return .premultipliedElectrical + } + if self == .premultipliedOptical { + return .premultipliedOptical + } + if self == .straight { + return .straight + } + return nil + } +} diff --git a/Sources/WaylandClient/Public/Window/Window+SoftwareFramePreparation.swift b/Sources/WaylandClient/Public/Window/Window+SoftwareFramePreparation.swift index aa39c468..567e9b66 100644 --- a/Sources/WaylandClient/Public/Window/Window+SoftwareFramePreparation.swift +++ b/Sources/WaylandClient/Public/Window/Window+SoftwareFramePreparation.swift @@ -14,29 +14,15 @@ public enum SoftwarePresentationOutcome: Equatable, Sendable { extension Window { @discardableResult public func show( - requestPresentationFeedback: Bool, + metadata frameMetadata: SurfaceFrameMetadata = .default, + requestPresentationFeedback: Bool = false, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void ) async throws -> SoftwarePresentationOutcome { try await show( - damage: nil, + metadata: frameMetadata, requestPresentationFeedback: requestPresentationFeedback, timeoutMilliseconds: timeoutMilliseconds, - draw - ) - } - - @discardableResult - public func show( - damage: SurfaceDamageRegion?, - requestPresentationFeedback: Bool, - timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, - _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void - ) async throws -> SoftwarePresentationOutcome { - try await show( - damage: damage, - timeoutMilliseconds: timeoutMilliseconds, - requestPresentationFeedback: requestPresentationFeedback, preparing: { _ in () }, { _, frame in try draw(frame) @@ -46,31 +32,20 @@ extension Window { @discardableResult public func show( - timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, + metadata frameMetadata: SurfaceFrameMetadata = .default, requestPresentationFeedback: Bool = false, - preparing prepare: sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, - _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void - ) async throws -> SoftwarePresentationOutcome { - try await show( - damage: nil, - timeoutMilliseconds: timeoutMilliseconds, - requestPresentationFeedback: requestPresentationFeedback, - preparing: prepare, - draw - ) - } - - @discardableResult - public func show( - damage: SurfaceDamageRegion?, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, - requestPresentationFeedback: Bool = false, preparing prepare: sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, - _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void + _ draw: + sending @Sendable ( + Prepared, + borrowing SoftwareFrame + ) throws -> Void ) async throws -> SoftwarePresentationOutcome { let reservationOutcome = try await display.reserveSoftwareFrameForShow( id, - timeoutMilliseconds: timeoutMilliseconds + timeoutMilliseconds: timeoutMilliseconds, + metadata: frameMetadata ) let reservation: SoftwareFrameReservation switch reservationOutcome { @@ -88,9 +63,9 @@ extension Window { id, reservation: reservation, submitConstraints: .default, - metadata: .default, + metadata: frameMetadata, requestPresentationFeedback: requestPresentationFeedback, - damage: damage + damage: frameMetadata.damage ) { frame in try draw(prepared, frame) } @@ -107,24 +82,12 @@ extension Window { @discardableResult public func redraw( - requestPresentationFeedback: Bool, - _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void - ) async throws -> SoftwarePresentationOutcome { - try await redraw( - damage: nil, - requestPresentationFeedback: requestPresentationFeedback, - draw - ) - } - - @discardableResult - public func redraw( - damage: SurfaceDamageRegion?, - requestPresentationFeedback: Bool, + metadata frameMetadata: SurfaceFrameMetadata = .default, + requestPresentationFeedback: Bool = false, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void ) async throws -> SoftwarePresentationOutcome { try await redraw( - damage: damage, + metadata: frameMetadata, requestPresentationFeedback: requestPresentationFeedback, preparing: { _ in () }, { _, frame in @@ -135,26 +98,19 @@ extension Window { @discardableResult public func redraw( + metadata frameMetadata: SurfaceFrameMetadata = .default, requestPresentationFeedback: Bool = false, preparing prepare: sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, - _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void + _ draw: + sending @Sendable ( + Prepared, + borrowing SoftwareFrame + ) throws -> Void ) async throws -> SoftwarePresentationOutcome { - try await redraw( - damage: nil, - requestPresentationFeedback: requestPresentationFeedback, - preparing: prepare, - draw + let reservationOutcome = try await display.reserveSoftwareFrameForRedraw( + id, + metadata: frameMetadata ) - } - - @discardableResult - public func redraw( - damage: SurfaceDamageRegion?, - requestPresentationFeedback: Bool = false, - preparing prepare: sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, - _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void - ) async throws -> SoftwarePresentationOutcome { - let reservationOutcome = try await display.reserveSoftwareFrameForRedraw(id) let reservation: SoftwareFrameReservation switch reservationOutcome { case .reserved(let reservedFrame): @@ -171,9 +127,9 @@ extension Window { id, reservation: reservation, submitConstraints: .default, - metadata: .default, + metadata: frameMetadata, requestPresentationFeedback: requestPresentationFeedback, - damage: damage + damage: frameMetadata.damage ) { frame in try draw(prepared, frame) } diff --git a/Sources/WaylandClient/Public/Window/Window.swift b/Sources/WaylandClient/Public/Window/Window.swift index 0aa8bde3..9b945323 100644 --- a/Sources/WaylandClient/Public/Window/Window.swift +++ b/Sources/WaylandClient/Public/Window/Window.swift @@ -16,29 +16,6 @@ public struct Window: Sendable, Hashable { ownership.isOwned(by: owningDisplay) } - public func show( - timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, - _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void - ) async throws { - try await display.showWindow(id, timeoutMilliseconds: timeoutMilliseconds, draw) - } - - public func show( - damage: SurfaceDamageRegion?, - timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, - _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void - ) async throws { - try await display.showWindow( - id, - timeoutMilliseconds: timeoutMilliseconds, - submitConstraints: .default, - metadata: .default, - requestPresentationFeedback: false, - damage: damage, - draw - ) - } - package func show( timeoutMilliseconds: Int32, submitConstraints: SurfaceSubmitConstraints, @@ -58,26 +35,6 @@ public struct Window: Sendable, Hashable { ) } - public func redraw( - _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void - ) async throws { - try await display.redraw(id, draw) - } - - public func redraw( - damage: SurfaceDamageRegion?, - _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void - ) async throws { - try await display.redraw( - id, - submitConstraints: .default, - metadata: .default, - requestPresentationFeedback: false, - damage: damage, - draw - ) - } - package func redraw( submitConstraints: SurfaceSubmitConstraints, metadata: SurfaceCommitMetadata, diff --git a/Sources/WaylandClient/WaylandClient.docc/PresentationFeedbackAndFrameCallbacks.md b/Sources/WaylandClient/WaylandClient.docc/PresentationFeedbackAndFrameCallbacks.md index 9e1641e2..ed65699c 100644 --- a/Sources/WaylandClient/WaylandClient.docc/PresentationFeedbackAndFrameCallbacks.md +++ b/Sources/WaylandClient/WaylandClient.docc/PresentationFeedbackAndFrameCallbacks.md @@ -26,8 +26,8 @@ Frameworks own animation, frame budgeting, and fallback scheduling. For asynchronously prepared software frames, pass `requestPresentationFeedback: true` to -``Window/show(damage:timeoutMilliseconds:requestPresentationFeedback:preparing:_:)`` -or ``Window/redraw(damage:requestPresentationFeedback:preparing:_:)``. The +``Window/show(metadata:requestPresentationFeedback:timeoutMilliseconds:preparing:_:)`` +or ``Window/redraw(metadata:requestPresentationFeedback:preparing:_:)``. The feedback object is requested inside the same callback-feedback-commit sequence as the accepted frame. Superseded, deferred, and closed attempts request neither feedback nor a frame callback and do not commit. Requesting feedback throws when diff --git a/Sources/WaylandClient/WaylandClient.docc/SurfaceRegionsAndDamage.md b/Sources/WaylandClient/WaylandClient.docc/SurfaceRegionsAndDamage.md index 880cbff8..536baeb3 100644 --- a/Sources/WaylandClient/WaylandClient.docc/SurfaceRegionsAndDamage.md +++ b/Sources/WaylandClient/WaylandClient.docc/SurfaceRegionsAndDamage.md @@ -6,9 +6,10 @@ publishes logical rectangles that changed between frames. Use ``Window/setInputRegion(_:)`` when only part of a window should receive pointer targeting from the compositor. Use ``Window/setOpaqueRegion(_:)`` when -rectangles are fully opaque and the compositor can optimize composition. Use -``Window/redraw(damage:_:)`` when an already-shown window only changed part of -its surface. +rectangles are fully opaque and the compositor can optimize composition. Pass a +``SurfaceFrameMetadata`` value with non-`nil` damage to +``Window/redraw(metadata:requestPresentationFeedback:_:)`` when an already-shown +window only changed part of its surface. ## Capability Gate @@ -18,8 +19,8 @@ the current ``SurfaceGeometry`` and maps logical rectangles to buffer coordinates for the active scale. Invalid rectangles and out-of-bounds damage are reported as typed client errors. -WaylandClientKit owns coordinate conversion, clipping, and the first-frame full -damage rule. +WaylandClientKit owns coordinate conversion and clipping. A `nil` metadata +damage value is the only full-frame representation. ## Example diff --git a/Sources/WaylandClient/WaylandClient.docc/WaylandClient.md b/Sources/WaylandClient/WaylandClient.docc/WaylandClient.md index b45dbc37..f47fbf19 100644 --- a/Sources/WaylandClient/WaylandClient.docc/WaylandClient.md +++ b/Sources/WaylandClient/WaylandClient.docc/WaylandClient.md @@ -50,6 +50,13 @@ targets. - ``SoftwareFrame`` - ``SoftwareFrameReservation`` - ``SoftwarePresentationOutcome`` +- ``SurfaceFrameMetadata`` +- ``SurfaceContentType`` +- ``SurfacePresentationHint`` +- ``SurfaceAlphaMultiplier`` +- ``SurfaceColorRepresentation`` +- ``SurfaceColorAlphaMode`` +- ``SurfaceFrameMetadataError`` - ``SurfaceGeometry`` - ``SurfaceScale`` - ``OutputSnapshot`` diff --git a/Sources/WaylandClient/WaylandClient.docc/WindowDrawing.md b/Sources/WaylandClient/WaylandClient.docc/WindowDrawing.md index 1698dbc8..4194310d 100644 --- a/Sources/WaylandClient/WaylandClient.docc/WindowDrawing.md +++ b/Sources/WaylandClient/WaylandClient.docc/WindowDrawing.md @@ -10,8 +10,8 @@ Each software frame reports an opaque ``SoftwareFrameBufferID`` for the borrowed SHM buffer. ``SoftwareFrame/withBuffer(_:)`` provides scoped access to XRGB8888 bytes, stride, and geometry. The byte span is valid only inside the closure. Use -``Window/show(damage:timeoutMilliseconds:requestPresentationFeedback:preparing:_:)`` -and ``Window/redraw(damage:requestPresentationFeedback:preparing:_:)`` when +``Window/show(metadata:requestPresentationFeedback:timeoutMilliseconds:preparing:_:)`` +and ``Window/redraw(metadata:requestPresentationFeedback:preparing:_:)`` when expensive scene preparation should begin after WaylandClientKit has selected the authoritative software frame geometry and reusable buffer identity. The preparation closure receives a @@ -23,10 +23,10 @@ authoritative geometry, redraw generation, and task cancellation before it borrows mutable bytes. When asynchronous preparation is unnecessary, use -``Window/show(damage:requestPresentationFeedback:timeoutMilliseconds:_:)`` or -``Window/redraw(damage:requestPresentationFeedback:_:)`` to request feedback -atomically without a no-op preparation closure. These overloads return the same -``SoftwarePresentationOutcome``. +``Window/show(metadata:requestPresentationFeedback:timeoutMilliseconds:_:)`` or +``Window/redraw(metadata:requestPresentationFeedback:_:)``. Both simple and +prepared methods return ``SoftwarePresentationOutcome``; the result is +discardable when callers do not need the terminal disposition. If the prepared generation is still current, WaylandClientKit draws, requests the frame callback and optional presentation feedback, commits the surface, and @@ -57,12 +57,14 @@ error is re-thrown. ``PopupSurface`` follows the same ownership rule as windows: it is a managed surface, but popup placement and dismissal are governed by xdg-shell. -Use ``Window/show(damage:timeoutMilliseconds:_:)`` for the first frame and -``Window/redraw(damage:_:)`` for later partial redraws. Damage is expressed as -logical ``SurfaceDamageRegion`` rectangles. WaylandClientKit validates any damage -passed to `show`; the first buffer commit uses full-frame damage. Later commits -map logical damage to scaled buffer coordinates and clip it to the surface. -Passing no damage uses the full frame. +Use ``Window/show(metadata:requestPresentationFeedback:timeoutMilliseconds:_:)`` +for the first frame and +``Window/redraw(metadata:requestPresentationFeedback:_:)`` for later partial +redraws. ``SurfaceFrameMetadata`` carries renderer-neutral surface metadata, +including logical ``SurfaceDamageRegion`` rectangles. WaylandClientKit validates +damage before drawing. `metadata.damage == nil` is the only full-frame +representation; later partial commits map logical damage to scaled buffer +coordinates and clip it to the surface. Use ``Window/setInputRegion(_:)`` and ``Window/setOpaqueRegion(_:)`` to publish surface regions to the compositor. Input regions affect compositor targeting. diff --git a/Sources/WaylandGPUPreview/GPURuntimePathSnapshot+Setup.swift b/Sources/WaylandGPUPreview/GPURuntimePathSnapshot+Setup.swift index 418e094e..5e99babc 100644 --- a/Sources/WaylandGPUPreview/GPURuntimePathSnapshot+Setup.swift +++ b/Sources/WaylandGPUPreview/GPURuntimePathSnapshot+Setup.swift @@ -295,8 +295,7 @@ extension GPURuntimePathReason { package init(_ metadataError: SurfaceCommitMetadataError) { switch metadataError { - case .contentTypeUnavailable, .contentTypeObjectUnavailable, - .unsupportedContentType: + case .contentTypeUnavailable, .contentTypeObjectUnavailable: self = .contentTypeUnavailable case .alphaModifierUnavailable, .alphaModifierObjectUnavailable: self = .alphaModifierUnavailable @@ -369,8 +368,7 @@ private func metadataRuntimePathComponent( for error: SurfaceCommitMetadataError ) -> MetadataRuntimePathComponent { switch error { - case .contentTypeUnavailable, .contentTypeObjectUnavailable, - .unsupportedContentType: + case .contentTypeUnavailable, .contentTypeObjectUnavailable: .contentType case .alphaModifierUnavailable, .alphaModifierObjectUnavailable: .alpha diff --git a/Sources/WaylandGraphicsPreview/Internal/WaylandGraphicsSubmissionStorage.swift b/Sources/WaylandGraphicsPreview/Internal/WaylandGraphicsSubmissionStorage.swift index c8071c8e..61e2400e 100644 --- a/Sources/WaylandGraphicsPreview/Internal/WaylandGraphicsSubmissionStorage.swift +++ b/Sources/WaylandGraphicsPreview/Internal/WaylandGraphicsSubmissionStorage.swift @@ -1622,6 +1622,9 @@ package actor WaylandGraphicsWindowBackingStorage { let geometry: SurfaceGeometry try leaseState.requireNotClosed() do { + try frame.validateManagedPreviewMetadataPolicy( + configuration: effectiveConfiguration + ) try await ensureWindowOpen() try await prepareInitialConfigure( leaseID: leaseID, @@ -1675,7 +1678,7 @@ package actor WaylandGraphicsWindowBackingStorage { func submitSoftware( leaseID: WaylandGraphicsFrameLeaseID, - metadata frameMetadata: WaylandGraphicsFrameMetadata, + metadata frameMetadata: SurfaceFrameMetadata, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void ) async throws -> WaylandGraphicsFrameResult { try await submitSoftware( @@ -1688,7 +1691,7 @@ package actor WaylandGraphicsWindowBackingStorage { func submitSoftware( leaseID: WaylandGraphicsFrameLeaseID, - metadata frameMetadata: WaylandGraphicsFrameMetadata, + metadata frameMetadata: SurfaceFrameMetadata, schedule frameSchedule: WaylandGraphicsFrameSchedule?, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void ) async throws -> WaylandGraphicsFrameResult { @@ -1696,6 +1699,9 @@ package actor WaylandGraphicsWindowBackingStorage { let geometry: SurfaceGeometry try leaseState.requireNotClosed() do { + try frameMetadata.validateManagedPreviewMetadataPolicy( + configuration: effectiveConfiguration + ) try await ensureWindowOpen() try rejectSoftwareSubmissionWhenUnavailable(configuration: effectiveConfiguration) @@ -1747,7 +1753,7 @@ package actor WaylandGraphicsWindowBackingStorage { leaseID: WaylandGraphicsFrameLeaseID, buffer externalBuffer: WaylandGraphicsExternalBuffer, acquireSynchronization: WaylandGraphicsExternalAcquireSynchronization?, - metadata frameMetadata: WaylandGraphicsFrameMetadata, + metadata frameMetadata: SurfaceFrameMetadata, schedule frameSchedule: WaylandGraphicsFrameSchedule? ) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt { let effectiveConfiguration = configuration.applying(schedule: frameSchedule) @@ -1755,6 +1761,9 @@ package actor WaylandGraphicsWindowBackingStorage { let operation: WaylandGraphicsFrameSubmissionOperation do { try leaseState.requireNotClosed() + try frameMetadata.validateManagedPreviewMetadataPolicy( + configuration: effectiveConfiguration + ) try await ensureWindowOpen() try requireLocalRegisteredExternalBuffer(externalBuffer) guard externalBufferRegistry.reservation(for: externalBuffer.id) == leaseID else { @@ -1882,7 +1891,7 @@ package actor WaylandGraphicsWindowBackingStorage { _ externalBuffer: WaylandGraphicsExternalBuffer, submissionID: WaylandGraphicsExternalSubmissionID, acquireSynchronization: WaylandGraphicsExternalAcquireSynchronization?, - metadata frameMetadata: WaylandGraphicsFrameMetadata, + metadata frameMetadata: SurfaceFrameMetadata, geometry: SurfaceGeometry, configuration effectiveConfiguration: WaylandGraphicsConfiguration ) async throws -> SubmittedExternalBufferFrame { @@ -2166,7 +2175,7 @@ package actor WaylandGraphicsWindowBackingStorage { geometry: geometry ) let metadata = resolvedMetadata.commitMetadata - let damage = try frame.metadata.surfaceDamageRegion() + let damage = frame.metadata.damage if shouldAttemptManagedGPU { do { _ = try await managedGPUBacking?.submitClearFrame( @@ -2249,7 +2258,7 @@ package actor WaylandGraphicsWindowBackingStorage { } private func submitSoftwareFrame( - metadata frameMetadata: WaylandGraphicsFrameMetadata, + metadata frameMetadata: SurfaceFrameMetadata, operation: WaylandGraphicsFrameSubmissionOperation, geometry: SurfaceGeometry, configuration effectiveConfiguration: WaylandGraphicsConfiguration, @@ -2261,7 +2270,7 @@ package actor WaylandGraphicsWindowBackingStorage { geometry: geometry ) let metadata = resolvedMetadata.commitMetadata - let damage = try frameMetadata.surfaceDamageRegion() + let damage = frameMetadata.damage let pacingSelection = try Self.softwarePacingSelection( policy: effectiveConfiguration.gpuPacingPolicy, capabilities: backingRuntimePath.capabilities, @@ -2374,7 +2383,7 @@ extension WaylandGraphicsWindowBackingStorage { private func prepareRegisteredExternalBufferSubmission( _ externalBuffer: WaylandGraphicsExternalBuffer, leaseID: WaylandGraphicsFrameLeaseID, - metadata frameMetadata: WaylandGraphicsFrameMetadata, + metadata frameMetadata: SurfaceFrameMetadata, geometry: SurfaceGeometry, configuration effectiveConfiguration: WaylandGraphicsConfiguration ) throws -> WaylandGraphicsFrameSubmissionOperation { @@ -2960,7 +2969,7 @@ extension WaylandGraphicsWindowBackingStorage { private func frameResult( operation: WaylandGraphicsFrameSubmissionOperation, size: PositivePixelSize, - metadata: WaylandGraphicsFrameMetadata, + metadata: SurfaceFrameMetadata, configuration effectiveConfiguration: WaylandGraphicsConfiguration ) -> WaylandGraphicsFrameResult { WaylandGraphicsFrameResult( diff --git a/Sources/WaylandGraphicsPreview/Public/WaylandGraphicsSubmission.swift b/Sources/WaylandGraphicsPreview/Public/WaylandGraphicsSubmission.swift index 533ce665..a28cab29 100644 --- a/Sources/WaylandGraphicsPreview/Public/WaylandGraphicsSubmission.swift +++ b/Sources/WaylandGraphicsPreview/Public/WaylandGraphicsSubmission.swift @@ -389,117 +389,6 @@ public struct WaylandGraphicsFrameContract: Equatable, Sendable { } } -public struct WaylandGraphicsDamageRegion: Equatable, Sendable { - public let rects: [LogicalRect] - - public static let fullFrame = WaylandGraphicsDamageRegion(rects: []) - - public init(rects damageRects: [LogicalRect]) { - rects = damageRects - } -} - -public struct WaylandGraphicsFrameMetadata: Equatable, Sendable { - public var contentType: WaylandGraphicsContentType? - public var presentationHint: WaylandGraphicsPresentationHint? - public var alpha: WaylandGraphicsAlphaModifier? - public var colorRepresentation: WaylandGraphicsColorRepresentation? - package var colorDescription: WaylandGraphicsColorDescription? - public var damage: WaylandGraphicsDamageRegion? - - public static let `default` = WaylandGraphicsFrameMetadata() - - public init( - contentType frameContentType: WaylandGraphicsContentType? = nil, - presentationHint framePresentationHint: WaylandGraphicsPresentationHint? = nil, - alpha frameAlpha: WaylandGraphicsAlphaModifier? = nil, - colorRepresentation frameColorRepresentation: - WaylandGraphicsColorRepresentation? = nil, - damage frameDamage: WaylandGraphicsDamageRegion? = nil - ) { - contentType = frameContentType - presentationHint = framePresentationHint - alpha = frameAlpha - colorRepresentation = frameColorRepresentation - colorDescription = nil - damage = frameDamage - } - - package init( - contentType frameContentType: WaylandGraphicsContentType? = nil, - presentationHint framePresentationHint: WaylandGraphicsPresentationHint? = nil, - alpha frameAlpha: WaylandGraphicsAlphaModifier? = nil, - colorRepresentation frameColorRepresentation: - WaylandGraphicsColorRepresentation? = nil, - colorDescription frameColorDescription: WaylandGraphicsColorDescription? = nil, - damage frameDamage: WaylandGraphicsDamageRegion? = nil - ) { - contentType = frameContentType - presentationHint = framePresentationHint - alpha = frameAlpha - colorRepresentation = frameColorRepresentation - colorDescription = frameColorDescription - damage = frameDamage - } -} - -public enum WaylandGraphicsContentType: Equatable, Sendable { - case none - case photo - case video - case game -} - -public enum WaylandGraphicsPresentationHint: Equatable, Sendable { - case vsync - case async -} - -public struct WaylandGraphicsAlphaModifier: Equatable, Sendable { - public let rawValue: UInt32 - - public static let opaque = Self(rawValue: UInt32.max) - public static let transparent = Self(rawValue: 0) - - public init(rawValue alphaMultiplierRawValue: UInt32) { - rawValue = alphaMultiplierRawValue - } -} - -public enum WaylandGraphicsColorAlphaMode: Equatable, Sendable { - case premultipliedElectrical - case premultipliedOptical - case straight -} - -public struct WaylandGraphicsColorRepresentation: Equatable, Sendable { - public var alphaMode: WaylandGraphicsColorAlphaMode? - - public init(alphaMode colorAlphaMode: WaylandGraphicsColorAlphaMode? = nil) { - alphaMode = colorAlphaMode - } -} - -package struct WaylandGraphicsColorDescriptionID: Equatable, Hashable, Sendable { - package let rawValue: UInt64 - - package init(rawValue colorDescriptionRawValue: UInt64) throws { - guard colorDescriptionRawValue != 0 else { - throw WaylandGraphicsError.unavailable(.invalidColorDescription) - } - - rawValue = colorDescriptionRawValue - } -} - -package struct WaylandGraphicsColorDescription: Equatable, Hashable, Sendable { - package let id: WaylandGraphicsColorDescriptionID - - package init(id colorDescriptionID: WaylandGraphicsColorDescriptionID) { - id = colorDescriptionID - } -} - public struct WaylandGraphicsXRGBColor: Equatable, Sendable { public let red: UInt8 public let green: UInt8 @@ -981,11 +870,11 @@ extension WaylandGraphicsExternalBufferDescriptor { public struct WaylandGraphicsClearFrame: Equatable, Sendable { public let color: WaylandGraphicsXRGBColor - public let metadata: WaylandGraphicsFrameMetadata + public let metadata: SurfaceFrameMetadata public init( color clearColor: WaylandGraphicsXRGBColor, - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default + metadata frameMetadata: SurfaceFrameMetadata = .default ) { color = clearColor metadata = frameMetadata @@ -999,7 +888,7 @@ public enum WaylandGraphicsSubmittedFrame: Equatable, Sendable { .clearColor(WaylandGraphicsClearFrame(color: color)) } - package var metadata: WaylandGraphicsFrameMetadata { + package var metadata: SurfaceFrameMetadata { switch self { case .clearColor(let clearFrame): clearFrame.metadata @@ -1016,7 +905,7 @@ public struct WaylandGraphicsFrameResult: Equatable, Sendable { public let runtimePath: WaylandGraphicsRuntimePath public let operation: WaylandGraphicsSubmissionOperation public let size: PositivePixelSize - public let metadata: WaylandGraphicsFrameMetadata + public let metadata: SurfaceFrameMetadata public let schedule: WaylandGraphicsFrameSchedule public let presentationFeedbackRequested: Bool public let synchronizationPolicy: WaylandGraphicsSynchronizationPolicy @@ -1029,7 +918,7 @@ public struct WaylandGraphicsFrameResult: Equatable, Sendable { runtimePath frameRuntimePath: WaylandGraphicsRuntimePath, operation frameOperation: WaylandGraphicsSubmissionOperation, size frameSize: PositivePixelSize, - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, + metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil, presentationFeedbackRequested framePresentationFeedbackRequested: Bool = false, synchronizationPolicy frameSynchronizationPolicy: @@ -1242,7 +1131,7 @@ public struct WaylandGraphicsExternalBufferRenderLease: ~Copyable, Sendable { @discardableResult public consuming func submit( - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, + metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil ) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt { try await submitTerminally( @@ -1255,7 +1144,7 @@ public struct WaylandGraphicsExternalBufferRenderLease: ~Copyable, Sendable { @discardableResult public consuming func submit( acquireSynchronization: WaylandGraphicsExternalAcquireSynchronization, - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, + metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil ) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt { try await submitTerminally( @@ -1274,7 +1163,7 @@ public struct WaylandGraphicsExternalBufferRenderLease: ~Copyable, Sendable { private consuming func submitTerminally( acquireSynchronization: WaylandGraphicsExternalAcquireSynchronization?, - metadata: WaylandGraphicsFrameMetadata, + metadata: SurfaceFrameMetadata, schedule: WaylandGraphicsFrameSchedule? ) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt { let leaseID = frameLeaseID @@ -1548,7 +1437,7 @@ public struct WaylandGraphicsFrameLease: ~Copyable, Sendable { @discardableResult public consuming func submitSoftware( - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, + metadata frameMetadata: SurfaceFrameMetadata = .default, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void ) async throws -> WaylandGraphicsFrameResult { let leaseID = id @@ -1569,7 +1458,7 @@ public struct WaylandGraphicsFrameLease: ~Copyable, Sendable { @discardableResult public consuming func submitSoftware( schedule frameSchedule: WaylandGraphicsFrameSchedule, - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, + metadata frameMetadata: SurfaceFrameMetadata = .default, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void ) async throws -> WaylandGraphicsFrameResult { let leaseID = id @@ -1669,6 +1558,17 @@ public struct WaylandGraphicsFrameLease: ~Copyable, Sendable { } extension WaylandGraphicsSubmittedFrame { + package func validateManagedPreviewMetadataPolicy( + configuration: WaylandGraphicsConfiguration + ) throws { + switch self { + case .clearColor(let clearFrame): + try clearFrame.metadata.validateManagedPreviewMetadataPolicy( + configuration: configuration + ) + } + } + package func validateManagedPreviewSupport( configuration: WaylandGraphicsConfiguration, capabilities: WaylandGraphicsSurfaceCapabilities, @@ -1685,16 +1585,26 @@ extension WaylandGraphicsSubmittedFrame { } } -extension WaylandGraphicsFrameMetadata { +extension SurfaceFrameMetadata { + package func validateManagedPreviewMetadataPolicy( + configuration: WaylandGraphicsConfiguration + ) throws { + if hasCommitMetadata, configuration.metadataPolicy == .none { + throw WaylandGraphicsError.unsupportedMetadata + } + } + package func validateManagedPreviewSupport( configuration: WaylandGraphicsConfiguration, capabilities: WaylandGraphicsSurfaceCapabilities, geometry: SurfaceGeometry ) throws { _ = capabilities - try damage?.validateManagedPreviewSupport(geometry: geometry) - if hasCommitMetadata, configuration.metadataPolicy == .none { - throw WaylandGraphicsError.unsupportedMetadata + try validateManagedPreviewMetadataPolicy(configuration: configuration) + do { + try damage?.validate(within: geometry) + } catch { + throw WaylandGraphicsError.invalidDamageRegion } } @@ -1714,21 +1624,21 @@ extension WaylandGraphicsFrameMetadata { var fallbacks = WaylandGraphicsMetadataFallbacks.none if let contentType { if capabilities.colorMetadata.contentType.isAvailable { - commitMetadata.contentType = contentType.surfaceContentType + commitMetadata.contentType = contentType } else { fallbacks.contentType = true } } if let presentationHint { if capabilities.colorMetadata.tearingControl.isAvailable { - commitMetadata.presentationHint = presentationHint.surfacePresentationHint + commitMetadata.presentationHint = presentationHint } else { fallbacks.presentationHint = true } } if let alpha { if capabilities.colorMetadata.alphaModifier.isAvailable { - commitMetadata.alpha = alpha.surfaceAlphaMetadata + commitMetadata.alpha = SurfaceAlphaMetadata(multiplier: alpha) } else { fallbacks.alpha = true } @@ -1736,8 +1646,7 @@ extension WaylandGraphicsFrameMetadata { if let colorRepresentation { switch capabilities.colorMetadata.colorRepresentation { case .available: - commitMetadata.colorRepresentation = - colorRepresentation.surfaceColorRepresentation + commitMetadata.colorRepresentation = colorRepresentation case .pending: fallbacks.colorRepresentationPending = true case .unavailable: @@ -1746,8 +1655,7 @@ extension WaylandGraphicsFrameMetadata { } if let colorDescription { if capabilities.colorMetadata.colorManagement.isAvailable { - commitMetadata.colorDescription = - try colorDescription.surfaceColorDescriptionReference + commitMetadata.colorDescription = colorDescription } else { fallbacks.colorDescription = true } @@ -1758,110 +1666,6 @@ extension WaylandGraphicsFrameMetadata { fallbacks: fallbacks ) } - - package func surfaceCommitMetadata() throws -> SurfaceCommitMetadata { - SurfaceCommitMetadata( - contentType: contentType?.surfaceContentType, - alpha: alpha?.surfaceAlphaMetadata, - colorRepresentation: colorRepresentation?.surfaceColorRepresentation, - colorDescription: try colorDescription?.surfaceColorDescriptionReference, - presentationHint: presentationHint?.surfacePresentationHint - ) - } - - package func surfaceDamageRegion() throws -> SurfaceDamageRegion? { - try damage?.surfaceDamageRegion() - } - - private var hasCommitMetadata: Bool { - contentType != nil - || presentationHint != nil - || alpha != nil - || colorRepresentation != nil - || colorDescription != nil - } -} - -extension WaylandGraphicsDamageRegion { - package func validateManagedPreviewSupport(geometry: SurfaceGeometry) throws { - let region = try surfaceDamageRegion() - do { - try region?.validate(within: geometry) - } catch { - throw WaylandGraphicsError.invalidDamageRegion - } - } - - package func surfaceDamageRegion() throws -> SurfaceDamageRegion? { - guard !rects.isEmpty else { return nil } - - do { - return try SurfaceDamageRegion(rects) - } catch { - throw WaylandGraphicsError.invalidDamageRegion - } - } -} - -extension WaylandGraphicsContentType { - package var surfaceContentType: SurfaceContentType { - switch self { - case .none: - .none - case .photo: - .photo - case .video: - .video - case .game: - .game - } - } -} - -extension WaylandGraphicsPresentationHint { - package var surfacePresentationHint: SurfacePresentationHint { - switch self { - case .vsync: - .vsync - case .async: - .async - } - } -} - -extension WaylandGraphicsAlphaModifier { - package var surfaceAlphaMetadata: SurfaceAlphaMetadata { - SurfaceAlphaMetadata( - multiplier: SurfaceAlphaMultiplier(rawValue: rawValue) - ) - } -} - -extension WaylandGraphicsColorAlphaMode { - package var surfaceAlphaMode: SurfaceAlphaMode { - switch self { - case .premultipliedElectrical: - .premultipliedElectrical - case .premultipliedOptical: - .premultipliedOptical - case .straight: - .straight - } - } -} - -extension WaylandGraphicsColorRepresentation { - package var surfaceColorRepresentation: SurfaceColorRepresentation { - SurfaceColorRepresentation(alphaMode: alphaMode?.surfaceAlphaMode) - } -} - -extension WaylandGraphicsColorDescription { - package var surfaceColorDescriptionReference: SurfaceColorDescriptionReference { - get throws { - try SurfaceColorDescriptionReference(identity: id.rawValue) - } - } } func noGraphicsPreviewSubmissionHook() async { diff --git a/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/FrameLeases.md b/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/FrameLeases.md index 6c15f244..d3040bf0 100644 --- a/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/FrameLeases.md +++ b/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/FrameLeases.md @@ -40,10 +40,11 @@ preview code. On software backing or fallback, WaylandClientKit fills a For external buffers, the renderer owns allocation and rendering; WCK owns import, commit, release tracking, and reuse gating. -Use ``WaylandGraphicsFrameMetadata`` and ``WaylandGraphicsDamageRegion`` to -describe optional metadata and logical damage. WaylandClientKit validates metadata -and damage before irreversible commit work. Validation failure still terminally -releases the consumed frame authority. +Use `SurfaceFrameMetadata` and `SurfaceDamageRegion` to describe optional +surface metadata and logical damage. `nil` damage is the only full-frame +representation; a non-`nil` region contains at least one validated rectangle. +WaylandClientKit validates metadata and damage before irreversible commit work. +Validation failure still terminally releases the consumed frame authority. WaylandClientKit owns lease state, new-frame retry behavior after pre-commit failures, post-commit terminal state, and buffer reuse. Frameworks own frame diff --git a/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/SchedulingAndColorMetadata.md b/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/SchedulingAndColorMetadata.md index 77e9e3c3..b96d4592 100644 --- a/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/SchedulingAndColorMetadata.md +++ b/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/SchedulingAndColorMetadata.md @@ -18,12 +18,15 @@ fences, or protocol objects. Frameworks own animation policy. ## Color Metadata -``WaylandGraphicsFrameMetadata`` can carry content type, presentation hint, -alpha modifier, and color representation. Public color-description attachment is +`SurfaceFrameMetadata` can carry content type, presentation hint, alpha +multiplier, color representation, and logical damage. The same value is used by +ordinary `Window` software presentation. Public color-description attachment is deferred until WaylandClientKit exposes a managed image-description producer. -Supported metadata is applied before commit; missing support becomes a runtime -fallback fact. Tone mapping, gamut conversion, ICC parsing, and renderer color -policy remain outside the package. +The `.none` metadata policy rejects nonempty compositor metadata before +submission-side window checks or initial-configure requests. With +`.preferAvailable`, supported metadata is applied before commit and missing +support becomes a runtime fallback fact. Tone mapping, gamut conversion, ICC +parsing, and renderer color policy remain outside the package. Use `ColorManagementSmoke` to inspect color capability facts and `GraphicsPreviewColorMetadataSmoke` to submit a bounded metadata request. diff --git a/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/WaylandGraphicsPreview.md b/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/WaylandGraphicsPreview.md index 11c05142..eeb4739d 100644 --- a/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/WaylandGraphicsPreview.md +++ b/Sources/WaylandGraphicsPreview/WaylandGraphicsPreview.docc/WaylandGraphicsPreview.md @@ -75,11 +75,13 @@ value types. - ``WaylandGraphicsExternalSynchronizationAvailability`` - ``WaylandGraphicsExternalAlphaMode`` - ``WaylandGraphicsXRGBColor`` -- ``WaylandGraphicsFrameMetadata`` -- ``WaylandGraphicsDamageRegion`` -- ``WaylandGraphicsAlphaModifier`` -- ``WaylandGraphicsColorRepresentation`` -- ``WaylandGraphicsColorAlphaMode`` +- `SurfaceFrameMetadata` +- `SurfaceDamageRegion` +- `SurfaceContentType` +- `SurfacePresentationHint` +- `SurfaceAlphaMultiplier` +- `SurfaceColorRepresentation` +- `SurfaceColorAlphaMode` ### Runtime Path Values diff --git a/Tests/WaylandClientTests/Rendering/SurfaceCommitMetadataTests.swift b/Tests/WaylandClientTests/Rendering/SurfaceCommitMetadataTests.swift index 922b25e0..03b33464 100644 --- a/Tests/WaylandClientTests/Rendering/SurfaceCommitMetadataTests.swift +++ b/Tests/WaylandClientTests/Rendering/SurfaceCommitMetadataTests.swift @@ -48,7 +48,7 @@ contentType: .game, alpha: SurfaceAlphaMetadata(multiplier: .opaque), colorRepresentation: SurfaceColorRepresentation( - alphaMode: .premultipliedElectrical, + rawAlphaMode: .premultipliedElectrical, coefficientsAndRange: SurfaceMatrixCoefficientsAndRange( coefficients: .bt709, range: .limited @@ -98,7 +98,7 @@ ) { try SurfaceCommitMetadata( colorRepresentation: SurfaceColorRepresentation( - alphaMode: SurfaceAlphaMode(rawValue: 88) + rawAlphaMode: SurfaceAlphaMode(rawValue: 88) ) ).validate( capabilities: metadataCapabilities( @@ -139,7 +139,7 @@ ) let metadata = SurfaceCommitMetadata( colorRepresentation: SurfaceColorRepresentation( - alphaMode: advertisedAlphaMode, + rawAlphaMode: advertisedAlphaMode, coefficientsAndRange: advertisedCoefficientsAndRange ) ) @@ -156,17 +156,6 @@ )) } - @Test - func invalidContentTypeRawValueCannotBeCommitted() { - let unsupported = SurfaceContentType(rawValue: 99) - - #expect(throws: SurfaceCommitMetadataError.unsupportedContentType(unsupported)) { - try SurfaceCommitMetadata(contentType: unsupported).validate( - capabilities: metadataCapabilities(contentType: .available) - ) - } - } - @Test func missingColorDescriptionFailsBeforeAnyMetadataRequest() async throws { try await MetadataRequestRecordingGate.withExclusiveRecording { diff --git a/Tests/WaylandClientTests/Rendering/SurfaceFrameMetadataTests.swift b/Tests/WaylandClientTests/Rendering/SurfaceFrameMetadataTests.swift new file mode 100644 index 00000000..48003ca9 --- /dev/null +++ b/Tests/WaylandClientTests/Rendering/SurfaceFrameMetadataTests.swift @@ -0,0 +1,81 @@ +import Testing + +@testable import WaylandClient + +@Suite +struct SurfaceFrameMetadataTests { + @Test + func defaultRepresentsFullFrameDamageWithNil() { + let metadata = SurfaceFrameMetadata.default + + #expect(metadata.contentType == nil) + #expect(metadata.presentationHint == nil) + #expect(metadata.alpha == nil) + #expect(metadata.colorRepresentation == nil) + #expect(metadata.damage == nil) + } + + @Test + func rendererNeutralMetadataConvertsWithoutChangingSurfaceValues() throws { + let damage = try SurfaceDamageRegion([ + LogicalRect(x: 1, y: 2, width: 3, height: 4) + ]) + let metadata = SurfaceFrameMetadata( + contentType: .video, + presentationHint: .async, + alpha: .transparent, + colorRepresentation: SurfaceColorRepresentation(alphaMode: .straight), + damage: damage + ) + + #expect( + metadata.surfaceCommitMetadata + == SurfaceCommitMetadata( + contentType: .video, + alpha: SurfaceAlphaMetadata(multiplier: .transparent), + colorRepresentation: SurfaceColorRepresentation(alphaMode: .straight), + presentationHint: .async + ) + ) + #expect(metadata.damage == damage) + } + + @Test + func eachExplicitlyUnavailableMetadataDimensionThrowsItsPublicTypedError() { + let unsupportedRequests: [(SurfaceFrameMetadata, SurfaceFrameMetadataError)] = [ + ( + SurfaceFrameMetadata(contentType: .photo), + .contentTypeUnavailable + ), + ( + SurfaceFrameMetadata(presentationHint: .async), + .presentationHintUnavailable + ), + ( + SurfaceFrameMetadata(alpha: .opaque), + .alphaMultiplierUnavailable + ), + ( + SurfaceFrameMetadata( + colorRepresentation: SurfaceColorRepresentation(alphaMode: .straight) + ), + .colorRepresentationUnavailable + ), + ] + let unavailableCapabilities = SurfaceCapabilitySnapshot( + role: .toplevelWindow, + outputIDs: [], + fractionalScale: .integerOnly, + presentationFeedback: .unavailable, + dmabuf: .unavailable, + synchronization: .implicitOnly, + pacing: .unavailable + ) + + for (metadata, expectedError) in unsupportedRequests { + #expect(throws: expectedError) { + try metadata.validate(capabilities: unavailableCapabilities) + } + } + } +} diff --git a/Tests/WaylandClientTests/Rendering/WindowSoftwarePresenterTests.swift b/Tests/WaylandClientTests/Rendering/WindowSoftwarePresenterTests.swift index b93516fb..15027d12 100644 --- a/Tests/WaylandClientTests/Rendering/WindowSoftwarePresenterTests.swift +++ b/Tests/WaylandClientTests/Rendering/WindowSoftwarePresenterTests.swift @@ -93,6 +93,43 @@ } } + @Test + func unsupportedMetadataIsRejectedBeforePoolAcquisitionOrDrawing() async throws { + try await withSoftwarePresentationRecording { + try exerciseUnsupportedMetadataPreflight() + } + } + + private func exerciseUnsupportedMetadataPreflight() throws { + var requestedPool = false + var didDraw = false + var runtime = SurfaceRuntime(role: .toplevelWindow) + var pendingFrameRegistration: FrameCallbackRegistration? + let presenter = WindowSoftwarePresenter( + surface: try testSurface(pointer: 0x6A71), + scaleInstallation: SurfaceScaleInstallation(), + createSharedMemoryPool: { _ in + requestedPool = true + throw UnexpectedPoolRequest() + }, + isWindowClosed: { false }, + onFrame: { _ = () } + ) + + #expect(throws: SurfaceCommitMetadataError.contentTypeUnavailable) { + _ = try presenter.present( + context: try softwarePresentationContext( + metadata: SurfaceCommitMetadata(contentType: .photo) + ), + draw: { _ in didDraw = true }, + runtime: &runtime, + pendingFrameRegistration: &pendingFrameRegistration + ) + } + #expect(!requestedPool) + #expect(!didDraw) + } + @Test func bufferIDsAreUniqueAcrossPoolAllocations() async throws { try await withSoftwarePresentationRecording { @@ -330,7 +367,9 @@ } private func softwarePresentationContext( - submitConstraints: SurfaceSubmitConstraints = .default + submitConstraints: SurfaceSubmitConstraints = .default, + metadata: SurfaceCommitMetadata = .default, + damage: SurfaceDamageRegion? = nil ) throws -> WindowSoftwarePresentationContext { @@ -355,8 +394,8 @@ ), geometry: geometry, submitConstraints: submitConstraints, - metadata: .default, - damage: nil, + metadata: metadata, + damage: damage, presentationFeedback: nil ) } @@ -419,4 +458,5 @@ private struct InjectedDrawFailure: Error {} private struct InjectedSuccessStagingFailure: Error {} + private struct UnexpectedPoolRequest: Error {} #endif diff --git a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsColorMetadataTests.swift b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsColorMetadataTests.swift index 93edf955..4f4b0886 100644 --- a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsColorMetadataTests.swift +++ b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsColorMetadataTests.swift @@ -6,12 +6,10 @@ import WaylandGraphicsPreview struct WaylandGraphicsColorMetadataTests { @Test func colorMetadataFallsBackWhenProtocolsAreUnavailable() throws { - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( + colorDescription: try SurfaceColorDescriptionReference(identity: 42), alpha: .transparent, - colorRepresentation: WaylandGraphicsColorRepresentation(alphaMode: .straight), - colorDescription: WaylandGraphicsColorDescription( - id: try WaylandGraphicsColorDescriptionID(rawValue: 42) - ) + colorRepresentation: SurfaceColorRepresentation(alphaMode: .straight) ) let resolved = try metadata.resolveManagedPreviewMetadata( @@ -34,9 +32,9 @@ struct WaylandGraphicsColorMetadataTests { @Test func colorMetadataMapsWhenProtocolsAreAvailable() throws { - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( alpha: .opaque, - colorRepresentation: WaylandGraphicsColorRepresentation( + colorRepresentation: SurfaceColorRepresentation( alphaMode: .premultipliedElectrical ) ) @@ -53,9 +51,9 @@ struct WaylandGraphicsColorMetadataTests { } @Test - func zeroColorDescriptionIDIsRejected() { - #expect(throws: WaylandGraphicsError.unavailable(.invalidColorDescription)) { - _ = try WaylandGraphicsColorDescriptionID(rawValue: 0) + func zeroSurfaceColorDescriptionIDIsRejected() { + #expect(throws: SurfaceCommitMetadataError.invalidColorDescriptionIdentity(0)) { + _ = try SurfaceColorDescriptionReference(identity: 0) } } } diff --git a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsExternalBufferSubmissionTests.swift b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsExternalBufferSubmissionTests.swift index 09bf4857..b318a787 100644 --- a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsExternalBufferSubmissionTests.swift +++ b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsExternalBufferSubmissionTests.swift @@ -1105,13 +1105,13 @@ struct WaylandGraphicsExternalBufferLifecycleTests { let firstLease = try await storage.nextFrame() _ = try await firstLease.submit(.clearColor(.black)) let failedLease = try await storage.nextFrame() - let invalidDamage = WaylandGraphicsDamageRegion( - rects: [try LogicalRect(x: 101, y: 0, width: 20, height: 10)] + let invalidDamage = try SurfaceDamageRegion( + [try LogicalRect(x: 101, y: 0, width: 20, height: 10)] ) let frame = WaylandGraphicsSubmittedFrame.clearColor( WaylandGraphicsClearFrame( color: .black, - metadata: WaylandGraphicsFrameMetadata(damage: invalidDamage) + metadata: SurfaceFrameMetadata(damage: invalidDamage) ) ) @@ -1460,11 +1460,11 @@ struct WaylandGraphicsExternalBufferLifecycleTests { ) ) let lease = try await storage.nextFrame() - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( contentType: .game, presentationHint: .async, alpha: .opaque, - colorRepresentation: WaylandGraphicsColorRepresentation(alphaMode: .straight) + colorRepresentation: SurfaceColorRepresentation(alphaMode: .straight) ) let schedule = WaylandGraphicsFrameSchedule( pacing: .fifo, @@ -1483,6 +1483,7 @@ struct WaylandGraphicsExternalBufferLifecycleTests { #expect(result.frameResult.metadata == metadata) #expect(result.frameResult.schedule == schedule) #expect(result.frameResult.presentationFeedbackRequested) + #expect(await window.metadataSnapshot() == [metadata.surfaceCommitMetadata]) #expect(await window.submitConstraintsSnapshot().map(\.pacing) == [.fifo(.setBarrier)]) #expect(await window.presentationFeedbackRequestSnapshot() == [true]) #expect(await window.metadataSnapshot().compactMap(\.contentType) == [.game]) @@ -2579,7 +2580,7 @@ private func registerAndSubmitTestExternalBuffer( storage: WaylandGraphicsWindowBackingStorage, lease: consuming WaylandGraphicsFrameLease, descriptor: consuming WaylandGraphicsExternalBufferDescriptor, - metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, + metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil ) async throws -> ( buffer: WaylandGraphicsExternalBuffer, diff --git a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewAPITests.swift b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewAPITests.swift index e978a58f..c6b955dc 100644 --- a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewAPITests.swift +++ b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewAPITests.swift @@ -211,10 +211,10 @@ struct WaylandGraphicsPreviewAPITests { @Test func clearFrameCarriesColorAndOptionalMetadata() { let color = WaylandGraphicsXRGBColor(red: 0x10, green: 0x20, blue: 0x30) - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( contentType: .game, presentationHint: .vsync, - damage: .fullFrame + damage: nil ) let clearFrame = WaylandGraphicsClearFrame(color: color, metadata: metadata) let expectedSubmittedFrame = WaylandGraphicsSubmittedFrame.clearColor( @@ -226,7 +226,7 @@ struct WaylandGraphicsPreviewAPITests { #expect(color.blue == 0x30) #expect(clearFrame.metadata.contentType == .game) #expect(clearFrame.metadata.presentationHint == .vsync) - #expect(clearFrame.metadata.damage == .fullFrame) + #expect(clearFrame.metadata.damage == nil) #expect(WaylandGraphicsSubmittedFrame.clearColor(color) == expectedSubmittedFrame) } } diff --git a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewBackingPreferenceTests.swift b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewBackingPreferenceTests.swift index 67908e33..58e978b7 100644 --- a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewBackingPreferenceTests.swift +++ b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewBackingPreferenceTests.swift @@ -64,7 +64,7 @@ struct WaylandGraphicsPresentationPolicyTests { @Test func frameResultReportsSubmissionFacts() throws { - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( contentType: .game, presentationHint: .vsync ) diff --git a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewManagedSubmissionTests.swift b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewManagedSubmissionTests.swift index 770bd87b..28d6585b 100644 --- a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewManagedSubmissionTests.swift +++ b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsPreviewManagedSubmissionTests.swift @@ -34,10 +34,15 @@ struct WaylandGraphicsPreviewManagedSubmissionTests { let frame = WaylandGraphicsSubmittedFrame.clearColor( WaylandGraphicsClearFrame( color: .black, - metadata: WaylandGraphicsFrameMetadata(contentType: .game) + metadata: SurfaceFrameMetadata(contentType: .game) ) ) + #expect( + throws: WaylandGraphicsError.unsupportedMetadata + ) { + try frame.validateManagedPreviewMetadataPolicy(configuration: .default) + } #expect( throws: WaylandGraphicsError.unsupportedMetadata ) { @@ -55,7 +60,7 @@ struct WaylandGraphicsPreviewManagedSubmissionTests { let frame = WaylandGraphicsSubmittedFrame.clearColor( WaylandGraphicsClearFrame( color: .black, - metadata: WaylandGraphicsFrameMetadata( + metadata: SurfaceFrameMetadata( contentType: .game, presentationHint: .vsync ) @@ -73,7 +78,7 @@ struct WaylandGraphicsPreviewManagedSubmissionTests { @Test func metadataPolicyPreferAvailableOmitsUnavailableMetadata() throws { - let metadata = WaylandGraphicsFrameMetadata( + let metadata = SurfaceFrameMetadata( contentType: .game, presentationHint: .async ) @@ -106,7 +111,7 @@ struct WaylandGraphicsPreviewManagedSubmissionTests { let frame = WaylandGraphicsSubmittedFrame.clearColor( WaylandGraphicsClearFrame( color: .black, - metadata: WaylandGraphicsFrameMetadata( + metadata: SurfaceFrameMetadata( contentType: .game, presentationHint: .vsync ) @@ -119,16 +124,37 @@ struct WaylandGraphicsPreviewManagedSubmissionTests { geometry: testGraphicsSurfaceGeometry() ) } + + @Test + func managedPreviewResolvesTheSharedMetadataWithoutChangingSurfaceValues() throws { + let metadata = SurfaceFrameMetadata( + contentType: .video, + presentationHint: .vsync, + alpha: .transparent, + colorRepresentation: SurfaceColorRepresentation( + alphaMode: .premultipliedOptical + ) + ) + + let resolved = try metadata.resolveManagedPreviewMetadata( + configuration: WaylandGraphicsConfiguration(metadataPolicy: .preferAvailable), + capabilities: gpuCapableSurfaceCapabilities(), + geometry: testGraphicsSurfaceGeometry() + ) + + #expect(resolved.commitMetadata == metadata.surfaceCommitMetadata) + #expect(resolved.fallbacks.isEmpty) + } } @Suite struct WaylandGraphicsPreviewRuntimeTests { @Test func partialDamageIsAcceptedWhenWithinSurfaceBounds() throws { - let damage = WaylandGraphicsDamageRegion( - rects: [try LogicalRect(x: 0, y: 0, width: 10, height: 10)] + let damage = try SurfaceDamageRegion( + [try LogicalRect(x: 0, y: 0, width: 10, height: 10)] ) - let metadata = WaylandGraphicsFrameMetadata(damage: damage) + let metadata = SurfaceFrameMetadata(damage: damage) try metadata.validateManagedPreviewSupport( configuration: .default, @@ -139,10 +165,10 @@ struct WaylandGraphicsPreviewRuntimeTests { @Test func noIntersectionGraphicsDamageIsInvalidDamageRegion() throws { - let damage = WaylandGraphicsDamageRegion( - rects: [try LogicalRect(x: 101, y: 0, width: 20, height: 10)] + let damage = try SurfaceDamageRegion( + [try LogicalRect(x: 101, y: 0, width: 20, height: 10)] ) - let metadata = WaylandGraphicsFrameMetadata(damage: damage) + let metadata = SurfaceFrameMetadata(damage: damage) #expect(throws: WaylandGraphicsError.invalidDamageRegion) { try metadata.validateManagedPreviewSupport( diff --git a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsSubmissionFailureTests.swift b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsSubmissionFailureTests.swift index c9b72a12..0f12835f 100644 --- a/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsSubmissionFailureTests.swift +++ b/Tests/WaylandGraphicsPreviewAPITests/WaylandGraphicsSubmissionFailureTests.swift @@ -2,6 +2,7 @@ import Testing import WaylandClient import WaylandGraphicsPreview +// swiftlint:disable type_body_length @Suite struct WaylandGraphicsSubmissionFailureTests { @Test @@ -218,8 +219,8 @@ struct WaylandGraphicsSubmissionFailureTests { ) ) let rect = try LogicalRect(x: 0, y: 0, width: 10, height: 10) - let metadata = WaylandGraphicsFrameMetadata( - damage: WaylandGraphicsDamageRegion(rects: [rect]) + let metadata = SurfaceFrameMetadata( + damage: try SurfaceDamageRegion([rect]) ) let lease = try await storage.nextFrame() @@ -230,6 +231,38 @@ struct WaylandGraphicsSubmissionFailureTests { #expect(await window.damages() == [try SurfaceDamageRegion([rect])]) } + @Test + func submitSoftwarePassesTheSharedMetadataToTheSurfaceCommit() async throws { + let window = try FakeManagedGraphicsWindow(showDrawFailures: 0) + let storage = WaylandGraphicsWindowBackingStorage( + window: window, + runtimePath: .softwareFallback( + capabilities: gpuCapableSurfaceCapabilities(), + reason: .forcedSoftware + ), + configuration: WaylandGraphicsConfiguration( + presentationPolicy: .software, + metadataPolicy: .preferAvailable + ) + ) + let damage = try SurfaceDamageRegion( + [try LogicalRect(x: 1, y: 2, width: 10, height: 11)] + ) + let metadata = SurfaceFrameMetadata( + contentType: .game, + presentationHint: .async, + alpha: .opaque, + colorRepresentation: SurfaceColorRepresentation(alphaMode: .straight), + damage: damage + ) + let lease = try await storage.nextFrame() + + _ = try await lease.submitSoftware(metadata: metadata) { _ in () } + + #expect(await window.metadatas() == [metadata.surfaceCommitMetadata]) + #expect(await window.damages() == [damage]) + } + @Test func fullFrameGraphicsDamageSubmitsNilSurfaceDamage() async throws { let window = try FakeManagedGraphicsWindow(showDrawFailures: 0) @@ -240,7 +273,7 @@ struct WaylandGraphicsSubmissionFailureTests { reason: .forcedSoftware ) ) - let metadata = WaylandGraphicsFrameMetadata(damage: .fullFrame) + let metadata = SurfaceFrameMetadata(damage: nil) let lease = try await storage.nextFrame() _ = try await lease.submitSoftware(metadata: metadata) { _ in @@ -287,6 +320,7 @@ struct WaylandGraphicsSubmissionFailureTests { ) } } +// swiftlint:enable type_body_length @Suite struct WaylandGraphicsSoftwarePacingSubmissionTests { @@ -377,6 +411,7 @@ actor FakeManagedGraphicsWindow: WaylandGraphicsManagedWindow { private var remainingShowDrawFailures: Int private var recordedOperations: [WaylandGraphicsSubmissionOperation] = [] private var recordedDamages: [SurfaceDamageRegion?] = [] + private var recordedMetadata: [SurfaceCommitMetadata] = [] private var recordedSubmitConstraints: [SurfaceSubmitConstraints] = [] init(showDrawFailures: Int) throws { @@ -400,7 +435,7 @@ actor FakeManagedGraphicsWindow: WaylandGraphicsManagedWindow { func show( timeoutMilliseconds _: Int32, submitConstraints: SurfaceSubmitConstraints, - metadata _: SurfaceCommitMetadata, + metadata: SurfaceCommitMetadata, requestPresentationFeedback _: Bool, damage: SurfaceDamageRegion?, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void @@ -408,6 +443,7 @@ actor FakeManagedGraphicsWindow: WaylandGraphicsManagedWindow { _ = draw recordedOperations.append(.show) recordedDamages.append(damage) + recordedMetadata.append(metadata) recordedSubmitConstraints.append(submitConstraints) if remainingShowDrawFailures > 0 { remainingShowDrawFailures -= 1 @@ -417,7 +453,7 @@ actor FakeManagedGraphicsWindow: WaylandGraphicsManagedWindow { func redraw( submitConstraints: SurfaceSubmitConstraints, - metadata _: SurfaceCommitMetadata, + metadata: SurfaceCommitMetadata, requestPresentationFeedback _: Bool, damage: SurfaceDamageRegion?, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void @@ -425,6 +461,7 @@ actor FakeManagedGraphicsWindow: WaylandGraphicsManagedWindow { _ = draw recordedOperations.append(.redraw) recordedDamages.append(damage) + recordedMetadata.append(metadata) recordedSubmitConstraints.append(submitConstraints) } @@ -440,6 +477,10 @@ actor FakeManagedGraphicsWindow: WaylandGraphicsManagedWindow { recordedDamages } + func metadatas() -> [SurfaceCommitMetadata] { + recordedMetadata + } + func submitConstraints() -> [SurfaceSubmitConstraints] { recordedSubmitConstraints } diff --git a/docs/documentation-symbol-coverage.json b/docs/documentation-symbol-coverage.json index f08d0d86..31daaa17 100644 --- a/docs/documentation-symbol-coverage.json +++ b/docs/documentation-symbol-coverage.json @@ -1,12 +1,12 @@ { "products" : { "WaylandClient" : { - "documented" : 151, - "eligible" : 1530 + "documented" : 176, + "eligible" : 1547 }, "WaylandGraphicsPreview" : { "documented" : 32, - "eligible" : 243 + "eligible" : 223 } } } diff --git a/docs/public-api-audit.md b/docs/public-api-audit.md index 05515d06..c5d5681b 100644 --- a/docs/public-api-audit.md +++ b/docs/public-api-audit.md @@ -44,6 +44,14 @@ Intentionally public: - `SoftwareFrameGeometry` - `PositivePixelSize` - `SoftwareFrame` +- `SurfaceFrameMetadata` +- `SurfaceContentType` +- `SurfacePresentationHint` +- `SurfaceAlphaMultiplier` +- `SurfaceColorAlphaMode` +- `SurfaceColorRepresentation` +- `SurfaceFrameMetadataError` +- `SurfaceDamageRegion` - `SurfacePresentationIdentity` - `SurfacePresentationFeedback` - `PresentationFeedback` @@ -211,14 +219,19 @@ Current user-facing contract: spans, stride, and geometry without exposing raw Wayland or SHM handles. `SoftwareFrameReservation` lets async preparation observe the selected software buffer identity and geometry before the final scoped draw borrow. - Async `Window.show(preparing:_:)` and `Window.redraw(preparing:_:)` calls are - latest-wins transactions and return `SoftwarePresentationOutcome`. Matching - overloads without a preparation closure provide the same outcome and atomic - presentation-feedback option. After preparation resumes, the library - revalidates the exact reservation, window, configure, authoritative geometry, - redraw generation, and task cancellation. A stale attempt is discarded - without drawing, requesting a frame callback or presentation feedback, or - committing the surface. Its replacement redraw is published once through + `Window.show` and `Window.redraw` each expose one simple and one prepared + method. All four accept `SurfaceFrameMetadata`, return a discardable + `SoftwarePresentationOutcome`, and provide the same atomic presentation- + feedback option. Explicitly requested unsupported surface metadata throws + `SurfaceFrameMetadataError` before drawing or issuing any Wayland request for + that presentation attempt. + Prepared calls are latest-wins transactions. After preparation resumes, the + library revalidates the exact reservation, window, configure, authoritative + geometry, redraw generation, and task cancellation. Supersession is resolved + before final metadata-support revalidation, so stale attempts still return + `.superseded` if protocol capabilities change while preparation is suspended. + A stale attempt is discarded without drawing, requesting a frame callback or + presentation feedback, or committing the surface. Its replacement redraw is normal pacing. Presentation feedback requested by these APIs belongs to the same eventual surface commit. - Window sizes are logical surface sizes. `SurfaceGeometry` records the @@ -324,13 +337,6 @@ Intentionally public: - `WaylandGraphicsFramePacingRequest` - `WaylandGraphicsMetadataPolicy` - `WaylandGraphicsPresentationFeedbackPolicy` -- `WaylandGraphicsDamageRegion` -- `WaylandGraphicsFrameMetadata` -- `WaylandGraphicsContentType` -- `WaylandGraphicsPresentationHint` -- `WaylandGraphicsAlphaModifier` -- `WaylandGraphicsColorAlphaMode` -- `WaylandGraphicsColorRepresentation` - `WaylandGraphicsXRGBColor` - `WaylandGraphicsSurfaceGeneration` - `WaylandGraphicsExternalConfigurationID` @@ -382,6 +388,11 @@ Current preview contract: Contradictory mode/fallback combinations and the former lossy mutable backing projection are not public. This is an intentional source break in the preview product. +- Frame submissions and results use `WaylandClient.SurfaceFrameMetadata` rather + than graphics-prefixed duplicates. `nil` damage is the only full-frame + representation; non-`nil` `SurfaceDamageRegion` values contain one or more + validated logical rectangles. `WaylandGraphicsMetadataPolicy` remains preview + policy and records omitted optional metadata as runtime fallback facts. - `WaylandGraphicsReason` is shared by fallback and failed runtime statuses; their status case records the disposition without a duplicate reason enum or duplicate mapping switch. diff --git a/docs/public-api-baseline.md b/docs/public-api-baseline.md index 0ab03684..93602f5b 100644 --- a/docs/public-api-baseline.md +++ b/docs/public-api-baseline.md @@ -1549,10 +1549,43 @@ s:13WaylandClient23SubsurfaceStackingErrorO13selfReferenceyAcA0C8IdentityVcACmF s:13WaylandClient29SubsurfaceSynchronizationModeO swift.enum SubsurfaceSynchronizationMode enum SubsurfaceSynchronizationMode - s:13WaylandClient29SubsurfaceSynchronizationModeO14desynchronizedyA2CmF swift.enum.case SubsurfaceSynchronizationMode.desynchronized case desynchronized - s:13WaylandClient29SubsurfaceSynchronizationModeO12synchronizedyA2CmF swift.enum.case SubsurfaceSynchronizationMode.synchronized case synchronized - +s:13WaylandClient22SurfaceAlphaMultiplierV swift.struct SurfaceAlphaMultiplier struct SurfaceAlphaMultiplier - +s:13WaylandClient22SurfaceAlphaMultiplierV8rawValueACs6UInt32V_tcfc swift.init SurfaceAlphaMultiplier.init(rawValue:) init(rawValue alphaMultiplierRawValue: UInt32) - +s:13WaylandClient22SurfaceAlphaMultiplierV6opaqueACvpZ swift.type.property SurfaceAlphaMultiplier.opaque static let opaque: SurfaceAlphaMultiplier - +s:13WaylandClient22SurfaceAlphaMultiplierV8rawValues6UInt32Vvp swift.property SurfaceAlphaMultiplier.rawValue let rawValue: UInt32 - +s:13WaylandClient22SurfaceAlphaMultiplierV11transparentACvpZ swift.type.property SurfaceAlphaMultiplier.transparent static let transparent: SurfaceAlphaMultiplier - +s:13WaylandClient21SurfaceColorAlphaModeO swift.enum SurfaceColorAlphaMode enum SurfaceColorAlphaMode - +s:13WaylandClient21SurfaceColorAlphaModeO23premultipliedElectricalyA2CmF swift.enum.case SurfaceColorAlphaMode.premultipliedElectrical case premultipliedElectrical - +s:13WaylandClient21SurfaceColorAlphaModeO20premultipliedOpticalyA2CmF swift.enum.case SurfaceColorAlphaMode.premultipliedOptical case premultipliedOptical - +s:13WaylandClient21SurfaceColorAlphaModeO8straightyA2CmF swift.enum.case SurfaceColorAlphaMode.straight case straight - +s:13WaylandClient26SurfaceColorRepresentationV swift.struct SurfaceColorRepresentation struct SurfaceColorRepresentation - +s:13WaylandClient26SurfaceColorRepresentationV9alphaModeAA0cd5AlphaG0OSgvp swift.property SurfaceColorRepresentation.alphaMode var alphaMode: SurfaceColorAlphaMode? { get set } - +s:13WaylandClient26SurfaceColorRepresentationV9alphaModeAcA0cd5AlphaG0OSg_tcfc swift.init SurfaceColorRepresentation.init(alphaMode:) init(alphaMode colorAlphaMode: SurfaceColorAlphaMode? = nil) - +s:13WaylandClient18SurfaceContentTypeO swift.enum SurfaceContentType enum SurfaceContentType - +s:13WaylandClient18SurfaceContentTypeO4gameyA2CmF swift.enum.case SurfaceContentType.game case game - +s:13WaylandClient18SurfaceContentTypeO4noneyA2CmF swift.enum.case SurfaceContentType.none case none - +s:13WaylandClient18SurfaceContentTypeO5photoyA2CmF swift.enum.case SurfaceContentType.photo case photo - +s:13WaylandClient18SurfaceContentTypeO5videoyA2CmF swift.enum.case SurfaceContentType.video case video - s:13WaylandClient19SurfaceDamageRegionV swift.struct SurfaceDamageRegion struct SurfaceDamageRegion - s:13WaylandClient19SurfaceDamageRegionVyACSayAA11LogicalRectVGKcfc swift.init SurfaceDamageRegion.init(_:) init(_ damageRectangles: [LogicalRect]) throws - s:13WaylandClient19SurfaceDamageRegionV10rectanglesACSayAA11LogicalRectVG_tKcfc swift.init SurfaceDamageRegion.init(rectangles:) init(rectangles damageRectangles: [LogicalRect]) throws - s:13WaylandClient19SurfaceDamageRegionV10rectanglesSayAA11LogicalRectVGvp swift.property SurfaceDamageRegion.rectangles let rectangles: [LogicalRect] - +s:13WaylandClient20SurfaceFrameMetadataV swift.struct SurfaceFrameMetadata struct SurfaceFrameMetadata - +s:13WaylandClient20SurfaceFrameMetadataV5alphaAA0C15AlphaMultiplierVSgvp swift.property SurfaceFrameMetadata.alpha var alpha: SurfaceAlphaMultiplier? - +s:13WaylandClient20SurfaceFrameMetadataV19colorRepresentationAA0c5ColorG0VSgvp swift.property SurfaceFrameMetadata.colorRepresentation var colorRepresentation: SurfaceColorRepresentation? - +s:13WaylandClient20SurfaceFrameMetadataV11contentTypeAA0c7ContentG0OSgvp swift.property SurfaceFrameMetadata.contentType var contentType: SurfaceContentType? - +s:13WaylandClient20SurfaceFrameMetadataV6damageAA0C12DamageRegionVSgvp swift.property SurfaceFrameMetadata.damage var damage: SurfaceDamageRegion? - +s:13WaylandClient20SurfaceFrameMetadataV7defaultACvpZ swift.type.property SurfaceFrameMetadata.default static let `default`: SurfaceFrameMetadata - +s:13WaylandClient20SurfaceFrameMetadataV11contentType16presentationHint5alpha19colorRepresentation6damageAcA0c7ContentG0OSg_AA0c12PresentationI0OSgAA0C15AlphaMultiplierVSgAA0c5ColorL0VSgAA0C12DamageRegionVSgtcfc swift.init SurfaceFrameMetadata.init(contentType:presentationHint:alpha:colorRepresentation:damage:) init(contentType surfaceContentType: SurfaceContentType? = nil, presentationHint surfacePresentationHint: SurfacePresentationHint? = nil, alpha surfaceAlpha: SurfaceAlphaMultiplier? = nil, colorRepresentation surfaceColorRepresentation: SurfaceColorRepresentation? = nil, damage surfaceDamage: SurfaceDamageRegion? = nil) - +s:13WaylandClient20SurfaceFrameMetadataV16presentationHintAA0c12PresentationG0OSgvp swift.property SurfaceFrameMetadata.presentationHint var presentationHint: SurfacePresentationHint? - +s:13WaylandClient25SurfaceFrameMetadataErrorO swift.enum SurfaceFrameMetadataError enum SurfaceFrameMetadataError - +s:13WaylandClient25SurfaceFrameMetadataErrorO26alphaMultiplierUnavailableyA2CmF swift.enum.case SurfaceFrameMetadataError.alphaMultiplierUnavailable case alphaMultiplierUnavailable - +s:13WaylandClient25SurfaceFrameMetadataErrorO33colorRepresentationSupportPendingyA2CmF swift.enum.case SurfaceFrameMetadataError.colorRepresentationSupportPending case colorRepresentationSupportPending - +s:13WaylandClient25SurfaceFrameMetadataErrorO30colorRepresentationUnavailableyA2CmF swift.enum.case SurfaceFrameMetadataError.colorRepresentationUnavailable case colorRepresentationUnavailable - +s:13WaylandClient25SurfaceFrameMetadataErrorO22contentTypeUnavailableyA2CmF swift.enum.case SurfaceFrameMetadataError.contentTypeUnavailable case contentTypeUnavailable - +s:13WaylandClient25SurfaceFrameMetadataErrorO11descriptionSSvp swift.property SurfaceFrameMetadataError.description var description: String { get } - +s:13WaylandClient25SurfaceFrameMetadataErrorO27presentationHintUnavailableyA2CmF swift.enum.case SurfaceFrameMetadataError.presentationHintUnavailable case presentationHintUnavailable - +s:13WaylandClient25SurfaceFrameMetadataErrorO25unsupportedColorAlphaModeyAcA0chiJ0OcACmF swift.enum.case SurfaceFrameMetadataError.unsupportedColorAlphaMode(_:) case unsupportedColorAlphaMode(SurfaceColorAlphaMode) - s:13WaylandClient15SurfaceGeometryV swift.struct SurfaceGeometry struct SurfaceGeometry - s:13WaylandClient15SurfaceGeometryV10bufferSizeAA013PositivePixelF0Vvp swift.property SurfaceGeometry.bufferSize let bufferSize: PositivePixelSize - s:13WaylandClient15SurfaceGeometryV11descriptionSSvp swift.property SurfaceGeometry.description var description: String { get } - @@ -1563,6 +1596,9 @@ s:13WaylandClient27SurfacePresentationFeedbackO swift.enum SurfacePresentationFe s:13WaylandClient27SurfacePresentationFeedbackO9discardedyAcA0cD8IdentityVcACmF swift.enum.case SurfacePresentationFeedback.discarded(_:) case discarded(SurfacePresentationIdentity) - s:13WaylandClient27SurfacePresentationFeedbackO9presentedyAcA0dE0VcACmF swift.enum.case SurfacePresentationFeedback.presented(_:) case presented(PresentationFeedback) - s:13WaylandClient27SurfacePresentationFeedbackO7surfaceAA0cD8IdentityVvp swift.property SurfacePresentationFeedback.surface var surface: SurfacePresentationIdentity { get } - +s:13WaylandClient23SurfacePresentationHintO swift.enum SurfacePresentationHint enum SurfacePresentationHint - +s:13WaylandClient23SurfacePresentationHintO5asyncyA2CmF swift.enum.case SurfacePresentationHint.async case async - +s:13WaylandClient23SurfacePresentationHintO5vsyncyA2CmF swift.enum.case SurfacePresentationHint.vsync case vsync - s:13WaylandClient27SurfacePresentationIdentityV swift.struct SurfacePresentationIdentity struct SurfacePresentationIdentity - s:13WaylandClient27SurfacePresentationIdentityV11descriptionSSvp swift.property SurfacePresentationIdentity.description var description: String { get } - s:13WaylandClient13SurfaceRegionV swift.struct SurfaceRegion struct SurfaceRegion - @@ -2108,12 +2144,8 @@ s:13WaylandClient6WindowV8isClosedSbvp swift.property Window.isClosed var isClos s:13WaylandClient6WindowV11lockPointer6seatID10cursorHint6region8lifetimeAA0E10ConstraintVAA04SeatG0V_AA0E8LocationVSgAA0eL6RegionVSgAA0eL8LifetimeOtYaKF swift.method Window.lockPointer(seatID:cursorHint:region:lifetime:) func lockPointer(seatID: SeatID, cursorHint: PointerLocation? = nil, region: PointerConstraintRegion? = nil, lifetime: PointerConstraintLifetime = .oneShot) async throws -> PointerConstraint - s:13WaylandClient6WindowV11needsRedrawSbvp swift.property Window.needsRedraw var needsRedraw: Bool { get async throws } - s:13WaylandClient6WindowV18presentationEventsAA0c12PresentationE0Vvp swift.property Window.presentationEvents var presentationEvents: WindowPresentationEvents { get } - -s:13WaylandClient6WindowV6redrawyyyAA13SoftwareFrameVYbKXEYaKF swift.method Window.redraw(_:) func redraw(_ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws - -s:13WaylandClient6WindowV6redraw6damage_yAA19SurfaceDamageRegionVSg_yAA13SoftwareFrameVYbKXEtYaKF swift.method Window.redraw(damage:_:) func redraw(damage: SurfaceDamageRegion?, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws - -s:13WaylandClient6WindowV6redraw6damage27requestPresentationFeedback_AA08SoftwareG7OutcomeOAA19SurfaceDamageRegionVSg_SbyAA0I5FrameVYbKXEtYaKF swift.method Window.redraw(damage:requestPresentationFeedback:_:) @discardableResult func redraw(damage: SurfaceDamageRegion?, requestPresentationFeedback: Bool, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"}} -s:13WaylandClient6WindowV6redraw6damage27requestPresentationFeedback9preparing_AA08SoftwareG7OutcomeOAA19SurfaceDamageRegionVSg_SbxAA0J16FrameReservationVYaYbKYCXEyx_AA0jO0VtYbKXEtYaKs8SendableRzlF swift.method Window.redraw(damage:requestPresentationFeedback:preparing:_:) @discardableResult func redraw(damage: SurfaceDamageRegion?, requestPresentationFeedback: Bool = false, preparing prepare: nonisolated(nonsending) sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome where Prepared : Sendable {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"},"swiftGenerics":{"constraints":[{"kind":"conformance","lhs":"Prepared","rhs":"Sendable","rhsPrecise":"s:s8SendableP"}],"parameters":[{"depth":0,"index":0,"name":"Prepared"}]}} -s:13WaylandClient6WindowV6redraw27requestPresentationFeedback_AA08SoftwareF7OutcomeOSb_yAA0H5FrameVYbKXEtYaKF swift.method Window.redraw(requestPresentationFeedback:_:) @discardableResult func redraw(requestPresentationFeedback: Bool, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"}} -s:13WaylandClient6WindowV6redraw27requestPresentationFeedback9preparing_AA08SoftwareF7OutcomeOSb_xAA0I16FrameReservationVYaYbKYCXEyx_AA0iK0VtYbKXEtYaKs8SendableRzlF swift.method Window.redraw(requestPresentationFeedback:preparing:_:) @discardableResult func redraw(requestPresentationFeedback: Bool = false, preparing prepare: nonisolated(nonsending) sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome where Prepared : Sendable {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"},"swiftGenerics":{"constraints":[{"kind":"conformance","lhs":"Prepared","rhs":"Sendable","rhsPrecise":"s:s8SendableP"}],"parameters":[{"depth":0,"index":0,"name":"Prepared"}]}} +s:13WaylandClient6WindowV6redraw8metadata27requestPresentationFeedback_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_SbyAA0iL0VYbKXEtYaKF swift.method Window.redraw(metadata:requestPresentationFeedback:_:) @discardableResult func redraw(metadata frameMetadata: SurfaceFrameMetadata = .default, requestPresentationFeedback: Bool = false, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"}} +s:13WaylandClient6WindowV6redraw8metadata27requestPresentationFeedback9preparing_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_SbxAA0jM11ReservationVYaYbKYCXEyx_AA0jM0VtYbKXEtYaKs8SendableRzlF swift.method Window.redraw(metadata:requestPresentationFeedback:preparing:_:) @discardableResult func redraw(metadata frameMetadata: SurfaceFrameMetadata = .default, requestPresentationFeedback: Bool = false, preparing prepare: nonisolated(nonsending) sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome where Prepared : Sendable {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"},"swiftGenerics":{"constraints":[{"kind":"conformance","lhs":"Prepared","rhs":"Sendable","rhsPrecise":"s:s8SendableP"}],"parameters":[{"depth":0,"index":0,"name":"Prepared"}]}} s:13WaylandClient6WindowV15relativePointer6seatIDAA08RelativeE12SubscriptionVAA04SeatG0V_tYaKF swift.method Window.relativePointer(seatID:) func relativePointer(seatID: SeatID) async throws -> RelativePointerSubscription - s:13WaylandClient6WindowV22requestActivationToken5appID13serialContext19timeoutMillisecondsAA0eF0VSSSg_AA0e6SerialJ0VSgs5Int32VtYaKF swift.method Window.requestActivationToken(appID:serialContext:timeoutMilliseconds:) func requestActivationToken(appID: String? = nil, serialContext: ActivationSerialContext? = nil, timeoutMilliseconds: Int32 = WaylandDisplay.defaultActivationTokenTimeoutMilliseconds) async throws -> ActivationToken - s:13WaylandClient6WindowV21requestExitFullscreenyyYaKF swift.method Window.requestExitFullscreen() func requestExitFullscreen() async throws - @@ -2138,12 +2170,8 @@ s:13WaylandClient6WindowV14setMinimumSizeyyAA015PositiveLogicalF0VSgYaKF swift.m s:13WaylandClient6WindowV15setOpaqueRegionyyAA07SurfaceF0VSgYaKF swift.method Window.setOpaqueRegion(_:) func setOpaqueRegion(_ region: SurfaceRegion?) async throws - s:13WaylandClient6WindowV8setTitleyyAA0A6StringVYaKF swift.method Window.setTitle(_:) func setTitle(_ title: WaylandString) async throws - s:13WaylandClient6WindowV8setTitleyySSYaKF swift.method Window.setTitle(_:) func setTitle(_ title: String) async throws - -s:13WaylandClient6WindowV4show6damage27requestPresentationFeedback19timeoutMilliseconds_AA08SoftwareG7OutcomeOAA19SurfaceDamageRegionVSg_Sbs5Int32VyAA0K5FrameVYbKXEtYaKF swift.method Window.show(damage:requestPresentationFeedback:timeoutMilliseconds:_:) @discardableResult func show(damage: SurfaceDamageRegion?, requestPresentationFeedback: Bool, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"}} -s:13WaylandClient6WindowV4show6damage19timeoutMilliseconds_yAA19SurfaceDamageRegionVSg_s5Int32VyAA13SoftwareFrameVYbKXEtYaKF swift.method Window.show(damage:timeoutMilliseconds:_:) func show(damage: SurfaceDamageRegion?, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws - -s:13WaylandClient6WindowV4show6damage19timeoutMilliseconds27requestPresentationFeedback9preparing_AA08SoftwareI7OutcomeOAA19SurfaceDamageRegionVSg_s5Int32VSbxAA0L16FrameReservationVYaYbKYCXEyx_AA0lR0VtYbKXEtYaKs8SendableRzlF swift.method Window.show(damage:timeoutMilliseconds:requestPresentationFeedback:preparing:_:) @discardableResult func show(damage: SurfaceDamageRegion?, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, requestPresentationFeedback: Bool = false, preparing prepare: nonisolated(nonsending) sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome where Prepared : Sendable {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"},"swiftGenerics":{"constraints":[{"kind":"conformance","lhs":"Prepared","rhs":"Sendable","rhsPrecise":"s:s8SendableP"}],"parameters":[{"depth":0,"index":0,"name":"Prepared"}]}} -s:13WaylandClient6WindowV4show27requestPresentationFeedback19timeoutMilliseconds_AA08SoftwareF7OutcomeOSb_s5Int32VyAA0J5FrameVYbKXEtYaKF swift.method Window.show(requestPresentationFeedback:timeoutMilliseconds:_:) @discardableResult func show(requestPresentationFeedback: Bool, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"}} -s:13WaylandClient6WindowV4show19timeoutMilliseconds_ys5Int32V_yAA13SoftwareFrameVYbKXEtYaKF swift.method Window.show(timeoutMilliseconds:_:) func show(timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws - -s:13WaylandClient6WindowV4show19timeoutMilliseconds27requestPresentationFeedback9preparing_AA08SoftwareH7OutcomeOs5Int32V_SbxAA0K16FrameReservationVYaYbKYCXEyx_AA0kN0VtYbKXEtYaKs8SendableRzlF swift.method Window.show(timeoutMilliseconds:requestPresentationFeedback:preparing:_:) @discardableResult func show(timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, requestPresentationFeedback: Bool = false, preparing prepare: nonisolated(nonsending) sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome where Prepared : Sendable {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"},"swiftGenerics":{"constraints":[{"kind":"conformance","lhs":"Prepared","rhs":"Sendable","rhsPrecise":"s:s8SendableP"}],"parameters":[{"depth":0,"index":0,"name":"Prepared"}]}} +s:13WaylandClient6WindowV4show8metadata27requestPresentationFeedback19timeoutMilliseconds_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_Sbs5Int32VyAA0kN0VYbKXEtYaKF swift.method Window.show(metadata:requestPresentationFeedback:timeoutMilliseconds:_:) @discardableResult func show(metadata frameMetadata: SurfaceFrameMetadata = .default, requestPresentationFeedback: Bool = false, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"}} +s:13WaylandClient6WindowV4show8metadata27requestPresentationFeedback19timeoutMilliseconds9preparing_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_Sbs5Int32VxAA0lO11ReservationVYaYbKYCXEyx_AA0lO0VtYbKXEtYaKs8SendableRzlF swift.method Window.show(metadata:requestPresentationFeedback:timeoutMilliseconds:preparing:_:) @discardableResult func show(metadata frameMetadata: SurfaceFrameMetadata = .default, requestPresentationFeedback: Bool = false, timeoutMilliseconds: Int32 = WaylandDisplay.defaultConfigureTimeoutMilliseconds, preparing prepare: nonisolated(nonsending) sending @Sendable (SoftwareFrameReservation) async throws -> Prepared, _ draw: sending @Sendable (Prepared, borrowing SoftwareFrame) throws -> Void) async throws -> SoftwarePresentationOutcome where Prepared : Sendable {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.struct"},"swiftGenerics":{"constraints":[{"kind":"conformance","lhs":"Prepared","rhs":"Sendable","rhsPrecise":"s:s8SendableP"}],"parameters":[{"depth":0,"index":0,"name":"Prepared"}]}} s:13WaylandClient6WindowV9startDrag6source6seatID6serial4iconAA0E6SourceVAA0eK13ConfigurationV_AA04SeatH0VAA11InputSerialVAA0E4IconOtYaKF swift.method Window.startDrag(source:seatID:serial:icon:) func startDrag(source configuration: DragSourceConfiguration, seatID: SeatID, serial: InputSerial, icon: DragIcon = .none) async throws -> DragSource - s:13WaylandClient6WindowV17startToplevelDrag6source6seatID6serial4icon6offsetAA07StartedeF0VAA0F19SourceConfigurationV_AA04SeatI0VAA11InputSerialVAA0F4IconOAA13LogicalOffsetVtYaKF swift.method Window.startToplevelDrag(source:seatID:serial:icon:offset:) func startToplevelDrag(source configuration: DragSourceConfiguration, seatID: SeatID, serial: InputSerial, icon: DragIcon = .none, offset: LogicalOffset = .zero) async throws -> StartedToplevelDrag - s:13WaylandClient6WindowV13stateSnapshotAA0c5StateE0Vvp swift.property Window.stateSnapshot var stateSnapshot: WindowStateSnapshot { get async throws } - @@ -3951,6 +3979,14 @@ s:13WaylandClient18SubsurfaceIdentityV conformsTo s:s16SendableMetatypeP Swift.S s:13WaylandClient18SubsurfaceIdentityV conformsTo s:s23CustomStringConvertibleP Swift.CustomStringConvertible s:13WaylandClient18SubsurfaceIdentityV conformsTo s:s8SendableP Swift.Sendable s:13WaylandClient18SubsurfaceIdentityV11descriptionSSvp memberOf s:13WaylandClient18SubsurfaceIdentityV - +s:13WaylandClient18SurfaceContentTypeO conformsTo s:SH Swift.Hashable +s:13WaylandClient18SurfaceContentTypeO conformsTo s:SQ Swift.Equatable +s:13WaylandClient18SurfaceContentTypeO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient18SurfaceContentTypeO conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient18SurfaceContentTypeO4gameyA2CmF memberOf s:13WaylandClient18SurfaceContentTypeO - +s:13WaylandClient18SurfaceContentTypeO4noneyA2CmF memberOf s:13WaylandClient18SurfaceContentTypeO - +s:13WaylandClient18SurfaceContentTypeO5photoyA2CmF memberOf s:13WaylandClient18SurfaceContentTypeO - +s:13WaylandClient18SurfaceContentTypeO5videoyA2CmF memberOf s:13WaylandClient18SurfaceContentTypeO - s:13WaylandClient18SurfaceRegionErrorO conformsTo s:SQ Swift.Equatable s:13WaylandClient18SurfaceRegionErrorO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:13WaylandClient18SurfaceRegionErrorO conformsTo s:s23CustomStringConvertibleP Swift.CustomStringConvertible @@ -4251,6 +4287,16 @@ s:13WaylandClient20ProtocolAvailabilityO11isAvailableSbvp memberOf s:13WaylandCl s:13WaylandClient20ProtocolAvailabilityO11unavailableyA2CmF memberOf s:13WaylandClient20ProtocolAvailabilityO - s:13WaylandClient20ProtocolAvailabilityO7versions6UInt32VSgvp memberOf s:13WaylandClient20ProtocolAvailabilityO - s:13WaylandClient20ProtocolAvailabilityO9availableyACs6UInt32V_tcACmF memberOf s:13WaylandClient20ProtocolAvailabilityO - +s:13WaylandClient20SurfaceFrameMetadataV conformsTo s:SQ Swift.Equatable +s:13WaylandClient20SurfaceFrameMetadataV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient20SurfaceFrameMetadataV conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient20SurfaceFrameMetadataV11contentType16presentationHint5alpha19colorRepresentation6damageAcA0c7ContentG0OSg_AA0c12PresentationI0OSgAA0C15AlphaMultiplierVSgAA0c5ColorL0VSgAA0C12DamageRegionVSgtcfc memberOf s:13WaylandClient20SurfaceFrameMetadataV - +s:13WaylandClient20SurfaceFrameMetadataV11contentTypeAA0c7ContentG0OSgvp memberOf s:13WaylandClient20SurfaceFrameMetadataV - +s:13WaylandClient20SurfaceFrameMetadataV16presentationHintAA0c12PresentationG0OSgvp memberOf s:13WaylandClient20SurfaceFrameMetadataV - +s:13WaylandClient20SurfaceFrameMetadataV19colorRepresentationAA0c5ColorG0VSgvp memberOf s:13WaylandClient20SurfaceFrameMetadataV - +s:13WaylandClient20SurfaceFrameMetadataV5alphaAA0C15AlphaMultiplierVSgvp memberOf s:13WaylandClient20SurfaceFrameMetadataV - +s:13WaylandClient20SurfaceFrameMetadataV6damageAA0C12DamageRegionVSgvp memberOf s:13WaylandClient20SurfaceFrameMetadataV - +s:13WaylandClient20SurfaceFrameMetadataV7defaultACvpZ memberOf s:13WaylandClient20SurfaceFrameMetadataV - s:13WaylandClient20TabletToolCapabilityO conformsTo s:SH Swift.Hashable s:13WaylandClient20TabletToolCapabilityO conformsTo s:SQ Swift.Equatable s:13WaylandClient20TabletToolCapabilityO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype @@ -4495,6 +4541,13 @@ s:13WaylandClient21SoftwareFrameGeometryV16bufferPixelPoint8logicalX0I1YAA06Buff s:13WaylandClient21SoftwareFrameGeometryV5scaleAA12SurfaceScaleVvp memberOf s:13WaylandClient21SoftwareFrameGeometryV - s:13WaylandClient21SoftwareFrameGeometryV7surfaceAA07SurfaceE0Vvp memberOf s:13WaylandClient21SoftwareFrameGeometryV - s:13WaylandClient21SoftwareFrameGeometryV7surfaceAcA07SurfaceE0V_tcfc memberOf s:13WaylandClient21SoftwareFrameGeometryV - +s:13WaylandClient21SurfaceColorAlphaModeO conformsTo s:SH Swift.Hashable +s:13WaylandClient21SurfaceColorAlphaModeO conformsTo s:SQ Swift.Equatable +s:13WaylandClient21SurfaceColorAlphaModeO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient21SurfaceColorAlphaModeO conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient21SurfaceColorAlphaModeO20premultipliedOpticalyA2CmF memberOf s:13WaylandClient21SurfaceColorAlphaModeO - +s:13WaylandClient21SurfaceColorAlphaModeO23premultipliedElectricalyA2CmF memberOf s:13WaylandClient21SurfaceColorAlphaModeO - +s:13WaylandClient21SurfaceColorAlphaModeO8straightyA2CmF memberOf s:13WaylandClient21SurfaceColorAlphaModeO - s:13WaylandClient21TabletToolProximityInV conformsTo s:SQ Swift.Equatable s:13WaylandClient21TabletToolProximityInV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:13WaylandClient21TabletToolProximityInV conformsTo s:s8SendableP Swift.Sendable @@ -4631,6 +4684,13 @@ s:13WaylandClient22SeatStateSnapshotErrorO conformsTo s:s16SendableMetatypeP Swi s:13WaylandClient22SeatStateSnapshotErrorO conformsTo s:s5ErrorP Swift.Error s:13WaylandClient22SeatStateSnapshotErrorO conformsTo s:s8SendableP Swift.Sendable s:13WaylandClient22SeatStateSnapshotErrorO29activeCapabilityNotAdvertisedyAcA0C12CapabilitiesV_AFtcACmF memberOf s:13WaylandClient22SeatStateSnapshotErrorO - +s:13WaylandClient22SurfaceAlphaMultiplierV conformsTo s:SQ Swift.Equatable +s:13WaylandClient22SurfaceAlphaMultiplierV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient22SurfaceAlphaMultiplierV conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient22SurfaceAlphaMultiplierV11transparentACvpZ memberOf s:13WaylandClient22SurfaceAlphaMultiplierV - +s:13WaylandClient22SurfaceAlphaMultiplierV6opaqueACvpZ memberOf s:13WaylandClient22SurfaceAlphaMultiplierV - +s:13WaylandClient22SurfaceAlphaMultiplierV8rawValueACs6UInt32V_tcfc memberOf s:13WaylandClient22SurfaceAlphaMultiplierV - +s:13WaylandClient22SurfaceAlphaMultiplierV8rawValues6UInt32Vvp memberOf s:13WaylandClient22SurfaceAlphaMultiplierV - s:13WaylandClient22TextInputLanguageEventV conformsTo s:SQ Swift.Equatable s:13WaylandClient22TextInputLanguageEventV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:13WaylandClient22TextInputLanguageEventV conformsTo s:s8SendableP Swift.Sendable @@ -4741,6 +4801,12 @@ s:13WaylandClient23SubsurfaceStackingErrorO conformsTo s:s8SendableP Swift.Senda s:13WaylandClient23SubsurfaceStackingErrorO11descriptionSSvp memberOf s:13WaylandClient23SubsurfaceStackingErrorO - s:13WaylandClient23SubsurfaceStackingErrorO13selfReferenceyAcA0C8IdentityVcACmF memberOf s:13WaylandClient23SubsurfaceStackingErrorO - s:13WaylandClient23SubsurfaceStackingErrorO15differentParentyAcA0C8IdentityV_AFtcACmF memberOf s:13WaylandClient23SubsurfaceStackingErrorO - +s:13WaylandClient23SurfacePresentationHintO conformsTo s:SH Swift.Hashable +s:13WaylandClient23SurfacePresentationHintO conformsTo s:SQ Swift.Equatable +s:13WaylandClient23SurfacePresentationHintO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient23SurfacePresentationHintO conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient23SurfacePresentationHintO5asyncyA2CmF memberOf s:13WaylandClient23SurfacePresentationHintO - +s:13WaylandClient23SurfacePresentationHintO5vsyncyA2CmF memberOf s:13WaylandClient23SurfacePresentationHintO - s:13WaylandClient23TextInputContentPurposeV conformsTo s:SQ Swift.Equatable s:13WaylandClient23TextInputContentPurposeV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:13WaylandClient23TextInputContentPurposeV conformsTo s:s8SendableP Swift.Sendable @@ -5042,6 +5108,18 @@ s:13WaylandClient25PresentationFeedbackFlagsV5vsyncACvpZ memberOf s:13WaylandCli s:13WaylandClient25PresentationFeedbackFlagsV8rawValueACs6UInt32V_tcfc memberOf s:13WaylandClient25PresentationFeedbackFlagsV - s:13WaylandClient25PresentationFeedbackFlagsV8rawValues6UInt32Vvp memberOf s:13WaylandClient25PresentationFeedbackFlagsV - s:13WaylandClient25PresentationFeedbackFlagsV8zeroCopyACvpZ memberOf s:13WaylandClient25PresentationFeedbackFlagsV - +s:13WaylandClient25SurfaceFrameMetadataErrorO conformsTo s:SQ Swift.Equatable +s:13WaylandClient25SurfaceFrameMetadataErrorO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient25SurfaceFrameMetadataErrorO conformsTo s:s23CustomStringConvertibleP Swift.CustomStringConvertible +s:13WaylandClient25SurfaceFrameMetadataErrorO conformsTo s:s5ErrorP Swift.Error +s:13WaylandClient25SurfaceFrameMetadataErrorO conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient25SurfaceFrameMetadataErrorO11descriptionSSvp memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - +s:13WaylandClient25SurfaceFrameMetadataErrorO22contentTypeUnavailableyA2CmF memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - +s:13WaylandClient25SurfaceFrameMetadataErrorO25unsupportedColorAlphaModeyAcA0chiJ0OcACmF memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - +s:13WaylandClient25SurfaceFrameMetadataErrorO26alphaMultiplierUnavailableyA2CmF memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - +s:13WaylandClient25SurfaceFrameMetadataErrorO27presentationHintUnavailableyA2CmF memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - +s:13WaylandClient25SurfaceFrameMetadataErrorO30colorRepresentationUnavailableyA2CmF memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - +s:13WaylandClient25SurfaceFrameMetadataErrorO33colorRepresentationSupportPendingyA2CmF memberOf s:13WaylandClient25SurfaceFrameMetadataErrorO - s:13WaylandClient25TextInputRequestOperationO conformsTo s:SH Swift.Hashable s:13WaylandClient25TextInputRequestOperationO conformsTo s:SQ Swift.Equatable s:13WaylandClient25TextInputRequestOperationO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype @@ -5181,6 +5259,11 @@ s:13WaylandClient26RelativePointerMotionEventV18unacceleratedDeltaAA0dH0Vvp memb s:13WaylandClient26RelativePointerMotionEventV4time5delta18unacceleratedDeltaAcA0A21TimestampMicrosecondsV_AA0dJ0VAJtcfc memberOf s:13WaylandClient26RelativePointerMotionEventV - s:13WaylandClient26RelativePointerMotionEventV4timeAA0A21TimestampMicrosecondsVvp memberOf s:13WaylandClient26RelativePointerMotionEventV - s:13WaylandClient26RelativePointerMotionEventV5deltaAA0D5DeltaVvp memberOf s:13WaylandClient26RelativePointerMotionEventV - +s:13WaylandClient26SurfaceColorRepresentationV conformsTo s:SQ Swift.Equatable +s:13WaylandClient26SurfaceColorRepresentationV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype +s:13WaylandClient26SurfaceColorRepresentationV conformsTo s:s8SendableP Swift.Sendable +s:13WaylandClient26SurfaceColorRepresentationV9alphaModeAA0cd5AlphaG0OSgvp memberOf s:13WaylandClient26SurfaceColorRepresentationV - +s:13WaylandClient26SurfaceColorRepresentationV9alphaModeAcA0cd5AlphaG0OSg_tcfc memberOf s:13WaylandClient26SurfaceColorRepresentationV - s:13WaylandClient26WindowDecorationDiagnosticV conformsTo s:SQ Swift.Equatable s:13WaylandClient26WindowDecorationDiagnosticV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:13WaylandClient26WindowDecorationDiagnosticV conformsTo s:s23CustomStringConvertibleP Swift.CustomStringConvertible @@ -5708,19 +5791,11 @@ s:13WaylandClient6WindowV27requestPresentationFeedbackyyYaKF memberOf s:13Waylan s:13WaylandClient6WindowV2eeoiySbAC_ACtFZ memberOf s:13WaylandClient6WindowV - s:13WaylandClient6WindowV2idAA0C2IDVvp memberOf s:13WaylandClient6WindowV - s:13WaylandClient6WindowV4hash4intoys6HasherVz_tF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV4show19timeoutMilliseconds27requestPresentationFeedback9preparing_AA08SoftwareH7OutcomeOs5Int32V_SbxAA0K16FrameReservationVYaYbKYCXEyx_AA0kN0VtYbKXEtYaKs8SendableRzlF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV4show19timeoutMilliseconds_ys5Int32V_yAA13SoftwareFrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV4show27requestPresentationFeedback19timeoutMilliseconds_AA08SoftwareF7OutcomeOSb_s5Int32VyAA0J5FrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV4show6damage19timeoutMilliseconds27requestPresentationFeedback9preparing_AA08SoftwareI7OutcomeOAA19SurfaceDamageRegionVSg_s5Int32VSbxAA0L16FrameReservationVYaYbKYCXEyx_AA0lR0VtYbKXEtYaKs8SendableRzlF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV4show6damage19timeoutMilliseconds_yAA19SurfaceDamageRegionVSg_s5Int32VyAA13SoftwareFrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV4show6damage27requestPresentationFeedback19timeoutMilliseconds_AA08SoftwareG7OutcomeOAA19SurfaceDamageRegionVSg_Sbs5Int32VyAA0K5FrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - +s:13WaylandClient6WindowV4show8metadata27requestPresentationFeedback19timeoutMilliseconds9preparing_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_Sbs5Int32VxAA0lO11ReservationVYaYbKYCXEyx_AA0lO0VtYbKXEtYaKs8SendableRzlF memberOf s:13WaylandClient6WindowV - +s:13WaylandClient6WindowV4show8metadata27requestPresentationFeedback19timeoutMilliseconds_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_Sbs5Int32VyAA0kN0VYbKXEtYaKF memberOf s:13WaylandClient6WindowV - s:13WaylandClient6WindowV5closeyyYaF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV6redraw27requestPresentationFeedback9preparing_AA08SoftwareF7OutcomeOSb_xAA0I16FrameReservationVYaYbKYCXEyx_AA0iK0VtYbKXEtYaKs8SendableRzlF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV6redraw27requestPresentationFeedback_AA08SoftwareF7OutcomeOSb_yAA0H5FrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV6redraw6damage27requestPresentationFeedback9preparing_AA08SoftwareG7OutcomeOAA19SurfaceDamageRegionVSg_SbxAA0J16FrameReservationVYaYbKYCXEyx_AA0jO0VtYbKXEtYaKs8SendableRzlF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV6redraw6damage27requestPresentationFeedback_AA08SoftwareG7OutcomeOAA19SurfaceDamageRegionVSg_SbyAA0I5FrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV6redraw6damage_yAA19SurfaceDamageRegionVSg_yAA13SoftwareFrameVYbKXEtYaKF memberOf s:13WaylandClient6WindowV - -s:13WaylandClient6WindowV6redrawyyyAA13SoftwareFrameVYbKXEYaKF memberOf s:13WaylandClient6WindowV - +s:13WaylandClient6WindowV6redraw8metadata27requestPresentationFeedback9preparing_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_SbxAA0jM11ReservationVYaYbKYCXEyx_AA0jM0VtYbKXEtYaKs8SendableRzlF memberOf s:13WaylandClient6WindowV - +s:13WaylandClient6WindowV6redraw8metadata27requestPresentationFeedback_AA08SoftwareG7OutcomeOAA20SurfaceFrameMetadataV_SbyAA0iL0VYbKXEtYaKF memberOf s:13WaylandClient6WindowV - s:13WaylandClient6WindowV7setIconyyAA0cE0OYaKF memberOf s:13WaylandClient6WindowV - s:13WaylandClient6WindowV8activate5usingyAA15ActivationTokenV_tYaKF memberOf s:13WaylandClient6WindowV - s:13WaylandClient6WindowV8geometryAA15SurfaceGeometryVvp memberOf s:13WaylandClient6WindowV - @@ -5848,23 +5923,14 @@ s:13WaylandClient0A7DisplayC0A15GraphicsPreviewE06createD13WindowBacking19window s:13WaylandClient0A7DisplayC0A15GraphicsPreviewE23graphicsBackingDecision6policyAD0adgH0OAD0aD18PresentationPolicyO_tKF swift.method WaylandDisplay.graphicsBackingDecision(policy:) func graphicsBackingDecision(policy: WaylandGraphicsPresentationPolicy = .managedGPU(fallback: .software)) throws -> WaylandGraphicsBackingDecision {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.class"}} s:13WaylandClient0A7DisplayC0A15GraphicsPreviewE19graphicsRuntimePath6policyAD0adgH0VAD0aD18PresentationPolicyO_tKF swift.method WaylandDisplay.graphicsRuntimePath(policy:) func graphicsRuntimePath(policy: WaylandGraphicsPresentationPolicy = .managedGPU(fallback: .software)) throws -> WaylandGraphicsRuntimePath {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.class"}} s:13WaylandClient0A7DisplayC0A15GraphicsPreviewE27graphicsSurfaceCapabilitiesAD0adgH0VyKF swift.method WaylandDisplay.graphicsSurfaceCapabilities() func graphicsSurfaceCapabilities() throws -> WaylandGraphicsSurfaceCapabilities {"swiftExtension":{"extendedModule":"WaylandClient","typeKind":"swift.class"}} -s:22WaylandGraphicsPreview0aB13AlphaModifierV swift.struct WaylandGraphicsAlphaModifier struct WaylandGraphicsAlphaModifier - -s:22WaylandGraphicsPreview0aB13AlphaModifierV8rawValueACs6UInt32V_tcfc swift.init WaylandGraphicsAlphaModifier.init(rawValue:) init(rawValue alphaMultiplierRawValue: UInt32) - -s:22WaylandGraphicsPreview0aB13AlphaModifierV6opaqueACvpZ swift.type.property WaylandGraphicsAlphaModifier.opaque static let opaque: WaylandGraphicsAlphaModifier - -s:22WaylandGraphicsPreview0aB13AlphaModifierV8rawValues6UInt32Vvp swift.property WaylandGraphicsAlphaModifier.rawValue let rawValue: UInt32 - -s:22WaylandGraphicsPreview0aB13AlphaModifierV11transparentACvpZ swift.type.property WaylandGraphicsAlphaModifier.transparent static let transparent: WaylandGraphicsAlphaModifier - s:22WaylandGraphicsPreview0aB15BackingDecisionO swift.enum WaylandGraphicsBackingDecision enum WaylandGraphicsBackingDecision - s:22WaylandGraphicsPreview0aB15BackingDecisionO3gpuyAcA0aB11RuntimePathVcACmF swift.enum.case WaylandGraphicsBackingDecision.gpu(_:) case gpu(WaylandGraphicsRuntimePath) - s:22WaylandGraphicsPreview0aB15BackingDecisionO8softwareyAcA0aB6ReasonOcACmF swift.enum.case WaylandGraphicsBackingDecision.software(_:) case software(WaylandGraphicsReason) - s:22WaylandGraphicsPreview0aB15BackingDecisionO11unavailableyAcA0aB6ReasonOcACmF swift.enum.case WaylandGraphicsBackingDecision.unavailable(_:) case unavailable(WaylandGraphicsReason) - s:22WaylandGraphicsPreview0aB10ClearFrameV swift.struct WaylandGraphicsClearFrame struct WaylandGraphicsClearFrame - s:22WaylandGraphicsPreview0aB10ClearFrameV5colorAA0aB9XRGBColorVvp swift.property WaylandGraphicsClearFrame.color let color: WaylandGraphicsXRGBColor - -s:22WaylandGraphicsPreview0aB10ClearFrameV5color8metadataAcA0aB9XRGBColorV_AA0abE8MetadataVtcfc swift.init WaylandGraphicsClearFrame.init(color:metadata:) init(color clearColor: WaylandGraphicsXRGBColor, metadata frameMetadata: WaylandGraphicsFrameMetadata = .default) - -s:22WaylandGraphicsPreview0aB10ClearFrameV8metadataAA0abE8MetadataVvp swift.property WaylandGraphicsClearFrame.metadata let metadata: WaylandGraphicsFrameMetadata - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO swift.enum WaylandGraphicsColorAlphaMode enum WaylandGraphicsColorAlphaMode - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO23premultipliedElectricalyA2CmF swift.enum.case WaylandGraphicsColorAlphaMode.premultipliedElectrical case premultipliedElectrical - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO20premultipliedOpticalyA2CmF swift.enum.case WaylandGraphicsColorAlphaMode.premultipliedOptical case premultipliedOptical - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO8straightyA2CmF swift.enum.case WaylandGraphicsColorAlphaMode.straight case straight - +s:22WaylandGraphicsPreview0aB10ClearFrameV5color8metadataAcA0aB9XRGBColorV_0A6Client07SurfaceE8MetadataVtcfc swift.init WaylandGraphicsClearFrame.init(color:metadata:) init(color clearColor: WaylandGraphicsXRGBColor, metadata frameMetadata: SurfaceFrameMetadata = .default) - +s:22WaylandGraphicsPreview0aB10ClearFrameV8metadata0A6Client07SurfaceE8MetadataVvp swift.property WaylandGraphicsClearFrame.metadata let metadata: SurfaceFrameMetadata - s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV swift.struct WaylandGraphicsColorMetadataAvailability struct WaylandGraphicsColorMetadataAvailability - s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV13alphaModifierAA0ab8ProtocolF0Ovp swift.property WaylandGraphicsColorMetadataAvailability.alphaModifier let alphaModifier: WaylandGraphicsProtocolAvailability - s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV15colorManagementAA0ab8ProtocolF0Ovp swift.property WaylandGraphicsColorMetadataAvailability.colorManagement let colorManagement: WaylandGraphicsProtocolAvailability - @@ -5873,9 +5939,6 @@ s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV11contentTypeAA0ab8Prot s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV11contentType13alphaModifier14tearingControl19colorRepresentation0M10ManagementAcA0ab8ProtocolF0O_A4Jtcfc swift.init WaylandGraphicsColorMetadataAvailability.init(contentType:alphaModifier:tearingControl:colorRepresentation:colorManagement:) init(contentType: WaylandGraphicsProtocolAvailability, alphaModifier: WaylandGraphicsProtocolAvailability, tearingControl: WaylandGraphicsProtocolAvailability, colorRepresentation: WaylandGraphicsProtocolAvailability, colorManagement: WaylandGraphicsProtocolAvailability) - s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV14tearingControlAA0ab8ProtocolF0Ovp swift.property WaylandGraphicsColorMetadataAvailability.tearingControl let tearingControl: WaylandGraphicsProtocolAvailability - s:22WaylandGraphicsPreview0aB25ColorMetadataAvailabilityV11unavailableACvpZ swift.type.property WaylandGraphicsColorMetadataAvailability.unavailable static let unavailable: WaylandGraphicsColorMetadataAvailability - -s:22WaylandGraphicsPreview0aB19ColorRepresentationV swift.struct WaylandGraphicsColorRepresentation struct WaylandGraphicsColorRepresentation - -s:22WaylandGraphicsPreview0aB19ColorRepresentationV9alphaModeAA0abd5AlphaG0OSgvp swift.property WaylandGraphicsColorRepresentation.alphaMode var alphaMode: WaylandGraphicsColorAlphaMode? - -s:22WaylandGraphicsPreview0aB19ColorRepresentationV9alphaModeAcA0abd5AlphaG0OSg_tcfc swift.init WaylandGraphicsColorRepresentation.init(alphaMode:) init(alphaMode colorAlphaMode: WaylandGraphicsColorAlphaMode? = nil) - s:22WaylandGraphicsPreview0aB13ConfigurationV swift.struct WaylandGraphicsConfiguration struct WaylandGraphicsConfiguration - s:22WaylandGraphicsPreview0aB13ConfigurationV7defaultACvpZ swift.type.property WaylandGraphicsConfiguration.default static let `default`: WaylandGraphicsConfiguration - s:22WaylandGraphicsPreview0aB13ConfigurationV18presentationPolicy015synchronizationF006pacingF008metadataF00e8FeedbackF0AcA0ab12PresentationF0O_AA0ab15SynchronizationF0OAA0ab6PacingF0OAA0ab8MetadataF0OAA0abkjF0Otcfc swift.init WaylandGraphicsConfiguration.init(presentationPolicy:synchronizationPolicy:pacingPolicy:metadataPolicy:presentationFeedbackPolicy:) init(presentationPolicy requestedPresentationPolicy: WaylandGraphicsPresentationPolicy = .managedGPU(fallback: .software), synchronizationPolicy frameSynchronizationPolicy: WaylandGraphicsSynchronizationPolicy = .implicitOnly, pacingPolicy framePacingPolicy: WaylandGraphicsPacingPolicy = .none, metadataPolicy frameMetadataPolicy: WaylandGraphicsMetadataPolicy = .none, presentationFeedbackPolicy framePresentationFeedbackPolicy: WaylandGraphicsPresentationFeedbackPolicy = .none) - @@ -5884,11 +5947,6 @@ s:22WaylandGraphicsPreview0aB13ConfigurationV12pacingPolicyAA0ab6PacingF0Ovp swi s:22WaylandGraphicsPreview0aB13ConfigurationV26presentationFeedbackPolicyAA0ab12PresentationfG0Ovp swift.property WaylandGraphicsConfiguration.presentationFeedbackPolicy var presentationFeedbackPolicy: WaylandGraphicsPresentationFeedbackPolicy - s:22WaylandGraphicsPreview0aB13ConfigurationV18presentationPolicyAA0ab12PresentationF0Ovp swift.property WaylandGraphicsConfiguration.presentationPolicy var presentationPolicy: WaylandGraphicsPresentationPolicy - s:22WaylandGraphicsPreview0aB13ConfigurationV21synchronizationPolicyAA0ab15SynchronizationF0Ovp swift.property WaylandGraphicsConfiguration.synchronizationPolicy var synchronizationPolicy: WaylandGraphicsSynchronizationPolicy - -s:22WaylandGraphicsPreview0aB11ContentTypeO swift.enum WaylandGraphicsContentType enum WaylandGraphicsContentType - -s:22WaylandGraphicsPreview0aB11ContentTypeO4gameyA2CmF swift.enum.case WaylandGraphicsContentType.game case game - -s:22WaylandGraphicsPreview0aB11ContentTypeO4noneyA2CmF swift.enum.case WaylandGraphicsContentType.none case none - -s:22WaylandGraphicsPreview0aB11ContentTypeO5photoyA2CmF swift.enum.case WaylandGraphicsContentType.photo case photo - -s:22WaylandGraphicsPreview0aB11ContentTypeO5videoyA2CmF swift.enum.case WaylandGraphicsContentType.video case video - s:22WaylandGraphicsPreview0aB9DRMFormatV swift.struct WaylandGraphicsDRMFormat struct WaylandGraphicsDRMFormat - s:22WaylandGraphicsPreview0aB9DRMFormatV8argb8888ACvpZ swift.type.property WaylandGraphicsDRMFormat.argb8888 static let argb8888: WaylandGraphicsDRMFormat - s:22WaylandGraphicsPreview0aB9DRMFormatV8rawValueACs6UInt32V_tKcfc swift.init WaylandGraphicsDRMFormat.init(rawValue:) init(rawValue formatRawValue: UInt32) throws - @@ -5899,10 +5957,6 @@ s:22WaylandGraphicsPreview0aB17DRMFormatModifierV8rawValueACs6UInt64V_tcfc swift s:22WaylandGraphicsPreview0aB17DRMFormatModifierV7invalidACvpZ swift.type.property WaylandGraphicsDRMFormatModifier.invalid static let invalid: WaylandGraphicsDRMFormatModifier - s:22WaylandGraphicsPreview0aB17DRMFormatModifierV6linearACvpZ swift.type.property WaylandGraphicsDRMFormatModifier.linear static let linear: WaylandGraphicsDRMFormatModifier - s:22WaylandGraphicsPreview0aB17DRMFormatModifierV8rawValues6UInt64Vvp swift.property WaylandGraphicsDRMFormatModifier.rawValue let rawValue: UInt64 - -s:22WaylandGraphicsPreview0aB12DamageRegionV swift.struct WaylandGraphicsDamageRegion struct WaylandGraphicsDamageRegion - -s:22WaylandGraphicsPreview0aB12DamageRegionV9fullFrameACvpZ swift.type.property WaylandGraphicsDamageRegion.fullFrame static let fullFrame: WaylandGraphicsDamageRegion - -s:22WaylandGraphicsPreview0aB12DamageRegionV5rectsACSay0A6Client11LogicalRectVG_tcfc swift.init WaylandGraphicsDamageRegion.init(rects:) init(rects damageRects: [LogicalRect]) - -s:22WaylandGraphicsPreview0aB12DamageRegionV5rectsSay0A6Client11LogicalRectVGvp swift.property WaylandGraphicsDamageRegion.rects let rects: [LogicalRect] - s:22WaylandGraphicsPreview0aB5ErrorO swift.enum WaylandGraphicsError enum WaylandGraphicsError - s:22WaylandGraphicsPreview0aB5ErrorO13backingClosedyA2CmF swift.enum.case WaylandGraphicsError.backingClosed case backingClosed - s:22WaylandGraphicsPreview0aB5ErrorO25externalBufferUnavailableyAcA0ab8ExternalF2IDV_AA0abhF9LifecycleOtcACmF swift.enum.case WaylandGraphicsError.externalBufferUnavailable(id:state:) case externalBufferUnavailable(id: WaylandGraphicsExternalBufferID, state: WaylandGraphicsExternalBufferLifecycle) - @@ -5965,8 +6019,8 @@ s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV swift.struct WaylandGr s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6bufferAA0abdE0Vvp swift.property WaylandGraphicsExternalBufferRenderLease.buffer var buffer: WaylandGraphicsExternalBuffer { get } - s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6cancelyyYaF swift.method WaylandGraphicsExternalBufferRenderLease.cancel() consuming func cancel() async - s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV8contractAA0aB13FrameContractVvp swift.property WaylandGraphicsExternalBufferRenderLease.contract var contract: WaylandGraphicsFrameContract { get } - -s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit22acquireSynchronization8metadata8scheduleAA0abdE17SubmissionReceiptVAA0abd7AcquireJ0O_AA0aB13FrameMetadataVAA0abP8ScheduleVSgtYaKF swift.method WaylandGraphicsExternalBufferRenderLease.submit(acquireSynchronization:metadata:schedule:) @discardableResult consuming func submit(acquireSynchronization: WaylandGraphicsExternalAcquireSynchronization, metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt - -s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit8metadata8scheduleAA0abdE17SubmissionReceiptVAA0aB13FrameMetadataV_AA0abM8ScheduleVSgtYaKF swift.method WaylandGraphicsExternalBufferRenderLease.submit(metadata:schedule:) @discardableResult consuming func submit(metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt - +s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit22acquireSynchronization8metadata8scheduleAA0abdE17SubmissionReceiptVAA0abd7AcquireJ0O_0A6Client20SurfaceFrameMetadataVAA0abR8ScheduleVSgtYaKF swift.method WaylandGraphicsExternalBufferRenderLease.submit(acquireSynchronization:metadata:schedule:) @discardableResult consuming func submit(acquireSynchronization: WaylandGraphicsExternalAcquireSynchronization, metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt - +s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit8metadata8scheduleAA0abdE17SubmissionReceiptV0A6Client20SurfaceFrameMetadataV_AA0abO8ScheduleVSgtYaKF swift.method WaylandGraphicsExternalBufferRenderLease.submit(metadata:schedule:) @discardableResult consuming func submit(metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil) async throws -> WaylandGraphicsExternalBufferSubmissionReceipt - s:22WaylandGraphicsPreview0aB31ExternalBufferSubmissionReceiptV swift.struct WaylandGraphicsExternalBufferSubmissionReceipt struct WaylandGraphicsExternalBufferSubmissionReceipt - s:22WaylandGraphicsPreview0aB31ExternalBufferSubmissionReceiptV8bufferIDAA0abdeI0Vvp swift.property WaylandGraphicsExternalBufferSubmissionReceipt.bufferID let bufferID: WaylandGraphicsExternalBufferID - s:22WaylandGraphicsPreview0aB31ExternalBufferSubmissionReceiptV18contractGenerationAA0ab7SurfaceI0Vvp swift.property WaylandGraphicsExternalBufferSubmissionReceipt.contractGeneration let contractGeneration: WaylandGraphicsSurfaceGeneration - @@ -6038,16 +6092,8 @@ s:22WaylandGraphicsPreview0aB10FrameLeaseV11runtimePathAA0ab7RuntimeG0Vvp swift. s:22WaylandGraphicsPreview0aB10FrameLeaseV4size0A6Client17PositivePixelSizeVvp swift.property WaylandGraphicsFrameLease.size var size: PositivePixelSize { get } - s:22WaylandGraphicsPreview0aB10FrameLeaseV6submityAA0abD6ResultVAA0ab9SubmittedD0OYaKF swift.method WaylandGraphicsFrameLease.submit(_:) @discardableResult consuming func submit(_ frame: WaylandGraphicsSubmittedFrame) async throws -> WaylandGraphicsFrameResult - s:22WaylandGraphicsPreview0aB10FrameLeaseV6submit_8scheduleAA0abD6ResultVAA0ab9SubmittedD0O_AA0abD8ScheduleVtYaKF swift.method WaylandGraphicsFrameLease.submit(_:schedule:) @discardableResult consuming func submit(_ frame: WaylandGraphicsSubmittedFrame, schedule frameSchedule: WaylandGraphicsFrameSchedule) async throws -> WaylandGraphicsFrameResult - -s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8metadata_AA0abD6ResultVAA0abD8MetadataV_y0A6Client0gD0VYbKXEtYaKF swift.method WaylandGraphicsFrameLease.submitSoftware(metadata:_:) @discardableResult consuming func submitSoftware(metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> WaylandGraphicsFrameResult - -s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8schedule8metadata_AA0abD6ResultVAA0abD8ScheduleV_AA0abD8MetadataVy0A6Client0gD0VYbKXEtYaKF swift.method WaylandGraphicsFrameLease.submitSoftware(schedule:metadata:_:) @discardableResult consuming func submitSoftware(schedule frameSchedule: WaylandGraphicsFrameSchedule, metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> WaylandGraphicsFrameResult - -s:22WaylandGraphicsPreview0aB13FrameMetadataV swift.struct WaylandGraphicsFrameMetadata struct WaylandGraphicsFrameMetadata - -s:22WaylandGraphicsPreview0aB13FrameMetadataV5alphaAA0aB13AlphaModifierVSgvp swift.property WaylandGraphicsFrameMetadata.alpha var alpha: WaylandGraphicsAlphaModifier? - -s:22WaylandGraphicsPreview0aB13FrameMetadataV19colorRepresentationAA0ab5ColorG0VSgvp swift.property WaylandGraphicsFrameMetadata.colorRepresentation var colorRepresentation: WaylandGraphicsColorRepresentation? - -s:22WaylandGraphicsPreview0aB13FrameMetadataV11contentTypeAA0ab7ContentG0OSgvp swift.property WaylandGraphicsFrameMetadata.contentType var contentType: WaylandGraphicsContentType? - -s:22WaylandGraphicsPreview0aB13FrameMetadataV6damageAA0aB12DamageRegionVSgvp swift.property WaylandGraphicsFrameMetadata.damage var damage: WaylandGraphicsDamageRegion? - -s:22WaylandGraphicsPreview0aB13FrameMetadataV7defaultACvpZ swift.type.property WaylandGraphicsFrameMetadata.default static let `default`: WaylandGraphicsFrameMetadata - -s:22WaylandGraphicsPreview0aB13FrameMetadataV11contentType16presentationHint5alpha19colorRepresentation6damageAcA0ab7ContentG0OSg_AA0ab12PresentationI0OSgAA0aB13AlphaModifierVSgAA0ab5ColorL0VSgAA0aB12DamageRegionVSgtcfc swift.init WaylandGraphicsFrameMetadata.init(contentType:presentationHint:alpha:colorRepresentation:damage:) init(contentType frameContentType: WaylandGraphicsContentType? = nil, presentationHint framePresentationHint: WaylandGraphicsPresentationHint? = nil, alpha frameAlpha: WaylandGraphicsAlphaModifier? = nil, colorRepresentation frameColorRepresentation: WaylandGraphicsColorRepresentation? = nil, damage frameDamage: WaylandGraphicsDamageRegion? = nil) - -s:22WaylandGraphicsPreview0aB13FrameMetadataV16presentationHintAA0ab12PresentationG0OSgvp swift.property WaylandGraphicsFrameMetadata.presentationHint var presentationHint: WaylandGraphicsPresentationHint? - +s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8metadata_AA0abD6ResultV0A6Client07SurfaceD8MetadataV_yAH0gD0VYbKXEtYaKF swift.method WaylandGraphicsFrameLease.submitSoftware(metadata:_:) @discardableResult consuming func submitSoftware(metadata frameMetadata: SurfaceFrameMetadata = .default, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> WaylandGraphicsFrameResult - +s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8schedule8metadata_AA0abD6ResultVAA0abD8ScheduleV_0A6Client07SurfaceD8MetadataVyAK0gD0VYbKXEtYaKF swift.method WaylandGraphicsFrameLease.submitSoftware(schedule:metadata:_:) @discardableResult consuming func submitSoftware(schedule frameSchedule: WaylandGraphicsFrameSchedule, metadata frameMetadata: SurfaceFrameMetadata = .default, _ draw: sending @Sendable (borrowing SoftwareFrame) throws -> Void) async throws -> WaylandGraphicsFrameResult - s:22WaylandGraphicsPreview0aB23FramePacingAvailabilityV swift.struct WaylandGraphicsFramePacingAvailability struct WaylandGraphicsFramePacingAvailability - s:22WaylandGraphicsPreview0aB23FramePacingAvailabilityV12commitTimingAA0ab8ProtocolF0Ovp swift.property WaylandGraphicsFramePacingAvailability.commitTiming let commitTiming: WaylandGraphicsProtocolAvailability - s:22WaylandGraphicsPreview0aB23FramePacingAvailabilityV4fifoAA0ab8ProtocolF0Ovp swift.property WaylandGraphicsFramePacingAvailability.fifo let fifo: WaylandGraphicsProtocolAvailability - @@ -6059,8 +6105,8 @@ s:22WaylandGraphicsPreview0aB18FramePacingRequestO4fifoyA2CmF swift.enum.case Wa s:22WaylandGraphicsPreview0aB18FramePacingRequestO4noneyA2CmF swift.enum.case WaylandGraphicsFramePacingRequest.none case none - s:22WaylandGraphicsPreview0aB11FrameResultV swift.struct WaylandGraphicsFrameResult struct WaylandGraphicsFrameResult - s:22WaylandGraphicsPreview0aB11FrameResultV7backingAA0aB13RuntimeStatusOvp swift.property WaylandGraphicsFrameResult.backing var backing: WaylandGraphicsRuntimeStatus { get } - -s:22WaylandGraphicsPreview0aB11FrameResultV11runtimePath9operation4size8metadata8schedule29presentationFeedbackRequested21synchronizationPolicy06pacingP0AcA0ab7RuntimeG0V_AA0aB19SubmissionOperationO0A6Client17PositivePixelSizeVAA0abD8MetadataVAA0abD8ScheduleVSgSbAA0ab15SynchronizationP0OAA0ab6PacingP0Otcfc swift.init WaylandGraphicsFrameResult.init(runtimePath:operation:size:metadata:schedule:presentationFeedbackRequested:synchronizationPolicy:pacingPolicy:) init(runtimePath frameRuntimePath: WaylandGraphicsRuntimePath, operation frameOperation: WaylandGraphicsSubmissionOperation, size frameSize: PositivePixelSize, metadata frameMetadata: WaylandGraphicsFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil, presentationFeedbackRequested framePresentationFeedbackRequested: Bool = false, synchronizationPolicy frameSynchronizationPolicy: WaylandGraphicsSynchronizationPolicy = .implicitOnly, pacingPolicy framePacingPolicy: WaylandGraphicsPacingPolicy = .none) - -s:22WaylandGraphicsPreview0aB11FrameResultV8metadataAA0abD8MetadataVvp swift.property WaylandGraphicsFrameResult.metadata let metadata: WaylandGraphicsFrameMetadata - +s:22WaylandGraphicsPreview0aB11FrameResultV11runtimePath9operation4size8metadata8schedule29presentationFeedbackRequested21synchronizationPolicy06pacingP0AcA0ab7RuntimeG0V_AA0aB19SubmissionOperationO0A6Client17PositivePixelSizeVAP07SurfaceD8MetadataVAA0abD8ScheduleVSgSbAA0ab15SynchronizationP0OAA0ab6PacingP0Otcfc swift.init WaylandGraphicsFrameResult.init(runtimePath:operation:size:metadata:schedule:presentationFeedbackRequested:synchronizationPolicy:pacingPolicy:) init(runtimePath frameRuntimePath: WaylandGraphicsRuntimePath, operation frameOperation: WaylandGraphicsSubmissionOperation, size frameSize: PositivePixelSize, metadata frameMetadata: SurfaceFrameMetadata = .default, schedule frameSchedule: WaylandGraphicsFrameSchedule? = nil, presentationFeedbackRequested framePresentationFeedbackRequested: Bool = false, synchronizationPolicy frameSynchronizationPolicy: WaylandGraphicsSynchronizationPolicy = .implicitOnly, pacingPolicy framePacingPolicy: WaylandGraphicsPacingPolicy = .none) - +s:22WaylandGraphicsPreview0aB11FrameResultV8metadata0A6Client07SurfaceD8MetadataVvp swift.property WaylandGraphicsFrameResult.metadata let metadata: SurfaceFrameMetadata - s:22WaylandGraphicsPreview0aB11FrameResultV9operationAA0aB19SubmissionOperationOvp swift.property WaylandGraphicsFrameResult.operation let operation: WaylandGraphicsSubmissionOperation - s:22WaylandGraphicsPreview0aB11FrameResultV12pacingPolicyAA0ab6PacingG0Ovp swift.property WaylandGraphicsFrameResult.pacingPolicy let pacingPolicy: WaylandGraphicsPacingPolicy - s:22WaylandGraphicsPreview0aB11FrameResultV29presentationFeedbackRequestedSbvp swift.property WaylandGraphicsFrameResult.presentationFeedbackRequested let presentationFeedbackRequested: Bool - @@ -6096,9 +6142,6 @@ s:22WaylandGraphicsPreview0aB26PresentationFeedbackPolicyO swift.enum WaylandGra s:22WaylandGraphicsPreview0aB26PresentationFeedbackPolicyO4noneyA2CmF swift.enum.case WaylandGraphicsPresentationFeedbackPolicy.none case none - s:22WaylandGraphicsPreview0aB26PresentationFeedbackPolicyO20requestWhenAvailableyA2CmF swift.enum.case WaylandGraphicsPresentationFeedbackPolicy.requestWhenAvailable case requestWhenAvailable - s:22WaylandGraphicsPreview0aB26PresentationFeedbackPolicyO7requireyA2CmF swift.enum.case WaylandGraphicsPresentationFeedbackPolicy.require case require - -s:22WaylandGraphicsPreview0aB16PresentationHintO swift.enum WaylandGraphicsPresentationHint enum WaylandGraphicsPresentationHint - -s:22WaylandGraphicsPreview0aB16PresentationHintO5asyncyA2CmF swift.enum.case WaylandGraphicsPresentationHint.async case async - -s:22WaylandGraphicsPreview0aB16PresentationHintO5vsyncyA2CmF swift.enum.case WaylandGraphicsPresentationHint.vsync case vsync - s:22WaylandGraphicsPreview0aB18PresentationPolicyO swift.enum WaylandGraphicsPresentationPolicy enum WaylandGraphicsPresentationPolicy - s:22WaylandGraphicsPreview0aB18PresentationPolicyO6decide12capabilitiesAA0aB15BackingDecisionO0A6Client0A12CapabilitiesV_tF swift.method WaylandGraphicsPresentationPolicy.decide(capabilities:) func decide(capabilities: WaylandCapabilities) -> WaylandGraphicsBackingDecision {"swiftExtension":{"extendedModule":"WaylandGraphicsPreview","typeKind":"swift.enum"}} s:22WaylandGraphicsPreview0aB18PresentationPolicyO6decide12capabilitiesAA0aB15BackingDecisionOAA0aB19SurfaceCapabilitiesV_tF swift.method WaylandGraphicsPresentationPolicy.decide(capabilities:) func decide(capabilities: WaylandGraphicsSurfaceCapabilities) -> WaylandGraphicsBackingDecision {"swiftExtension":{"extendedModule":"WaylandGraphicsPreview","typeKind":"swift.enum"}} @@ -6234,14 +6277,14 @@ s:13WaylandClient0A7DisplayC0A15GraphicsPreviewE27graphicsSurfaceCapabilitiesAD0 s:22WaylandGraphicsPreview0aB10ClearFrameV conformsTo s:SQ Swift.Equatable s:22WaylandGraphicsPreview0aB10ClearFrameV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB10ClearFrameV conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB10ClearFrameV5color8metadataAcA0aB9XRGBColorV_AA0abE8MetadataVtcfc memberOf s:22WaylandGraphicsPreview0aB10ClearFrameV - +s:22WaylandGraphicsPreview0aB10ClearFrameV5color8metadataAcA0aB9XRGBColorV_0A6Client07SurfaceE8MetadataVtcfc memberOf s:22WaylandGraphicsPreview0aB10ClearFrameV - s:22WaylandGraphicsPreview0aB10ClearFrameV5colorAA0aB9XRGBColorVvp memberOf s:22WaylandGraphicsPreview0aB10ClearFrameV - -s:22WaylandGraphicsPreview0aB10ClearFrameV8metadataAA0abE8MetadataVvp memberOf s:22WaylandGraphicsPreview0aB10ClearFrameV - +s:22WaylandGraphicsPreview0aB10ClearFrameV8metadata0A6Client07SurfaceE8MetadataVvp memberOf s:22WaylandGraphicsPreview0aB10ClearFrameV - s:22WaylandGraphicsPreview0aB10FrameLeaseV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB10FrameLeaseV conformsTo s:s8SendableP Swift.Sendable s:22WaylandGraphicsPreview0aB10FrameLeaseV11runtimePathAA0ab7RuntimeG0Vvp memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - -s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8metadata_AA0abD6ResultVAA0abD8MetadataV_y0A6Client0gD0VYbKXEtYaKF memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - -s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8schedule8metadata_AA0abD6ResultVAA0abD8ScheduleV_AA0abD8MetadataVy0A6Client0gD0VYbKXEtYaKF memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - +s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8metadata_AA0abD6ResultV0A6Client07SurfaceD8MetadataV_yAH0gD0VYbKXEtYaKF memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - +s:22WaylandGraphicsPreview0aB10FrameLeaseV14submitSoftware8schedule8metadata_AA0abD6ResultVAA0abD8ScheduleV_0A6Client07SurfaceD8MetadataVyAK0gD0VYbKXEtYaKF memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - s:22WaylandGraphicsPreview0aB10FrameLeaseV21reserveExternalBufferyAA0abgh6RenderE0VAA0abgH0VYaKF memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - s:22WaylandGraphicsPreview0aB10FrameLeaseV4size0A6Client17PositivePixelSizeVvp memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - s:22WaylandGraphicsPreview0aB10FrameLeaseV6cancelyyYaF memberOf s:22WaylandGraphicsPreview0aB10FrameLeaseV - @@ -6255,25 +6298,17 @@ s:22WaylandGraphicsPreview0aB10RenderNodeV conformsTo s:s23CustomStringConvertib s:22WaylandGraphicsPreview0aB10RenderNodeV conformsTo s:s8SendableP Swift.Sendable s:22WaylandGraphicsPreview0aB10RenderNodeV11descriptionSSvp memberOf s:22WaylandGraphicsPreview0aB10RenderNodeV - s:22WaylandGraphicsPreview0aB10RenderNodeV13deviceIDBytesSays5UInt8VGvp memberOf s:22WaylandGraphicsPreview0aB10RenderNodeV - -s:22WaylandGraphicsPreview0aB11ContentTypeO conformsTo s:SH Swift.Hashable -s:22WaylandGraphicsPreview0aB11ContentTypeO conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB11ContentTypeO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB11ContentTypeO conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB11ContentTypeO4gameyA2CmF memberOf s:22WaylandGraphicsPreview0aB11ContentTypeO - -s:22WaylandGraphicsPreview0aB11ContentTypeO4noneyA2CmF memberOf s:22WaylandGraphicsPreview0aB11ContentTypeO - -s:22WaylandGraphicsPreview0aB11ContentTypeO5photoyA2CmF memberOf s:22WaylandGraphicsPreview0aB11ContentTypeO - -s:22WaylandGraphicsPreview0aB11ContentTypeO5videoyA2CmF memberOf s:22WaylandGraphicsPreview0aB11ContentTypeO - s:22WaylandGraphicsPreview0aB11FrameResultV conformsTo s:SQ Swift.Equatable s:22WaylandGraphicsPreview0aB11FrameResultV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB11FrameResultV conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB11FrameResultV11runtimePath9operation4size8metadata8schedule29presentationFeedbackRequested21synchronizationPolicy06pacingP0AcA0ab7RuntimeG0V_AA0aB19SubmissionOperationO0A6Client17PositivePixelSizeVAA0abD8MetadataVAA0abD8ScheduleVSgSbAA0ab15SynchronizationP0OAA0ab6PacingP0Otcfc memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - +s:22WaylandGraphicsPreview0aB11FrameResultV11runtimePath9operation4size8metadata8schedule29presentationFeedbackRequested21synchronizationPolicy06pacingP0AcA0ab7RuntimeG0V_AA0aB19SubmissionOperationO0A6Client17PositivePixelSizeVAP07SurfaceD8MetadataVAA0abD8ScheduleVSgSbAA0ab15SynchronizationP0OAA0ab6PacingP0Otcfc memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV11runtimePathAA0ab7RuntimeG0Vvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV12pacingPolicyAA0ab6PacingG0Ovp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV21synchronizationPolicyAA0ab15SynchronizationG0Ovp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV29presentationFeedbackRequestedSbvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV4size0A6Client17PositivePixelSizeVvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV7backingAA0aB13RuntimeStatusOvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - -s:22WaylandGraphicsPreview0aB11FrameResultV8metadataAA0abD8MetadataVvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - +s:22WaylandGraphicsPreview0aB11FrameResultV8metadata0A6Client07SurfaceD8MetadataVvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV8scheduleAA0abD8ScheduleVvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11FrameResultV9operationAA0aB19SubmissionOperationOvp memberOf s:22WaylandGraphicsPreview0aB11FrameResultV - s:22WaylandGraphicsPreview0aB11RuntimePathV conformsTo s:SQ Swift.Equatable @@ -6297,12 +6332,6 @@ s:22WaylandGraphicsPreview0aB11RuntimePathV8fallbackAA0aB6ReasonOSgvp memberOf s s:22WaylandGraphicsPreview0aB11RuntimePathV8metadataAA0aB14MetadataStatusVvp memberOf s:22WaylandGraphicsPreview0aB11RuntimePathV - s:22WaylandGraphicsPreview0aB11RuntimePathV9projected12capabilities6policyAC0A6Client0A12CapabilitiesV_AA0aB18PresentationPolicyOtFZ memberOf s:22WaylandGraphicsPreview0aB11RuntimePathV - s:22WaylandGraphicsPreview0aB11RuntimePathV9projected12capabilities6policyAcA0aB19SurfaceCapabilitiesV_AA0aB18PresentationPolicyOtFZ memberOf s:22WaylandGraphicsPreview0aB11RuntimePathV - -s:22WaylandGraphicsPreview0aB12DamageRegionV conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB12DamageRegionV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB12DamageRegionV conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB12DamageRegionV5rectsACSay0A6Client11LogicalRectVG_tcfc memberOf s:22WaylandGraphicsPreview0aB12DamageRegionV - -s:22WaylandGraphicsPreview0aB12DamageRegionV5rectsSay0A6Client11LogicalRectVGvp memberOf s:22WaylandGraphicsPreview0aB12DamageRegionV - -s:22WaylandGraphicsPreview0aB12DamageRegionV9fullFrameACvpZ memberOf s:22WaylandGraphicsPreview0aB12DamageRegionV - s:22WaylandGraphicsPreview0aB12PacingPolicyO conformsTo s:SH Swift.Hashable s:22WaylandGraphicsPreview0aB12PacingPolicyO conformsTo s:SQ Swift.Equatable s:22WaylandGraphicsPreview0aB12PacingPolicyO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype @@ -6316,13 +6345,6 @@ s:22WaylandGraphicsPreview0aB12PacingStatusV conformsTo s:s8SendableP Swift.Send s:22WaylandGraphicsPreview0aB12PacingStatusV12commitTimingAA0ab7RuntimeE0Ovp memberOf s:22WaylandGraphicsPreview0aB12PacingStatusV - s:22WaylandGraphicsPreview0aB12PacingStatusV4fifo12commitTimingAcA0ab7RuntimeE0O_AGtcfc memberOf s:22WaylandGraphicsPreview0aB12PacingStatusV - s:22WaylandGraphicsPreview0aB12PacingStatusV4fifoAA0ab7RuntimeE0Ovp memberOf s:22WaylandGraphicsPreview0aB12PacingStatusV - -s:22WaylandGraphicsPreview0aB13AlphaModifierV conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB13AlphaModifierV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB13AlphaModifierV conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB13AlphaModifierV11transparentACvpZ memberOf s:22WaylandGraphicsPreview0aB13AlphaModifierV - -s:22WaylandGraphicsPreview0aB13AlphaModifierV6opaqueACvpZ memberOf s:22WaylandGraphicsPreview0aB13AlphaModifierV - -s:22WaylandGraphicsPreview0aB13AlphaModifierV8rawValueACs6UInt32V_tcfc memberOf s:22WaylandGraphicsPreview0aB13AlphaModifierV - -s:22WaylandGraphicsPreview0aB13AlphaModifierV8rawValues6UInt32Vvp memberOf s:22WaylandGraphicsPreview0aB13AlphaModifierV - s:22WaylandGraphicsPreview0aB13ConfigurationV conformsTo s:SQ Swift.Equatable s:22WaylandGraphicsPreview0aB13ConfigurationV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB13ConfigurationV conformsTo s:s8SendableP Swift.Sendable @@ -6342,16 +6364,6 @@ s:22WaylandGraphicsPreview0aB13FrameContractV15synchronizationAA0aB35ExternalSyn s:22WaylandGraphicsPreview0aB13FrameContractV28externalBufferConfigurationsSayAA0ab8ExternalG13ConfigurationVGvp memberOf s:22WaylandGraphicsPreview0aB13FrameContractV - s:22WaylandGraphicsPreview0aB13FrameContractV34recommendedExternalConfigurationIDAA0abghI0VSgvp memberOf s:22WaylandGraphicsPreview0aB13FrameContractV - s:22WaylandGraphicsPreview0aB13FrameContractV8geometry0A6Client15SurfaceGeometryVvp memberOf s:22WaylandGraphicsPreview0aB13FrameContractV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB13FrameMetadataV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB13FrameMetadataV conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB13FrameMetadataV11contentType16presentationHint5alpha19colorRepresentation6damageAcA0ab7ContentG0OSg_AA0ab12PresentationI0OSgAA0aB13AlphaModifierVSgAA0ab5ColorL0VSgAA0aB12DamageRegionVSgtcfc memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV11contentTypeAA0ab7ContentG0OSgvp memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV16presentationHintAA0ab12PresentationG0OSgvp memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV19colorRepresentationAA0ab5ColorG0VSgvp memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV5alphaAA0aB13AlphaModifierVSgvp memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV6damageAA0aB12DamageRegionVSgvp memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - -s:22WaylandGraphicsPreview0aB13FrameMetadataV7defaultACvpZ memberOf s:22WaylandGraphicsPreview0aB13FrameMetadataV - s:22WaylandGraphicsPreview0aB13FrameScheduleV conformsTo s:SQ Swift.Equatable s:22WaylandGraphicsPreview0aB13FrameScheduleV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB13FrameScheduleV conformsTo s:s8SendableP Swift.Sendable @@ -6383,13 +6395,6 @@ s:22WaylandGraphicsPreview0aB13WindowBackingV2id0A6Client0D2IDVvp memberOf s:22W s:22WaylandGraphicsPreview0aB13WindowBackingV5closeyyYaF memberOf s:22WaylandGraphicsPreview0aB13WindowBackingV - s:22WaylandGraphicsPreview0aB13WindowBackingV6window0A6Client0D0Vvp memberOf s:22WaylandGraphicsPreview0aB13WindowBackingV - s:22WaylandGraphicsPreview0aB13WindowBackingV9nextFrameAA0abG5LeaseVyYaKF memberOf s:22WaylandGraphicsPreview0aB13WindowBackingV - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO conformsTo s:SH Swift.Hashable -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO20premultipliedOpticalyA2CmF memberOf s:22WaylandGraphicsPreview0aB14ColorAlphaModeO - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO23premultipliedElectricalyA2CmF memberOf s:22WaylandGraphicsPreview0aB14ColorAlphaModeO - -s:22WaylandGraphicsPreview0aB14ColorAlphaModeO8straightyA2CmF memberOf s:22WaylandGraphicsPreview0aB14ColorAlphaModeO - s:22WaylandGraphicsPreview0aB14ExternalBufferV conformsTo s:s12IdentifiableP Swift.Identifiable s:22WaylandGraphicsPreview0aB14ExternalBufferV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB14ExternalBufferV conformsTo s:s8SendableP Swift.Sendable @@ -6441,12 +6446,6 @@ s:22WaylandGraphicsPreview0aB16ExternalBufferIDV conformsTo s:s16SendableMetatyp s:22WaylandGraphicsPreview0aB16ExternalBufferIDV conformsTo s:s23CustomStringConvertibleP Swift.CustomStringConvertible s:22WaylandGraphicsPreview0aB16ExternalBufferIDV conformsTo s:s8SendableP Swift.Sendable s:22WaylandGraphicsPreview0aB16ExternalBufferIDV11descriptionSSvp memberOf s:22WaylandGraphicsPreview0aB16ExternalBufferIDV - -s:22WaylandGraphicsPreview0aB16PresentationHintO conformsTo s:SH Swift.Hashable -s:22WaylandGraphicsPreview0aB16PresentationHintO conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB16PresentationHintO conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB16PresentationHintO conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB16PresentationHintO5asyncyA2CmF memberOf s:22WaylandGraphicsPreview0aB16PresentationHintO - -s:22WaylandGraphicsPreview0aB16PresentationHintO5vsyncyA2CmF memberOf s:22WaylandGraphicsPreview0aB16PresentationHintO - s:22WaylandGraphicsPreview0aB17DRMFormatModifierV conformsTo s:SH Swift.Hashable s:22WaylandGraphicsPreview0aB17DRMFormatModifierV conformsTo s:SQ Swift.Equatable s:22WaylandGraphicsPreview0aB17DRMFormatModifierV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype @@ -6496,11 +6495,6 @@ s:22WaylandGraphicsPreview0aB18PresentationPolicyO11externalGPUyAcA0aB19Fallback s:22WaylandGraphicsPreview0aB18PresentationPolicyO6decide12capabilitiesAA0aB15BackingDecisionO0A6Client0A12CapabilitiesV_tF memberOf s:22WaylandGraphicsPreview0aB18PresentationPolicyO - s:22WaylandGraphicsPreview0aB18PresentationPolicyO6decide12capabilitiesAA0aB15BackingDecisionOAA0aB19SurfaceCapabilitiesV_tF memberOf s:22WaylandGraphicsPreview0aB18PresentationPolicyO - s:22WaylandGraphicsPreview0aB18PresentationPolicyO8softwareyA2CmF memberOf s:22WaylandGraphicsPreview0aB18PresentationPolicyO - -s:22WaylandGraphicsPreview0aB19ColorRepresentationV conformsTo s:SQ Swift.Equatable -s:22WaylandGraphicsPreview0aB19ColorRepresentationV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype -s:22WaylandGraphicsPreview0aB19ColorRepresentationV conformsTo s:s8SendableP Swift.Sendable -s:22WaylandGraphicsPreview0aB19ColorRepresentationV9alphaModeAA0abd5AlphaG0OSgvp memberOf s:22WaylandGraphicsPreview0aB19ColorRepresentationV - -s:22WaylandGraphicsPreview0aB19ColorRepresentationV9alphaModeAcA0abd5AlphaG0OSg_tcfc memberOf s:22WaylandGraphicsPreview0aB19ColorRepresentationV - s:22WaylandGraphicsPreview0aB19ExternalBufferPlaneV conformsTo s:s16SendableMetatypeP Swift.SendableMetatype s:22WaylandGraphicsPreview0aB19ExternalBufferPlaneV conformsTo s:s8SendableP Swift.Sendable s:22WaylandGraphicsPreview0aB19ExternalBufferPlaneV14fileDescriptor6offset6stride10planeIndexAC0A6Client09OwnedFileH0V_s6UInt32VA2LtKcfc memberOf s:22WaylandGraphicsPreview0aB19ExternalBufferPlaneV - @@ -6635,8 +6629,8 @@ s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV conformsTo s:s16Sendab s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV conformsTo s:s8SendableP Swift.Sendable s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6bufferAA0abdE0Vvp memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6cancelyyYaF memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - -s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit22acquireSynchronization8metadata8scheduleAA0abdE17SubmissionReceiptVAA0abd7AcquireJ0O_AA0aB13FrameMetadataVAA0abP8ScheduleVSgtYaKF memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - -s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit8metadata8scheduleAA0abdE17SubmissionReceiptVAA0aB13FrameMetadataV_AA0abM8ScheduleVSgtYaKF memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - +s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit22acquireSynchronization8metadata8scheduleAA0abdE17SubmissionReceiptVAA0abd7AcquireJ0O_0A6Client20SurfaceFrameMetadataVAA0abR8ScheduleVSgtYaKF memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - +s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV6submit8metadata8scheduleAA0abdE17SubmissionReceiptV0A6Client20SurfaceFrameMetadataV_AA0abO8ScheduleVSgtYaKF memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV8contractAA0aB13FrameContractVvp memberOf s:22WaylandGraphicsPreview0aB25ExternalBufferRenderLeaseV - s:22WaylandGraphicsPreview0aB26PresentationFeedbackPolicyO conformsTo s:SH Swift.Hashable s:22WaylandGraphicsPreview0aB26PresentationFeedbackPolicyO conformsTo s:SQ Swift.Equatable diff --git a/docs/release.md b/docs/release.md index 8ebf2982..d546b948 100644 --- a/docs/release.md +++ b/docs/release.md @@ -31,13 +31,19 @@ This checkpoint contains source-breaking `WaylandClient` and `dataTransfer`, and `presentation` cases. `WaylandDisplay.events` is now the complete cross-family ordered feed; specialized streams remain family-ordered convenience views. -- `Window.show(preparing:_:)` and `Window.redraw(preparing:_:)` now return - `SoftwarePresentationOutcome`, distinguishing presented, superseded, deferred, - and closed attempts. Calls that ignore the result remain valid because it is - discardable. Explicit `Void` bindings, typed function references, and wrappers - must adopt or discard the returned outcome. Matching overloads without a - preparation closure expose the same atomic `requestPresentationFeedback` - option and outcome. Prepared generations are revalidated before drawing. +- Replace the former `Window.show` and `Window.redraw` overload families with + one simple and one prepared method each. All four return discardable + `SoftwarePresentationOutcome`, accept `SurfaceFrameMetadata`, and expose the + same atomic `requestPresentationFeedback` option. Move `damage:` arguments + into `SurfaceFrameMetadata.damage`; remove explicit no-op-preparation and + legacy `Void` wrappers. Prepared generations are revalidated before drawing. +- Replace `WaylandGraphicsFrameMetadata`, `WaylandGraphicsDamageRegion`, + `WaylandGraphicsContentType`, `WaylandGraphicsPresentationHint`, + `WaylandGraphicsAlphaModifier`, `WaylandGraphicsColorAlphaMode`, and + `WaylandGraphicsColorRepresentation` with the corresponding shared + `WaylandClient` surface types. Pass `SurfaceFrameMetadata` to software and + external-buffer submissions and read it from frame results. Use `nil` damage + for a full-frame commit; empty damage regions are no longer a second sentinel. - `WaylandGraphicsFrameLease` and `WaylandGraphicsExternalBufferRenderLease` are now move-only. Submission and cancellation consume the lease, and reserving an external buffer consumes the frame lease and transfers sole authority to the diff --git a/docs/strict-memory-safety-audit.md b/docs/strict-memory-safety-audit.md index 3e99cee4..64065e41 100644 --- a/docs/strict-memory-safety-audit.md +++ b/docs/strict-memory-safety-audit.md @@ -327,6 +327,29 @@ Tests: - `SurfaceRuntimeSubmitTests` covers commit ordering for explicit logical damage when buffer damage is unavailable. +## Event Broker State Boundary + +Remaining unsafe constructs: + +- `EventBrokerLockedState` is a private `@unchecked Sendable` reference that + stores event-broker state behind `NSLock`. + +Audit invariant: + +- The mutable value is private, and every read or mutation occurs after the + sanitizer-visible lock acquisition and before its release. +- Continuations are claimed while locked but resumed only after the broker lock + is released, so cancellation and publication cannot re-enter locked state. +- This explicit boundary avoids the affected Swift toolchain's + `Synchronization.Mutex.withLock` inout instrumentation, which Thread + Sanitizer reports as overlapping access even though the mutex serializes the + closure bodies. + +Tests: + +- `EventBrokerCancellationTests` runs cancellation, publication, and finish + races; the focused suite is also executed with Thread Sanitizer enabled. + ## Data Transfer File Descriptors Remaining unsafe constructs: diff --git a/safety/unsafe-token-allowlist.tsv b/safety/unsafe-token-allowlist.tsv index f46d7ea8..32cc7b9b 100644 --- a/safety/unsafe-token-allowlist.tsv +++ b/safety/unsafe-token-allowlist.tsv @@ -64,6 +64,7 @@ Sources/WaylandClient/Internal/DataTransfer/DataTransferSourceWriteTypes.swift U Sources/WaylandClient/Internal/DataTransfer/DataTransferSourceWriter.swift UnsafeRawBufferPointer Descriptor write injection accepts borrowed data-transfer write buffers. Sources/WaylandClient/Public/DataTransfer/OwnedFileDescriptor.swift UnsafeRawBufferPointer Scoped borrowed public file-descriptor write buffer. Sources/WaylandClient/Internal/DataTransfer/DataTransferSourceWriter.swift @unchecked Sendable Private condition-protected data-transfer writer state shared with one worker thread. +Sources/WaylandClient/Internal/Events/EventBrokerLockedState.swift @unchecked Sendable Private NSLock-protected event-broker state; sanitizer-visible locking begins before each inout state access. Sources/WaylandClientKitToolSupport/ProcessRunner.swift UnsafeMutablePointer Transient POSIX argv/env pointer arrays passed directly to posix_spawn. Sources/WaylandClientKitToolSupport/ProcessRunner.swift UnsafeMutableBufferPointer Transient POSIX argv/env pointer arrays passed directly to posix_spawn. Sources/WaylandClientKitToolSupport/ProjectAutomation.swift @unchecked Sendable Private lock-protected headless process output buffer shared by pipe readability callbacks.