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:
committed by
Facebook GitHub Bot
parent
b35456b93c
commit
c278713eb5
@@ -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,
|
||||
|
Reference in New Issue
Block a user