Make node printing private

Summary:
@public

Removes `YGNodeGetPrintFunc`, and encapsulates node printing within `YGNode`.
This is necessary for allowing for context-aware callback functions, which will ultimately allow for removal of weak global JNI references.

On a side node, the printing logic does not seem to be well thought through: print functions print as a side effect to whatever output they choose. Printing that uses callbacks is printing to different output streams or strings, though.

We need to consolidate Yoga debugging, and make it all more stringent.

Reviewed By: SidharthGuglani

Differential Revision: D14131024

fbshipit-source-id: 68704682dab3e7dfba61930bb03003d7d4723b80
This commit is contained in:
David Aurelio
2019-02-19 09:54:48 -08:00
committed by Facebook Github Bot
parent bd90192df9
commit 59bcac3289
5 changed files with 12 additions and 21 deletions

View File

@@ -114,9 +114,7 @@ void YGNodeToString(
uint32_t level) {
indent(str, level);
appendFormatedString(str, "<div ");
if (node->getPrintFunc() != nullptr) {
node->getPrintFunc()(node);
}
node->print();
if (options & YGPrintOptionsLayout) {
appendFormatedString(str, "layout=\"");