Using cef version 2704. OS: Windows 10
In my application, I create 3 browsers (using CefBrowserHost::CreateBrowser).
one of them is rendered with "offscreen rendering".
What I would like to get, is to disable gpu and gpu-compositing (so passing disable-gpu and disable-gpu-compositing switches) within the "offscreen rendering" renderer.
The other two renderers should use th gpu and compositing.
So my questions: is it possible to have different rendering solutions for different renderers/browsers?
I know, that I could change/add the passed switches to renderers in
- Code: Select all
CefBrowserProcessHandler::OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line)
{
command_line->AppendSwitch("disable-gpu");
command_line->AppendSwitch("disable-gpu-compositing");
}
However, when I do that for any window (not only the "windowless rendered" one) the window becomes black (rendering breaks).
On the other hand, rendering works (in all the windows) if I add this switch globally to all the renderers here:
- Code: Select all
CefApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
command_line->AppendSwitch("disable-gpu");
command_line->AppendSwitch("disable-gpu-compositing");
}
But, in such situation, all the browsers don't use gpu. As mentioned above, I want to have it enabled normally, and just disable it for the one browser (with windowless rendering).
Cef Settings I pass to CefInitialize:
- Code: Select all
settings.single_process = false;
settings.multi_threaded_message_loop = false;
settings.no_sandbox = true;
settings.windowless_rendering_enabled = true;
CefWindowInfo I am using for offscreen rendering:
- Code: Select all
windowInfo.SetAsChild(windowHandle, rect);
windowInfo.SetAsWindowless(windowHandle, true);
CefWindowInfo I am using for standard rendering:
- Code: Select all
windowInfo.SetAsChild(GetSafeHwnd(), rect);