Node -> Measure func map instead of vec (#1581)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1581

This is better than just trusting the order of the measure func call. Now each measure function I/O is associated with a node in the JSON.

Reviewed By: NickGerleman

Differential Revision: D53776790

fbshipit-source-id: 793cf2d9cbf6f663d24848af0af30aa297614eea
This commit is contained in:
Joe Vilches
2024-02-21 18:02:58 -08:00
committed by Facebook GitHub Bot
parent b35456b93c
commit c278713eb5
9 changed files with 10165 additions and 9807 deletions

View File

@@ -8,6 +8,8 @@
#pragma once
#include <filesystem>
#include <unordered_map>
#include <vector>
#include <yoga/Yoga.h>
@@ -23,6 +25,9 @@ struct SerializedMeasureFunc {
std::chrono::steady_clock::duration::rep durationNs;
};
using SerializedMeasureFuncMap =
std::unordered_map<YGNodeConstRef, std::vector<SerializedMeasureFunc>>;
void YGNodeCalculateLayoutWithCapture(
YGNodeRef node,
float availableWidth,
@@ -31,6 +36,7 @@ void YGNodeCalculateLayoutWithCapture(
const std::filesystem::path& path);
void captureMeasureFunc(
YGNodeConstRef node,
float width,
YGMeasureMode widthMode,
float height,