Support for (de)serializing config values (#1571)

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

X-link: https://github.com/facebook/react-native/pull/42750

tsia. This is state we need to capture as it can drastically affect the benchmark times

Reviewed By: NickGerleman

Differential Revision: D53203385

fbshipit-source-id: 47178458d039df90fb15d8a420f9e0f17e4fe6ca
This commit is contained in:
Joe Vilches
2024-02-09 16:44:32 -08:00
committed by Facebook GitHub Bot
parent a37565f70d
commit f90ad378ff
12 changed files with 386 additions and 349 deletions

View File

@@ -223,18 +223,6 @@ const char* YGPositionTypeToString(const YGPositionType value) {
return "unknown";
}
const char* YGPrintOptionsToString(const YGPrintOptions value) {
switch (value) {
case YGPrintOptionsLayout:
return "layout";
case YGPrintOptionsStyle:
return "style";
case YGPrintOptionsChildren:
return "children";
}
return "unknown";
}
const char* YGUnitToString(const YGUnit value) {
switch (value) {
case YGUnitUndefined:

View File

@@ -120,13 +120,6 @@ YG_ENUM_DECL(
YGPositionTypeRelative,
YGPositionTypeAbsolute)
YG_ENUM_DECL(
YGPrintOptions,
YGPrintOptionsLayout = 1,
YGPrintOptionsStyle = 2,
YGPrintOptionsChildren = 4)
YG_DEFINE_ENUM_FLAG_OPERATORS(YGPrintOptions)
YG_ENUM_DECL(
YGUnit,
YGUnitUndefined,

View File

@@ -1,38 +0,0 @@
/*
* 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.
*/
// @generated by enums.py
// clang-format off
#pragma once
#include <cstdint>
#include <yoga/YGEnums.h>
#include <yoga/enums/YogaEnums.h>
namespace facebook::yoga {
enum class PrintOptions : uint32_t {
Layout = YGPrintOptionsLayout,
Style = YGPrintOptionsStyle,
Children = YGPrintOptionsChildren,
};
YG_DEFINE_ENUM_FLAG_OPERATORS(PrintOptions)
constexpr PrintOptions scopedEnum(YGPrintOptions unscoped) {
return static_cast<PrintOptions>(unscoped);
}
constexpr YGPrintOptions unscopedEnum(PrintOptions scoped) {
return static_cast<YGPrintOptions>(scoped);
}
inline const char* toString(PrintOptions e) {
return YGPrintOptionsToString(unscopedEnum(e));
}
} // namespace facebook::yoga