mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ca7a3519cf
Summary: Right now invalidate always tell the root node that the tree is dirty, and next update will traverse the entire tree in search of changes. While this works correctly, it's not the most efficient implementation. It is more efficient to store dirty flag in every node, and skip entire subtrees if this node and all descendants are already up to date. This diff is a first step towards that optimization. Reviewed By: ahmedre Differential Revision: D2955197
31 lines
938 B
Java
31 lines
938 B
Java
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
package com.facebook.react.flat;
|
|
|
|
/**
|
|
* Root node of the shadow node hierarchy. Currently, the only node that can actually map to a View.
|
|
*/
|
|
/* package */ final class FlatRootShadowNode extends FlatShadowNode {
|
|
|
|
/* package */ FlatRootShadowNode() {
|
|
forceMountToView();
|
|
signalBackingViewIsCreated();
|
|
}
|
|
|
|
/**
|
|
* Returns true when this CSSNode tree needs to be re-laid out. If true, FlatUIImplementation
|
|
* will request LayoutEngine to perform a layout pass to update node boundaries. This is used
|
|
* to avoid unnecessary node updates.
|
|
*/
|
|
/* package */ boolean needsLayout() {
|
|
return isDirty();
|
|
}
|
|
}
|