Revert D48712710: C++ Cleanup 3/N: Reorganize YGNode
Differential Revision: D48712710 Original commit changeset: d28eae38469a Original Phabricator Diff: D48712710 fbshipit-source-id: 7a10b071edcf045ce98bbf8f9deca0d0e2e80a14
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6ca56e87ce
commit
ea7f61a3db
@@ -17,7 +17,7 @@
|
||||
|
||||
// TODO: Reconcile missing layoutContext functionality from callbacks in the C
|
||||
// API and use that
|
||||
#include <yoga/node/Node.h>
|
||||
#include <yoga/YGNode.h>
|
||||
|
||||
using namespace facebook;
|
||||
using namespace facebook::yoga;
|
||||
@@ -688,7 +688,7 @@ static void jni_YGNodeSetHasMeasureFuncJNI(
|
||||
jobject /*obj*/,
|
||||
jlong nativePointer,
|
||||
jboolean hasMeasureFunc) {
|
||||
static_cast<yoga::Node*>(_jlong2YGNodeRef(nativePointer))
|
||||
_jlong2YGNodeRef(nativePointer)
|
||||
->setMeasureFunc(hasMeasureFunc ? YGJNIMeasureFunc : nullptr);
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ static void jni_YGNodeSetHasBaselineFuncJNI(
|
||||
jobject /*obj*/,
|
||||
jlong nativePointer,
|
||||
jboolean hasBaselineFunc) {
|
||||
static_cast<yoga::Node*>(_jlong2YGNodeRef(nativePointer))
|
||||
_jlong2YGNodeRef(nativePointer)
|
||||
->setBaselineFunc(hasBaselineFunc ? YGJNIBaselineFunc : nullptr);
|
||||
}
|
||||
|
||||
|
@@ -14,12 +14,11 @@
|
||||
#include "jni.h"
|
||||
|
||||
class PtrJNodeMapVanilla {
|
||||
std::map<YGNodeConstRef, size_t> ptrsToIdxs_{};
|
||||
jobjectArray javaNodes_{};
|
||||
std::map<YGNodeRef, size_t> ptrsToIdxs_;
|
||||
jobjectArray javaNodes_;
|
||||
|
||||
public:
|
||||
PtrJNodeMapVanilla() = default;
|
||||
|
||||
PtrJNodeMapVanilla() : ptrsToIdxs_{}, javaNodes_{} {}
|
||||
PtrJNodeMapVanilla(jlongArray javaNativePointers, jobjectArray javaNodes)
|
||||
: javaNodes_{javaNodes} {
|
||||
using namespace facebook::yoga::vanillajni;
|
||||
@@ -31,11 +30,11 @@ public:
|
||||
javaNativePointers, 0, nativePointersSize, nativePointers.data());
|
||||
|
||||
for (size_t i = 0; i < nativePointersSize; ++i) {
|
||||
ptrsToIdxs_[(YGNodeConstRef) nativePointers[i]] = i;
|
||||
ptrsToIdxs_[(YGNodeRef) nativePointers[i]] = i;
|
||||
}
|
||||
}
|
||||
|
||||
facebook::yoga::vanillajni::ScopedLocalRef<jobject> ref(YGNodeConstRef node) {
|
||||
facebook::yoga::vanillajni::ScopedLocalRef<jobject> ref(YGNodeRef node) {
|
||||
using namespace facebook::yoga::vanillajni;
|
||||
|
||||
JNIEnv* env = getCurrentEnv();
|
||||
|
Reference in New Issue
Block a user