Isolate skia opengl state from the outside state

61 views
Skip to first unread message

l1 shu

unread,
Apr 22, 2021, 9:32:25 AM4/22/21
to skia-discuss
Hi team

My skSurface is created based on gpu. I know that skia will modify the opengl state, but there will still be opengl operations outside of me. How can I isolate the opengl state of skia from the external opengl state? 

The purpose is that the state of skia can be well separated from the external state. what should I do? thanks
Message has been deleted

l1 shu

unread,
Apr 22, 2021, 9:58:28 AM4/22/21
to skia-discuss

I found a resetContext method that might help, I understand this is for the external OpenGL status does not affect Skia, but is there a way do not affect the external OpenGL state? 
like restoreContext which is used to restore the most primitive unpaladited global OpenGL status

 I hope the skia environment and the external environment will not affect each other

Greg Daniel

unread,
Apr 23, 2021, 7:12:14 AM4/23/21
to skia-discuss
After doing work outside Skia, you should use the resetContext call you found to tell Skia what GL state has changed. We do not have the reverse functionality because Skia doesn't really have a way to know what state the client might use in GL. This direction is much better handled by the client knowing what state they need to make sure is preserved. In general you should assume Skia may have changed any and all GL state.

On Thu, Apr 22, 2021 at 9:49 AM l1 shu <8733...@qq.com> wrote:
I found a resetContext method that might help, but is there a corresponding saveContext? I hope the skia environment and the external environment will not affect each other
在2021年4月22日星期四 UTC+8 下午9:32:25<l1 shu> 写道:

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/4c371f8f-9f33-476e-a3d5-dec582d550f5n%40googlegroups.com.

l1 shu

unread,
Apr 25, 2021, 10:19:39 PM4/25/21
to skia-discuss
Thanks for replying
Reply all
Reply to author
Forward
0 new messages