Page 1 of 1

Stop rendering process

PostPosted: Wed Jul 07, 2021 11:34 am
by ValentinNikin
I need to stop rendering process (OnPaint method mustn't fired), and start that process again after a while. Can I do it?

In that time, while rendering process is stopped I need to change some settings such as Window Size, Frame Rate, URL. Seems I can change it with ChromiumWebBrowser instance.

But also I need to change GPU renderer settings (enable/disable). Is it possible?

Re: Stop rendering process

PostPosted: Wed Jul 07, 2021 2:03 pm
by amaitland
GPU settings are process wide, cannot be changed after set, you'll need to restart your application.

There is no option I'm aware of to close a render process.

Re: Stop rendering process

PostPosted: Wed Jul 07, 2021 2:14 pm
by magreenblatt
You can stop the OnPaint callback with WasHidden(true) but it won’t terminate or restart any processes.

Re: Stop rendering process

PostPosted: Wed Jul 07, 2021 2:24 pm
by amaitland
You can control some of the low level functionality including frame rate via the IBrowserHost interface.

http://cefsharp.github.io/api/91.1.x/ht ... erHost.htm
http://cefsharp.github.io/api/91.1.x/ht ... erHost.htm

Re: Stop rendering process

PostPosted: Wed Jul 07, 2021 2:50 pm
by ValentinNikin
I tried call .Dispose() for ChromiumWebBrowser instance when I need stop the process. And seems it's work for me. When I need to start again I create new ChromiumWebBrowser instance. What you say about this approach?
But I ran into another problem, when I call Cef.Shutdown, the application process is exited with code 0x80000003.

Re: Stop rendering process

PostPosted: Wed Jul 07, 2021 3:53 pm
by amaitland
You can dispose of the ChromiumWebBrowser instance and create a new one if that suites your purpose.

All ChromiumWebBrowser instances must be disposed before calling Cef.Shutdown,. Once call you cannot create any further ChromiumWebBrowser instances. You cannot Cef.Initialize after shutdown is called.