pass cachedLayout and cachedMeasure measures to plugin
Summary: Passing whether layout cache or measure cache was used or not Reviewed By: davidaurelio Differential Revision: D15920937 fbshipit-source-id: a6728e7af07ea228a285f824fbdfddc8130c5990
This commit is contained in:
committed by
Facebook Github Bot
parent
2dc5a16d1f
commit
39996512fc
@@ -3928,7 +3928,16 @@ bool YGLayoutNodeInternal(
|
||||
layout->generationCount = gCurrentGenerationCount;
|
||||
|
||||
#ifdef YG_ENABLE_EVENTS
|
||||
Event::publish<Event::NodeLayout>(node, {performLayout, layoutContext});
|
||||
LayoutType layoutType;
|
||||
if (performLayout) {
|
||||
layoutType = !needToVisitNode && cachedResults == &layout->cachedLayout
|
||||
? LayoutType::kCachedLayout
|
||||
: LayoutType::kLayout;
|
||||
} else {
|
||||
layoutType = cachedResults != nullptr ? LayoutType::kCachedMeasure
|
||||
: LayoutType::kMeasure;
|
||||
}
|
||||
Event::publish<Event::NodeLayout>(node, {layoutType, layoutContext});
|
||||
#endif
|
||||
|
||||
return (needToVisitNode || cachedResults == nullptr);
|
||||
|
@@ -17,6 +17,13 @@ struct YGNode;
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
|
||||
enum LayoutType : int {
|
||||
kLayout = 0,
|
||||
kMeasure = 1,
|
||||
kCachedLayout = 2,
|
||||
kCachedMeasure = 3
|
||||
};
|
||||
|
||||
struct Event {
|
||||
enum Type {
|
||||
NodeAllocation,
|
||||
@@ -99,7 +106,7 @@ struct Event::TypedData<Event::NodeMeasure> {
|
||||
|
||||
template <>
|
||||
struct Event::TypedData<Event::NodeLayout> {
|
||||
bool performLayout;
|
||||
LayoutType layoutType;
|
||||
void* layoutContext;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user