MCPcopy Create free account
hub / github.com/Snapchat/Valdi / callOnJsThread

Method callOnJsThread

valdi/src/valdi/android/NativeBridge.cpp:1178–1196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1176 return Valdi::pointsToPackedPixels(measuredSize.width, measuredSize.height, pointScale);
1177}
1178
1179void ValdiAndroid::NativeBridge::setLayoutSpecs( // NOLINT
1180 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
1181 jlong runtimeHandle,
1182 jlong contextHandle,
1183 jint width,
1184 jint height,
1185 jboolean isRTL) {
1186 auto viewNodeTree = getViewNodeTree(contextHandle);
1187 auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle);
1188
1189 if (viewNodeTree == nullptr || runtimeWrapper == nullptr) {
1190 return;
1191 }
1192
1193 auto widthFloat = static_cast<float>(width) / runtimeWrapper->getPointScale();
1194 auto heightFloat = static_cast<float>(height) / runtimeWrapper->getPointScale();
1195 auto layoutDirection = static_cast<bool>(isRTL) ? Valdi::LayoutDirectionRTL : Valdi::LayoutDirectionLTR;
1196
1197 viewNodeTree->setLayoutSpecs(Valdi::Size(widthFloat, heightFloat), layoutDirection);
1198}
1199

Callers

nothing calls this directly

Calls 5

getRuntimeWrapperFunction · 0.85
getJavaScriptRuntimeMethod · 0.80
JavaEnvClass · 0.50
dispatchOnJsThreadMethod · 0.45
getRuntimeMethod · 0.45

Tested by

no test coverage detected