From 19fd066507362d54553ecee6d295db99d8a7c840 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 11 Jun 2019 01:37:19 -0700 Subject: [PATCH] Pass layout context for `Event::LayoutPassStart` Summary: Adds the layout context pointer when publishing `Event::LayoutPassStart`. Reviewed By: SidharthGuglani Differential Revision: D15754425 fbshipit-source-id: 6295ae1ebec9eab72a79c43bc1cb0e05a6d7ae68 --- yoga/Yoga.cpp | 2 +- yoga/event/event.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 6c739a06..e8a2e512 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -4013,7 +4013,7 @@ void YGNodeCalculateLayoutWithContext( void* layoutContext) { #ifdef YG_ENABLE_EVENTS - Event::publish(node); + Event::publish(node, {layoutContext}); #endif // unique pointer to allow ending the marker early std::unique_ptr> marker{ diff --git a/yoga/event/event.h b/yoga/event/event.h index 9dcd73b6..e7415566 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -72,6 +72,11 @@ struct Event::TypedData { YGConfig* config; }; +template <> +struct Event::TypedData { + void* layoutContext; +}; + template <> struct Event::TypedData { void* layoutContext;