Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
1b12bdd
Add Path.isEmpty
Kyle-Ye Apr 23, 2026
2299a4d
Add DisplayListViewModel
Kyle-Ye Apr 23, 2026
bd17d47
Add adjust impl
Kyle-Ye Apr 27, 2026
6ea54ae
Add addClip impl
Kyle-Ye Apr 27, 2026
46270ce
Optimize approximates call
Kyle-Ye Apr 27, 2026
e690bf8
Fix ID
Kyle-Ye Apr 28, 2026
17a5fde
Update rewriteVibrancyFilterAsBackdrop
Kyle-Ye Apr 28, 2026
d96a6e9
Add Path.boundingRect implemnentation
Kyle-Ye Apr 28, 2026
2281ad5
Add discardContainingClips
Kyle-Ye Apr 28, 2026
26c7ed5
Update ViewUpdater.renderAsync
Kyle-Ye Apr 28, 2026
4fec953
Update ViewUpdater: ViewRendererBase
Kyle-Ye Apr 28, 2026
5c759fb
Update ViewUpdater.render
Kyle-Ye Apr 28, 2026
acae1c9
Update ViewUpdater.destroy
Kyle-Ye Apr 28, 2026
c1c3afc
Update Platform
Kyle-Ye Apr 28, 2026
c1fa4e5
Update removeRemaining
Kyle-Ye Apr 28, 2026
2727baf
Update DisplayList.ViewUpdater.ViewInfo
Kyle-Ye Apr 28, 2026
eb9ae8a
Add DisplayListAsyncLayer
Kyle-Ye Apr 29, 2026
fa2103c
Fix platform API issue
Kyle-Ye May 6, 2026
f8e1e76
Fix compiler issue
Kyle-Ye May 6, 2026
e6ee47d
Implement DisplayList index skip helpers
Kyle-Ye May 6, 2026
bf048e3
Implement ViewUpdater.update
Kyle-Ye May 6, 2026
05725f1
Fix OpenSwiftUISymbolDualTestsSupport import issue
Kyle-Ye May 6, 2026
563f250
Match DisplayList item structure checks
Kyle-Ye May 6, 2026
cbac89c
Implement DisplayList.Item.features
Kyle-Ye May 7, 2026
9f3c1f5
Update ViewUpdater.update methods
Kyle-Ye May 7, 2026
8f65de6
Update updateInheritedView
Kyle-Ye May 7, 2026
99ea9a1
Update requirement case
Kyle-Ye May 7, 2026
775d9a0
Update updateInheritedViewAsync
Kyle-Ye May 7, 2026
c629b95
Update MergedViewRequirements
Kyle-Ye May 7, 2026
cca7423
Update Platform.updateState and updateStateAsync
Kyle-Ye May 7, 2026
00e6190
Update ViewCache Result property name
Kyle-Ye May 7, 2026
ced59ea
Update Platform API
Kyle-Ye May 7, 2026
ccb14d9
Update skipEffect stuff and implement updateItemView
Kyle-Ye May 7, 2026
1e65428
Update updateItemViewAsync
Kyle-Ye May 7, 2026
24a3bb6
Add plaform color handlering
Kyle-Ye May 8, 2026
b688d10
Update Platform.missingPlatformView
Kyle-Ye May 8, 2026
632c2d4
Update DisplayListViewModel
Kyle-Ye May 8, 2026
f75bec5
Add platform.setShadow
Kyle-Ye May 12, 2026
3d32a7a
Update interface of Platform
Kyle-Ye May 12, 2026
67c35ac
Update AsyncRenderExample
Kyle-Ye May 12, 2026
a711082
Update Platform.missingPlatformView
Kyle-Ye May 12, 2026
56903f4
Update Platform.updateDrawingView
Kyle-Ye May 12, 2026
0fe7a74
Update Platform.updateProperties
Kyle-Ye May 12, 2026
ade3bfa
Update Platform.updateShadowView
Kyle-Ye May 12, 2026
b7f4b97
Update Platform.updateDrawingViewAsync
Kyle-Ye May 12, 2026
653663f
Update Platform.updateClipShapes
Kyle-Ye May 13, 2026
89d7272
Add MaskLayer implementation
Kyle-Ye May 13, 2026
402ee19
Update Transform.transform API
Kyle-Ye May 13, 2026
d17dd54
Add CABackdropLayer
Kyle-Ye May 13, 2026
78da056
Update ShapeLayer API
Kyle-Ye May 13, 2026
8554c2d
Update Platform._makeItemView
Kyle-Ye May 13, 2026
7db611f
Update Platform.updateGeometry
Kyle-Ye May 13, 2026
2d02b38
Update Platform.updateShadow
Kyle-Ye May 13, 2026
117dea1
Update Platform.updateShapeView
Kyle-Ye May 14, 2026
4e20010
Fix Model.State getter issue
Kyle-Ye May 14, 2026
93458f0
Update Platform.updateState
Kyle-Ye May 14, 2026
5d209c6
Fix Linux build issue
Kyle-Ye May 13, 2026
18541a3
Update ContentView
Kyle-Ye May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/Shared/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

struct ContentView: View {
var body: some View {
TextExample()
AsyncRenderExample()

Check failure on line 13 in Example/Shared/ContentView.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

'buildExpression' is unavailable: this expression does not conform to 'View'

Check failure on line 13 in Example/Shared/ContentView.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

'buildExpression' is unavailable: this expression does not conform to 'View'
}
}
21 changes: 21 additions & 0 deletions Example/Shared/Render/Async/AsyncRenderExample.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// GeometryEffectExample.swift
// Shared

struct AsyncRenderExample: View {

Check failure on line 5 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

cannot find type 'View' in scope

Check failure on line 5 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

cannot find type 'View' in scope

Check failure on line 5 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

cannot find type 'View' in scope

Check failure on line 5 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

cannot find type 'View' in scope

Check failure on line 5 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

cannot find type 'View' in scope

Check failure on line 5 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

cannot find type 'View' in scope
@State private var items = [6]

Check failure on line 6 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

unknown attribute 'State'

Check failure on line 6 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

unknown attribute 'State'

Check failure on line 6 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

unknown attribute 'State'

Check failure on line 6 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

unknown attribute 'State'

Check failure on line 6 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

unknown attribute 'State'

Check failure on line 6 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

unknown attribute 'State'

var body: some View {

Check failure on line 8 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

cannot find type 'View' in scope

Check failure on line 8 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

cannot find type 'View' in scope

Check failure on line 8 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on macOS (macos-15, 16.4, 2024)

cannot find type 'View' in scope

Check failure on line 8 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

cannot find type 'View' in scope

Check failure on line 8 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

cannot find type 'View' in scope

Check failure on line 8 in Example/Shared/Render/Async/AsyncRenderExample.swift

View workflow job for this annotation

GitHub Actions / Execute UI tests on iOS (macos-15, 16.4, 2024, 18.5)

cannot find type 'View' in scope
VStack(spacing: 10) {
ForEach(items, id: \.self) { item in
Color.blue.opacity(Double(item) / 6.0)
.frame(height: 50)
.transition(.slide)
}
}
.animation(.easeInOut(duration: 2), value: items)
.onAppear {
items.removeAll { $0 == 6 }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import OpenAttributeGraphShims
@_spi(ForOpenSwiftUIOnly)
@_spi(Private)
public import OpenSwiftUICore
#if _OPENSWIFTUI_SWIFTUI_RENDER
import OpenSwiftUISymbolDualTestsSupport
#endif
import COpenSwiftUI

/// A UIView which hosts an OpenSwiftUI View hierarchy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
@_spi(DisplayList_ViewSystem)
import OpenSwiftUICore
import AppKit
#if _OPENSWIFTUI_SWIFTUI_RENDER
import OpenSwiftUISymbolDualTestsSupport
#endif
import COpenSwiftUI
import QuartzCore_Private
import OpenRenderBoxShims
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import COpenSwiftUI
@_spi(DisplayList_ViewSystem) import OpenSwiftUICore
import UIKit
#if _OPENSWIFTUI_SWIFTUI_RENDER
import OpenSwiftUISymbolDualTestsSupport
#endif
import QuartzCore_Private
import OpenRenderBoxShims
import OpenSwiftUI_SPI
Expand Down
9 changes: 7 additions & 2 deletions Sources/OpenSwiftUICore/Graphic/BackdropEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// BackdropEffect.swift
// OpenSwiftUICore
//
// Audited for 6.0.87
// Audited for 6.5.4
// Status: WIP

package struct BackdropEffect {
Expand All @@ -12,7 +12,12 @@ package struct BackdropEffect {

package var filters: [GraphicsFilter]

package init(scale: Float = 1, color: Color.Resolved = .black, filters: [GraphicsFilter] = [], captureOnly: Bool = false) {
package init(
scale: Float = 1,
color: Color.Resolved = .black,
filters: [GraphicsFilter] = [],
captureOnly: Bool = false
) {
self.scale = scale
self.color = color
self.filters = filters
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenSwiftUICore/Graphic/GraphicsContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ extension GraphicsContext {
#endif
}

package func renderMissingPlatformView(size: CGSize) {
_openSwiftUIUnimplementedWarning()
}

// FIXME
struct ORBLayerFlags: OptionSet {
let rawValue: UInt32
Expand Down
15 changes: 14 additions & 1 deletion Sources/OpenSwiftUICore/Graphic/GraphicsFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// OpenSwiftUICore
//
// Audited for 6.0.87
// WIP
// Status: WIP
// ID: 07401C2C9845FAA2984B0D65D34F2B64 (SwiftUICore)

package enum GraphicsFilter {
case blur(BlurStyle)
Expand Down Expand Up @@ -125,4 +126,16 @@ package enum GraphicsBlendMode: Equatable {
default: false
}
}

@inline(__always)
var filter: Any? {
switch self {
case let .caFilter(filter):
return filter
case let .blendMode(mode):
// TODO: _ORBBlendModeGetCompositingFilter & ORBBlendMode
_openSwiftUIUnimplementedWarning()
return nil
}
}
}
144 changes: 128 additions & 16 deletions Sources/OpenSwiftUICore/Render/DisplayList/DisplayList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,28 @@ extension DisplayList {
indirect case view(any _DisplayList_ViewFactory)
case placeholder(id: Identity)
}

package init(_ value: Content.Value, seed: Seed) {
self.value = value
self.seed = seed
}

@inline(__always)
var features: DisplayList.Features {
switch value {
case let .platformView(factory):
return factory.features
case let .text(view, _):
let resolved = view.text
return resolved.isDynamic && resolved.archiveOptions.isArchived ? .dynamicContent : []
case let .flattened(list, _, _):
return list.features.union(.flattened)
case .view, .placeholder:
return .views
default:
return []
}
}
}

package typealias ViewFactory = _DisplayList_ViewFactory
Expand Down Expand Up @@ -209,13 +227,63 @@ extension DisplayList {
indirect case interpolatorRoot(InterpolatorGroup, contentOrigin: CGPoint, contentOffset: CGSize)
case interpolatorLayer(InterpolatorGroup, serial: UInt32)
indirect case interpolatorAnimation(InterpolatorAnimation)
}

@inline(__always)
var features: DisplayList.Features {
switch self {
case let .properties(properties):
return properties.features
case let .platformGroup(factory):
return factory.features
case .mask(let list, _):
return list.features
case .animation:
return .animations
case .view:
return .views
case let .platform(platformEffect):
return platformEffect.features
case .state:
return .stateEffects
case .interpolatorRoot:
return .interpolatorRoots
case let .interpolatorLayer(group, _):
return group.features.union([.interpolatorLayers, .required])
default:
return []
}
}
}

package enum Transform {
case affine(CGAffineTransform)
case projection(ProjectionTransform)
case rotation(_RotationEffect.Data)
case rotation3D(_Rotation3DEffect.Data)

@inline(__always)
package var affineTransform: CGAffineTransform? {
switch self {
case let .affine(transform):
return transform
case let .rotation(data):
return data.transform
case .projection, .rotation3D:
return nil
}
}

@inline(__always)
package var projectionTransform: ProjectionTransform? {
switch self {
case let .projection(transform):
return transform
case let .rotation3D(data):
return data.transform
case .affine, .rotation:
return nil
}
}
}

package typealias AnyEffectAnimation = _DisplayList_AnyEffectAnimation
Expand Down Expand Up @@ -260,6 +328,9 @@ extension DisplayList {
package static func < (lhs: Version, rhs: Version) -> Bool {
lhs.value < rhs.value
}

@inline(__always)
var seed: Seed { .init(self) }
}

package struct Seed: Hashable {
Expand Down Expand Up @@ -299,9 +370,11 @@ extension DisplayList {

package struct Properties: OptionSet {
package let rawValue: UInt8

package init(rawValue: UInt8) {
self.rawValue = rawValue
}

package static let foregroundLayer = Properties(rawValue: 1 << 0)
package static let ignoresEvents = Properties(rawValue: 1 << 1)
package static let privacySensitive = Properties(rawValue: 1 << 2)
Expand All @@ -310,6 +383,11 @@ extension DisplayList {
package static let tertiaryForegroundLayer = Properties(rawValue: 1 << 5)
package static let quaternaryForegroundLayer = Properties(rawValue: 1 << 6)
package static let screencaptureProhibited = Properties(rawValue: 1 << 7)

@inline(__always)
var features: DisplayList.Features {
contains(.privacySensitive) ? .required : []
}
}

package struct Key: PreferenceKey {
Expand Down Expand Up @@ -399,16 +477,37 @@ extension DisplayList {
}

package mutating func skip(list: DisplayList) {
_openSwiftUIUnimplementedFailure()
for item in list.items {
skip(item: item)
}
}

package mutating func skip(item: Item) {
_openSwiftUIUnimplementedFailure()
guard item.identity == .none else { return }
let saved = enter(identity: item.identity)
defer { leave(index: saved) }
switch item.value {
case let .content(content):
if case let .flattened(list, _, _) = content.value {
skip(list: list)
}
case let .effect(effect, list):
skip(list: list)
skip(effect: effect)
default:
break
}
}

package mutating func skip(effect: Effect) {

_openSwiftUIUnimplementedFailure()
switch effect {
case let .archive(archiveIDs):
updateArchive(entering: archiveIDs != nil)
case let .mask(list, _):
skip(list: list)
default:
break
}
}

package func assertItem(_ item: Item) {}
Expand Down Expand Up @@ -482,26 +581,35 @@ extension DisplayList.Item {
// TODO eg. .opacity(1.0) -> .identity
}

// TBA
package func matchesTopLevelStructure(of other: DisplayList.Item) -> Bool {
guard identity == other.identity else { return false }
switch (value, other.value) {
case (.empty, .empty):
return true
case (.content, .content):
return true
case (.effect, .effect):
return true
case (.states, .states):
return true
case let (.content(lhs), .content(rhs)):
return compareEnumTags(lhs.value, rhs.value)
case let (.effect(lhs, _), .effect(rhs, _)):
return compareEnumTags(lhs, rhs)
case let (.states(lhs), .states(rhs)):
guard lhs.count == rhs.count else { return false }
return zip(lhs, rhs).allSatisfy { $0.0 == $1.0 }
default:
return false
}
}

package var features: DisplayList.Features {
// TODO
[]
switch value {
case .empty:
return []
case let .content(content):
return content.features
case let .effect(effect, list):
return effect.features.union(list.features)
case let .states(states):
return states.reduce(into: [.states]) { features, state in
features.formUnion(state.1.features)
}
}
}
}

Expand Down Expand Up @@ -552,6 +660,10 @@ extension DisplayList {
_openSwiftUIEmptyStub()
}

var features: Features {
[]
}

func rewriteDisplayList(
_ list: inout DisplayList,
time: Attribute<Time>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Audited for 6.5.4
// Status: Complete
// ID: B86250B2E056EB47628ECF46032DFA4C (SwiftUICore)
// ID: 25E61DBD3DDB4AD4C9A82B4C3137A7B6 (SwiftUICore)

import Foundation

Expand Down
Loading
Loading