Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ImageSource {
std::string uri{};
std::string bundle{};
Float scale{3};
Size size{0};
Size size{.width = 0};
std::string body{};
std::string method{};
CacheStategy cache = CacheStategy::Default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ static std::shared_ptr<ShadowNode> progressState(const ShadowNode& shadowNode) {
}

return shadowNode.clone({
ShadowNodeFragment::propsPlaceholder(),
areChildrenChanged
.props = ShadowNodeFragment::propsPlaceholder(),
.children = areChildrenChanged
? std::make_shared<
const std::vector<std::shared_ptr<const ShadowNode>>>(
std::move(newChildren))
: ShadowNodeFragment::childrenPlaceholder(),
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
.state =
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
});
}

Expand Down Expand Up @@ -158,13 +159,14 @@ static std::shared_ptr<ShadowNode> progressState(
}

return shadowNode.clone({
ShadowNodeFragment::propsPlaceholder(),
areChildrenChanged
.props = ShadowNodeFragment::propsPlaceholder(),
.children = areChildrenChanged
? std::make_shared<
const std::vector<std::shared_ptr<const ShadowNode>>>(
std::move(newChildren))
: ShadowNodeFragment::childrenPlaceholder(),
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
.state =
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
});
}

Expand All @@ -177,7 +179,9 @@ ShadowTree::ShadowTree(
: surfaceId_(surfaceId), delegate_(delegate) {
static RootComponentDescriptor globalRootComponentDescriptor(
ComponentDescriptorParameters{
EventDispatcher::Shared{}, nullptr, nullptr});
.eventDispatcher = EventDispatcher::Shared{},
.contextContainer = nullptr,
.flavor = nullptr});

const auto props = std::make_shared<const RootProps>(
PropsParserContext{surfaceId, contextContainer},
Expand All @@ -186,17 +190,19 @@ ShadowTree::ShadowTree(
layoutContext);

auto family = globalRootComponentDescriptor.createFamily(
{surfaceId, surfaceId, nullptr});
{.tag = surfaceId, .surfaceId = surfaceId, .instanceHandle = nullptr});

auto rootShadowNode = std::static_pointer_cast<const RootShadowNode>(
globalRootComponentDescriptor.createShadowNode(
ShadowNodeFragment{
/* .props = */ props,
/* .props = */ .props = props,
},
family));

currentRevision_ = ShadowTreeRevision{
rootShadowNode, INITIAL_REVISION, TransactionTelemetry{}};
.rootShadowNode = rootShadowNode,
.number = INITIAL_REVISION,
.telemetry = TransactionTelemetry{}};

mountingCoordinator_ =
std::make_shared<const MountingCoordinator>(currentRevision_);
Expand Down Expand Up @@ -354,7 +360,9 @@ CommitStatus ShadowTree::tryCommit(
newRootShadowNode->sealRecursive();

newRevision = ShadowTreeRevision{
std::move(newRootShadowNode), newRevisionNumber, telemetry};
.rootShadowNode = std::move(newRootShadowNode),
.number = newRevisionNumber,
.telemetry = telemetry};

currentRevision_ = newRevision;
}
Expand Down Expand Up @@ -387,8 +395,9 @@ void ShadowTree::commitEmptyTree() const {
return std::make_shared<RootShadowNode>(
oldRootShadowNode,
ShadowNodeFragment{
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .children = */ ShadowNode::emptySharedShadowNodeSharedList(),
/* .props = */ .props = ShadowNodeFragment::propsPlaceholder(),
/* .children = */ .children =
ShadowNode::emptySharedShadowNodeSharedList(),
});
},
{/* default commit options */});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ std::vector<DebugStringConvertibleObject> getDebugProps(
const ShadowView& object,
DebugStringConvertibleOptions options) {
return {
{"surfaceId", getDebugDescription(object.surfaceId, options)},
{"tag", getDebugDescription(object.tag, options)},
{"traits", getDebugDescription(object.traits, options)},
{"componentName", object.componentName},
{"props", getDebugDescription(object.props, options)},
{"eventEmitter", getDebugDescription(object.eventEmitter, options)},
{"layoutMetrics", getDebugDescription(object.layoutMetrics, options)},
{"state", getDebugDescription(object.state, options)},
{.name = "surfaceId",
.value = getDebugDescription(object.surfaceId, options)},
{.name = "tag", .value = getDebugDescription(object.tag, options)},
{.name = "traits", .value = getDebugDescription(object.traits, options)},
{.name = "componentName", .value = object.componentName},
{.name = "props", .value = getDebugDescription(object.props, options)},
{.name = "eventEmitter",
.value = getDebugDescription(object.eventEmitter, options)},
{.name = "layoutMetrics",
.value = getDebugDescription(object.layoutMetrics, options)},
{.name = "state", .value = getDebugDescription(object.state, options)},
};
}

Expand Down
Loading