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
26 lines
587 B
C++
26 lines
587 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.
|
|
*/
|
|
|
|
#include <fstream>
|
|
|
|
#include <capture/CaptureTree.h>
|
|
#include <capture/NodeToString.h>
|
|
|
|
namespace facebook::yoga {
|
|
|
|
void captureTree(YGNodeRef node, const std::filesystem::path& path) {
|
|
std::string str;
|
|
nodeToString(
|
|
str,
|
|
node,
|
|
PrintOptions::Style | PrintOptions::Children | PrintOptions::Config);
|
|
std::ofstream file(path);
|
|
file << str;
|
|
}
|
|
|
|
} // namespace facebook::yoga
|