windowless rendering

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

windowless rendering

Postby sikor » Thu Oct 06, 2016 7:10 am

Hello,
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);
sikor
Techie
 
Posts: 12
Joined: Tue Sep 27, 2016 4:08 am

Re: windowless rendering

Postby magreenblatt » Thu Oct 06, 2016 9:00 am

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.

This is not supported. GPU state is global to the application instance.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 44 guests