From 630ae0972b8e48fabbde059916ad56261571bc66 Mon Sep 17 00:00:00 2001 From: Georgiy Kassabli Date: Thu, 3 Nov 2016 10:41:27 -0700 Subject: [PATCH] Exposing layout cache check publicly Summary: We need to expose CSSLayout caching check to CKFlexboxComponent to enable performant bridging to CKComponentKit Reviewed By: emilsjolander Differential Revision: D4124705 fbshipit-source-id: 23284967900585fa20dcb51c9cc1bee829b32975 --- CSSLayout/CSSLayout.c | 2 +- CSSLayout/CSSLayout.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CSSLayout/CSSLayout.c b/CSSLayout/CSSLayout.c index 0e229e6e..dadaab50 100644 --- a/CSSLayout/CSSLayout.c +++ b/CSSLayout/CSSLayout.c @@ -2090,7 +2090,7 @@ static inline bool newMeasureSizeIsStricterAndStillValid(CSSMeasureMode sizeMode lastSize > size && lastComputedSize <= size; } -static bool CSSNodeCanUseCachedMeasurement(const bool isTextNode, +bool CSSNodeCanUseCachedMeasurement(const bool isTextNode, const CSSMeasureMode widthMode, const float width, const CSSMeasureMode heightMode, diff --git a/CSSLayout/CSSLayout.h b/CSSLayout/CSSLayout.h index 75e1e05c..881d8f3b 100644 --- a/CSSLayout/CSSLayout.h +++ b/CSSLayout/CSSLayout.h @@ -161,6 +161,20 @@ WIN_EXPORT void CSSNodePrint(const CSSNodeRef node, const CSSPrintOptions option WIN_EXPORT bool CSSValueIsUndefined(const float value); +WIN_EXPORT bool CSSNodeCanUseCachedMeasurement(const bool isTextNode, + const CSSMeasureMode widthMode, + const float width, + const CSSMeasureMode heightMode, + const float height, + const CSSMeasureMode lastWidthMode, + const float lastWidth, + const CSSMeasureMode lastHeightMode, + const float lastHeight, + const float lastComputedWidth, + const float lastComputedHeight, + const float marginRow, + const float marginColumn); + #define CSS_NODE_PROPERTY(type, name, paramName) \ WIN_EXPORT void CSSNodeSet##name(const CSSNodeRef node, type paramName); \ WIN_EXPORT type CSSNodeGet##name(const CSSNodeRef node);