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
41 lines
845 B
C++
41 lines
845 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <string>
|
|
|
|
#include <capture/CaptureTree.h>
|
|
#include <nlohmann/json.hpp>
|
|
#include <yoga/Yoga.h>
|
|
|
|
namespace facebook::yoga {
|
|
|
|
enum class PrintOptions : uint8_t {
|
|
Layout = 1 << 0,
|
|
Children = 1 << 1,
|
|
Style = 1 << 2,
|
|
Config = 1 << 3,
|
|
Node = 1 << 4,
|
|
};
|
|
YG_DEFINE_ENUM_FLAG_OPERATORS(PrintOptions);
|
|
|
|
void serializeTree(
|
|
nlohmann::json& j,
|
|
SerializedMeasureFuncMap& nodesToMeasureFuncs,
|
|
YGNodeRef root,
|
|
PrintOptions options);
|
|
|
|
void serializeLayoutInputs(
|
|
nlohmann::json& j,
|
|
float availableWidth,
|
|
float availableHeight,
|
|
YGDirection ownerDirection);
|
|
|
|
} // namespace facebook::yoga
|