| 136 | } |
| 137 | |
| 138 | void AndroidViewTransaction::snapshotView(const Valdi::Ref<Valdi::View>& view, |
| 139 | Valdi::Function<void(Valdi::Result<Valdi::BytesView>)> cb) { |
| 140 | auto callback = Valdi::makeShared<Valdi::ValueFunctionWithCallable>( |
| 141 | [cb = std::move(cb)](const Valdi::ValueFunctionCallContext& callContext) -> Valdi::Value { |
| 142 | auto value = callContext.getParameter(0); |
| 143 | auto typedArray = value.getTypedArray(); |
| 144 | cb(typedArray != nullptr ? typedArray->getBuffer() : Valdi::BytesView()); |
| 145 | return Valdi::Value::undefined(); |
| 146 | }); |
| 147 | |
| 148 | auto callbackAsActionObject = ValdiAndroid::toJavaObject(JavaEnv(), callback); |
| 149 | ValdiFunctionType valdiFunction(JavaEnv(), callbackAsActionObject.stealLocalRef()); |
| 150 | JavaCache::get().getViewRefSnapshotMethod().call(fromValdiView(view), valdiFunction); |
| 151 | } |
| 152 | |
| 153 | void AndroidViewTransaction::flushAnimator(const Valdi::Ref<Valdi::Animator>& animator, |
| 154 | const Valdi::Value& completionCallback) { |
nothing calls this directly
no test coverage detected