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 @@ -164,7 +164,8 @@ class StackingContextTest : public ::testing::Test {
node->getFamily(), [&](const ShadowNode& oldShadowNode) {
auto viewProps = std::make_shared<ViewShadowNodeProps>();
callback(*viewProps);
return oldShadowNode.clone(ShadowNodeFragment{viewProps});
return oldShadowNode.clone(
ShadowNodeFragment{.props = viewProps});
}));
}

Expand Down Expand Up @@ -260,7 +261,7 @@ TEST_F(StackingContextTest, mostPropsDoNotForceViewsToMaterialize) {
yogaStyle.setMargin(yoga::Edge::All, yoga::StyleLength::points(42));
yogaStyle.setPositionType(yoga::PositionType::Absolute);
props.shadowRadius = 42;
props.shadowOffset = Size{42, 42};
props.shadowOffset = Size{.width = 42, .height = 42};
props.backgroundColor = clearColor();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ EventTag EventPerformanceLogger::onEventStart(
{
std::lock_guard lock(eventsInFlightMutex_);
eventsInFlight_.emplace(
eventTag, EventEntry{reportedName, target, timeStamp});
eventTag,
EventEntry{
.name = reportedName, .target = target, .startTime = timeStamp});
}
return eventTag;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ static Rect getRootNodeBoundingRect(const RootShadowNode& rootShadowNode) {
static Rect getBoundingRect(const ShadowNodeFamily::AncestorList& ancestors) {
auto layoutMetrics = LayoutableShadowNode::computeRelativeLayoutMetrics(
ancestors,
{/* .includeTransform = */ true,
/* .includeViewportOffset = */ true});
{/* .includeTransform = */ .includeTransform = true,
/* .includeViewportOffset = */ .includeViewportOffset = true});
return layoutMetrics == EmptyLayoutMetrics ? Rect{} : layoutMetrics.frame;
}

static Rect getClippedTargetBoundingRect(
const ShadowNodeFamily::AncestorList& targetAncestors) {
auto layoutMetrics = LayoutableShadowNode::computeRelativeLayoutMetrics(
targetAncestors,
{/* .includeTransform = */ true,
/* .includeViewportOffset = */ true,
/* .applyParentClipping = */ true});
{/* .includeTransform = */ .includeTransform = true,
/* .includeViewportOffset = */ .includeViewportOffset = true,
/* .applyParentClipping = */ .enableOverflowClipping = true});

return layoutMetrics == EmptyLayoutMetrics ? Rect{} : layoutMetrics.frame;
}
Expand Down Expand Up @@ -110,8 +110,8 @@ static Rect computeIntersection(
getClippedTargetBoundingRect(targetToRootAncestors);

auto clippedTargetBoundingRect = hasCustomRoot ? Rect{
rootBoundingRect.origin + clippedTargetFromRoot.origin,
clippedTargetFromRoot.size}
.origin=rootBoundingRect.origin + clippedTargetFromRoot.origin,
.size=clippedTargetFromRoot.size}
: clippedTargetFromRoot;

return Rect::intersect(rootBoundingRect, clippedTargetBoundingRect);
Expand Down Expand Up @@ -231,13 +231,13 @@ IntersectionObserver::setIntersectingState(
if (state_ != newState) {
state_ = newState;
IntersectionObserverEntry entry{
intersectionObserverId_,
targetShadowNodeFamily_,
targetBoundingRect,
rootBoundingRect,
intersectionRect,
true,
time,
.intersectionObserverId = intersectionObserverId_,
.shadowNodeFamily = targetShadowNodeFamily_,
.targetRect = targetBoundingRect,
.rootRect = rootBoundingRect,
.intersectionRect = intersectionRect,
.isIntersectingAboveThresholds = true,
.time = time,
};
return std::optional<IntersectionObserverEntry>{std::move(entry)};
}
Expand All @@ -254,13 +254,13 @@ IntersectionObserver::setNotIntersectingState(
if (state_ != IntersectionObserverState::NotIntersecting()) {
state_ = IntersectionObserverState::NotIntersecting();
IntersectionObserverEntry entry{
intersectionObserverId_,
targetShadowNodeFamily_,
targetBoundingRect,
rootBoundingRect,
intersectionRect,
false,
time,
.intersectionObserverId = intersectionObserverId_,
.shadowNodeFamily = targetShadowNodeFamily_,
.targetRect = targetBoundingRect,
.rootRect = rootBoundingRect,
.intersectionRect = intersectionRect,
.isIntersectingAboveThresholds = false,
.time = time,
};
return std::optional<IntersectionObserverEntry>(std::move(entry));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ void MutationObserver::recordMutationsInSubtrees(

if (!addedNodes.empty() || !removedNodes.empty()) {
recordedMutations.emplace_back(MutationRecord{
mutationObserverId_,
oldNode,
std::move(addedNodes),
std::move(removedNodes)});
.mutationObserverId = mutationObserverId_,
.targetShadowNode = oldNode,
.addedShadowNodes = std::move(addedNodes),
.removedShadowNodes = std::move(removedNodes)});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Size SurfaceHandler::measure(
std::shared_lock lock(linkMutex_);

if (link_.status != Status::Running) {
return layoutConstraints.clamp({0, 0});
return layoutConstraints.clamp({.width = 0, .height = 0});
}

react_native_assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ std::optional<SurfaceManager::SurfaceProps> SurfaceManager::getSurfaceProps(

visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
surfaceProps = SurfaceManager::SurfaceProps{
surfaceId,
surfaceHandler.getModuleName(),
surfaceHandler.getProps(),
surfaceHandler.getLayoutConstraints(),
surfaceHandler.getLayoutContext()};
.surfaceId = surfaceId,
.moduleName = surfaceHandler.getModuleName(),
.props = surfaceHandler.getProps(),
.layoutConstraints = surfaceHandler.getLayoutConstraints(),
.layoutContext = surfaceHandler.getLayoutContext()};
});

return surfaceProps;
Expand Down
Loading