From abf97d6613f6250128e9ff196658d9f173e6faa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20W=C3=B6hrl?= Date: Tue, 20 Dec 2016 09:31:31 +0100 Subject: [PATCH] fix benchmarks --- benchmark/YGBenchmark.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/benchmark/YGBenchmark.c b/benchmark/YGBenchmark.c index 2e816359..6f8e117a 100644 --- a/benchmark/YGBenchmark.c +++ b/benchmark/YGBenchmark.c @@ -26,8 +26,8 @@ YGBENCHMARKS({ YGBENCHMARK("Stack with flex", { const YGNodeRef root = YGNodeNew(); - YGNodeStyleSetWidth(root, 100); - YGNodeStyleSetHeight(root, 100); + YGNodeStyleSetWidth(root, YGPx(100)); + YGNodeStyleSetHeight(root, YGPx(100)); for (uint32_t i = 0; i < 10; i++) { const YGNodeRef child = YGNodeNew(); @@ -45,7 +45,7 @@ YGBENCHMARKS({ for (uint32_t i = 0; i < 10; i++) { const YGNodeRef child = YGNodeNew(); - YGNodeStyleSetHeight(child, 20); + YGNodeStyleSetHeight(child, YGPx(20)); YGNodeSetMeasureFunc(child, _measure); YGNodeInsertChild(root, child, 0); } @@ -80,31 +80,31 @@ YGBENCHMARKS({ for (uint32_t i = 0; i < 10; i++) { const YGNodeRef child = YGNodeNew(); YGNodeStyleSetFlexGrow(child, 1); - YGNodeStyleSetWidth(child, 10); - YGNodeStyleSetHeight(child, 10); + YGNodeStyleSetWidth(child, YGPx(10)); + YGNodeStyleSetHeight(child, YGPx(10)); YGNodeInsertChild(root, child, 0); for (uint32_t ii = 0; ii < 10; ii++) { const YGNodeRef grandChild = YGNodeNew(); YGNodeStyleSetFlexDirection(grandChild, YGFlexDirectionRow); YGNodeStyleSetFlexGrow(grandChild, 1); - YGNodeStyleSetWidth(grandChild, 10); - YGNodeStyleSetHeight(grandChild, 10); + YGNodeStyleSetWidth(grandChild, YGPx(10)); + YGNodeStyleSetHeight(grandChild, YGPx/10)); YGNodeInsertChild(child, grandChild, 0); for (uint32_t iii = 0; iii < 10; iii++) { const YGNodeRef grandGrandChild = YGNodeNew(); YGNodeStyleSetFlexGrow(grandGrandChild, 1); - YGNodeStyleSetWidth(grandGrandChild, 10); - YGNodeStyleSetHeight(grandGrandChild, 10); + YGNodeStyleSetWidth(grandGrandChild, YGPx(10)); + YGNodeStyleSetHeight(grandGrandChild, YGPx(10)); YGNodeInsertChild(grandChild, grandGrandChild, 0); for (uint32_t iii = 0; iii < 10; iii++) { const YGNodeRef grandGrandGrandChild = YGNodeNew(); YGNodeStyleSetFlexDirection(grandGrandGrandChild, YGFlexDirectionRow); YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1); - YGNodeStyleSetWidth(grandGrandGrandChild, 10); - YGNodeStyleSetHeight(grandGrandGrandChild, 10); + YGNodeStyleSetWidth(grandGrandGrandChild, YGPx(10)); + YGNodeStyleSetHeight(grandGrandGrandChild, YGPx(10)); YGNodeInsertChild(grandGrandChild, grandGrandGrandChild, 0); } }