| 1014 | output = viewNode->convertSelfVisualToParentVisual(input); |
| 1015 | } else if (mode == kModeVisualAbsolute) { |
| 1016 | output = viewNode->convertSelfVisualToRootVisual(input); |
| 1017 | } else if (mode == kModeViewportRelative) { |
| 1018 | output = viewNode->getCalculatedViewport().location(); |
| 1019 | } else if (mode == kModeViewportAbsolute) { |
| 1020 | auto viewportLocation = viewNode->getCalculatedViewport().location(); |
| 1021 | output = viewNode->convertSelfVisualToRootVisual(viewportLocation); |
| 1022 | } else { |
| 1023 | ValdiAndroid::JavaEnv::getUnsafeEnv()->ThrowNew( |
| 1024 | ValdiAndroid::JavaEnv::getCache().getValdiExceptionClass().getClass(), "Invalid coordinate mode"); |
| 1025 | } |
| 1026 | |
| 1027 | return Valdi::pointsToPackedPixels(output.x, output.y, pointScale); |
| 1028 | } |
| 1029 | |
| 1030 | jlong ValdiAndroid::NativeBridge::getViewNodeSize( // NOLINT |
| 1031 | fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT, |
| 1032 | jlong runtimeHandle, |
| 1033 | jlong viewNodeHandle, |
| 1034 | jint mode) { |
| 1035 | auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle); |
| 1036 | auto viewNode = getViewNode(viewNodeHandle); |
| 1037 | if (viewNode == nullptr || runtimeWrapper == nullptr) { |
| 1038 | return 0; |
| 1039 | } |
| 1040 | |
| 1041 | static constexpr jint kModeFrame = 1; |
| 1042 | static constexpr jint kModeViewport = 2; |
| 1043 | |
| 1044 | Valdi::Size output; |
| 1045 | |
| 1046 | if (mode == kModeFrame) { |
nothing calls this directly
no test coverage detected