How to handle webgl context lost/restored in wasm?

91 views
Skip to first unread message

Hippo

unread,
Sep 28, 2022, 11:12:58 PM9/28/22
to skia-discuss
I set context to nullptr in webgl context lost. I am sure the sk_sp<GrDirectContext> is unique before set it to nullptr.

Then create a new context in webgl context restored.
auto interface = GrGLMakeNativeInterface();
context_ = GrDirectContext::MakeGL(interface);

But the path render result is werid after I sleep my mac then wake it.

Before sleep my mac:
iShot_2022-09-29_11.06.02.png

After wake my mac:
iShot_2022-09-29_11.08.20.png

The werid render result only happens in iMac 2020, AMD Radeon Pro 5500 XT 8G
It works fine in Mac mini

I use skia m106, emscripten 3.1.17

Reply all
Reply to author
Forward
0 new messages