| 645 | } |
| 646 | |
| 647 | void NativeEngine::RequestAnimationFrame(const Napi::CallbackInfo& info) |
| 648 | { |
| 649 | auto callback = info[0].As<Napi::Function>(); |
| 650 | |
| 651 | if (m_requestAnimationFrameCalback.IsEmpty() || |
| 652 | m_requestAnimationFrameCalback.Value() != callback) |
| 653 | { |
| 654 | m_requestAnimationFrameCalback = Napi::Persistent(callback); |
| 655 | } |
| 656 | |
| 657 | m_runtime.Dispatch([this](Napi::Env env) { |
| 658 | try |
| 659 | { |
| 660 | m_requestAnimationFrameCalback.Call({}); |
| 661 | EndFrame(); |
| 662 | } |
| 663 | catch (const std::exception& ex) |
| 664 | { |
| 665 | Napi::Error::New(env, ex.what()).ThrowAsJavaScriptException(); |
| 666 | } |
| 667 | }); |
| 668 | } |
| 669 | |
| 670 | Napi::Value NativeEngine::CreateVertexArray(const Napi::CallbackInfo& info) |
| 671 | { |
nothing calls this directly
no test coverage detected