| 232 | } |
| 233 | |
| 234 | Ref<ViewFactory> ViewNodeTree::createDeferredViewFactory() { |
| 235 | // For the deferred view factory, we create a ViewFactory that conforms to the default view class, |
| 236 | // but we pass it a no-op default attribute handler to skip attributes validation when they are set. |
| 237 | // This is done because attributes might be set on the view node before the view class or the viewFactory |
| 238 | // is provided. |
| 239 | |
| 240 | SC_ASSERT_NOTNULL(_viewManager); |
| 241 | auto& viewManager = *_viewManager; |
| 242 | auto defaultViewClass = viewManager.getDefaultViewClass(); |
| 243 | auto defaultViewFactory = getOrCreateViewFactory(defaultViewClass); |
| 244 | |
| 245 | AttributeHandlerById attributes; |
| 246 | auto defaultHandler = makeShared<NoOpDefaultAttributeHandler>(); |
| 247 | |
| 248 | auto modifiedAttributes = defaultViewFactory->getBoundAttributes()->merge( |
| 249 | defaultViewClass, attributes, defaultHandler, nullptr, false, false); |
| 250 | return viewManager.createViewFactory(defaultViewClass, modifiedAttributes); |
| 251 | } |
| 252 | |
| 253 | void ViewNodeTree::performUpdates() { |
| 254 | // This does the following: |
nothing calls this directly
no test coverage detected