Add support for context-aware cloning functions
Summary: @public Context-aware cloning functions are an internal Yoga feature that will be used for Yoga’s JNI code. It will be possible to specify a context when calculating layout, which will be passed on to cloning functions. This will be a private feature. Reviewed By: SidharthGuglani Differential Revision: D14149470 fbshipit-source-id: 1d11106e65f9d872d10f191763da001f8d158a61
This commit is contained in:
committed by
Facebook Github Bot
parent
b1c749075d
commit
2156de5fb5
@@ -146,16 +146,16 @@ public:
|
||||
// Applies a callback to all children, after cloning them if they are not
|
||||
// owned.
|
||||
template <typename T>
|
||||
void iterChildrenAfterCloningIfNeeded(T callback) {
|
||||
void iterChildrenAfterCloningIfNeeded(T callback, void* cloneContext) {
|
||||
int i = 0;
|
||||
for (YGNodeRef& child : children_) {
|
||||
if (child->getOwner() != this) {
|
||||
child = config_->cloneNode(child, this, i);
|
||||
child = config_->cloneNode(child, this, i, cloneContext);
|
||||
child->setOwner(this);
|
||||
}
|
||||
i += 1;
|
||||
|
||||
callback(child);
|
||||
callback(child, cloneContext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ public:
|
||||
bool removeChild(YGNodeRef child);
|
||||
void removeChild(uint32_t index);
|
||||
|
||||
void cloneChildrenIfNeeded();
|
||||
void cloneChildrenIfNeeded(void*);
|
||||
void markDirtyAndPropogate();
|
||||
float resolveFlexGrow();
|
||||
float resolveFlexShrink();
|
||||
|
Reference in New Issue
Block a user