Files
yoga/benchmark/Benchmark.h
Joe Vilches 568671266e Ability to capture trees as JSON files (#1565)
Summary:

This adds a `captureTree` method intended to be injected in somewhere where you would like a JSON representation of a yoga tree (like in calculateLayout). Right now it is very simple and just calls on `nodeToString` to serialize a node into JSON, and then saves that into a file in the `benchmark` dir. Some buck file changes needed to be done as well as this is the first `.cpp` file in `benchmark`

Differential Revision: D52972995
2024-01-24 12:30:22 -08:00

20 lines
375 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.
*/
#ifdef DEBUG
#pragma once
#include <yoga/node/Node.h>
namespace facebook::yoga {
void captureTree(const Node* node, std::string captureName);
} // namespace facebook::yoga
#endif