Skip to content

Commit 83cc73c

Browse files
committed
Add GraphicsRenderer
1 parent 15a223b commit 83cc73c

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

Sources/OpenSwiftUICore/Render/DisplayList.GraphicsRenderer.swift

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,70 @@
33
// OpenSwiftUICore
44
//
55
// Audited for RELEASE_2024
6-
// Status: WIP
6+
// Status: Blocked by RenderBox and GraphicsContext
7+
// ID: EFAEDE41CB8C85EF3A6A18DC05438A3C
8+
9+
import Foundation
710

811
extension DisplayList {
912
final package class GraphicsRenderer {
13+
package enum PlatformViewMode {
14+
case ignored
15+
case unsupported
16+
case rendered(update: Bool)
17+
}
18+
19+
private struct Cache {
20+
var callbacks: [CallbackKey: Void /* RBDisplayListContents */]
21+
var animators: [AnimatorKey: Void /* _DisplayList_AnyEffectAnimator */ ]
22+
23+
struct CallbackKey: Hashable {
24+
var index: DisplayList.Index.ID
25+
var seed: DisplayList.Seed
26+
var scale: CGFloat
27+
}
28+
29+
struct AnimatorKey: Hashable {
30+
var index: DisplayList.Index.ID
31+
}
32+
}
33+
34+
private var oldCache: DisplayList.GraphicsRenderer.Cache
35+
private var newCache: DisplayList.GraphicsRenderer.Cache
36+
var index: DisplayList.Index
37+
var time: Time
38+
var nextTime: Time
39+
var stableIDs: _DisplayList_StableIdentityMap?
40+
var inTransitionGroup: Bool
41+
var stateHashes: [StrongHash]
42+
package var platformViewMode: DisplayList.GraphicsRenderer.PlatformViewMode
43+
44+
package init(platformViewMode: DisplayList.GraphicsRenderer.PlatformViewMode) {
45+
fatalError("TODO")
46+
}
47+
48+
package func render(at time: Time, do body: () -> Void) {
49+
fatalError("TODO")
50+
}
51+
52+
package func renderDisplayList(_ list: DisplayList, at time: Time, in ctx: inout GraphicsContext) {
53+
fatalError("TODO")
54+
}
55+
56+
package func render(list: DisplayList, in ctx: inout GraphicsContext) {
57+
fatalError("TODO")
58+
}
59+
60+
package func render(item: DisplayList.Item, in ctx: inout GraphicsContext) {
61+
fatalError("TODO")
62+
}
63+
64+
package func drawImplicitLayer(in ctx: inout GraphicsContext, content: (inout GraphicsContext) -> Void) {
65+
fatalError("TODO")
66+
}
1067

68+
package func renderPlatformView(_ view: AnyObject?, in ctx: GraphicsContext, size: CGSize, viewType: any Any.Type) {
69+
fatalError("TODO")
70+
}
1171
}
1272
}

0 commit comments

Comments
 (0)