Avoid transfering cached layout information to java

Summary: Don't transfer layout outputs to java if the layout was cached as this means that it has already been transfered

Reviewed By: astreet

Differential Revision: D4716024

fbshipit-source-id: c30763a6fc7426d653c7a6ca129615cddb4140e9
This commit is contained in:
Emil Sjolander
2017-03-17 09:07:24 -07:00
committed by Facebook Github Bot
parent 249d010dad
commit a14aeb27bb
3 changed files with 21 additions and 0 deletions

View File

@@ -24,6 +24,12 @@ static void YGTransferLayoutDirection(YGNodeRef node, alias_ref<jobject> javaNod
}
static void YGTransferLayoutOutputsRecursive(YGNodeRef root) {
// If the node is using a cached layout it means we have already
// transfered it to java.
if (YGNodeIsUsingCachedLayout(root)) {
return;
}
if (auto obj = YGNodeJobject(root)->lockLocal()) {
static auto widthField = obj->getClass()->getField<jfloat>("mWidth");
static auto heightField = obj->getClass()->getField<jfloat>("mHeight");