@@ -43,13 +43,32 @@ package protocol ViewRendererHost: ViewGraphDelegate {
43
43
var viewGraph : ViewGraph { get }
44
44
var currentTimestamp : Time { get set }
45
45
var propertiesNeedingUpdate : ViewRendererHostProperties { get set }
46
- func addImplicitPropertiesNeedingUpdate ( to properties : inout ViewRendererHostProperties )
47
- var isRendering : Bool { get set }
46
+ var renderingPhase : ViewRenderingPhase { get set }
47
+ var externalUpdateCount : Int { get set }
48
48
func updateRootView( )
49
- func requestUpdate( after: Double )
49
+ func updateEnvironment( )
50
+ func updateFocusedItem( )
51
+ func updateFocusedValues( )
52
+ func updateTransform( )
53
+ func updateSize( )
54
+ func updateSafeArea( )
55
+ func updateScrollableContainerSize( )
56
+ func updateFocusStore( )
57
+ func updateAccessibilityFocus( )
58
+ func updateAccessibilityFocusStore( )
59
+ func updateAccessibilityEnvironment( )
60
+ func requestUpdate( after delay: Double )
61
+ func renderDisplayList( _ list: DisplayList , asynchronously: Bool , time: Time , nextTime: Time , targetTimestamp: Time ? , version: DisplayList . Version , maxVersion: DisplayList . Version ) -> Time
62
+ func didRender( )
50
63
}
51
64
52
- // MARK: - ViewRendererHost's default implementation for ViewGraphDelegate
65
+ extension ViewRendererHost {
66
+ package var isRendering : Bool {
67
+ fatalError ( " TODO " )
68
+ }
69
+ }
70
+
71
+ // TODO: FIXME
53
72
54
73
extension ViewRendererHost {
55
74
package func updateViewGraph< Value> ( body: ( ViewGraph ) -> Value ) -> Value {
@@ -134,3 +153,30 @@ extension ViewRendererHost {
134
153
// TODO: Signpost.viewHost
135
154
}
136
155
}
156
+
157
+ // MARK: - EmptyViewRendererHost
158
+
159
+ final package class EmptyViewRendererHost : ViewRendererHost {
160
+ package let viewGraph : ViewGraph
161
+ package var propertiesNeedingUpdate : ViewRendererHostProperties = [ ]
162
+ package var renderingPhase : ViewRenderingPhase = . none
163
+ package var externalUpdateCount : Int = . zero
164
+ package var currentTimestamp : Time = . zero
165
+ package init ( environment: EnvironmentValues = EnvironmentValues ( ) ) {
166
+ Update . begin ( )
167
+ viewGraph = ViewGraph ( rootViewType: EmptyView . self, requestedOutputs: [ ] )
168
+ viewGraph. setEnvironment ( environment)
169
+ initializeViewGraph ( )
170
+ Update . end ( )
171
+ }
172
+ package func requestUpdate( after delay: Double ) { }
173
+ package func updateRootView( ) { }
174
+ package func updateEnvironment( ) { }
175
+ package func updateSize( ) { }
176
+ package func updateSafeArea( ) { }
177
+ package func updateScrollableContainerSize( ) { }
178
+ package func renderDisplayList( _ list: DisplayList , asynchronously: Bool , time: Time , nextTime: Time , targetTimestamp: Time ? , version: DisplayList . Version , maxVersion: DisplayList . Version ) -> Time {
179
+ . infinity
180
+ }
181
+ package func forEachIdentifiedView( body: ( _IdentifiedViewProxy ) -> Void ) { }
182
+ }
0 commit comments