disable compositing in cef

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

disable compositing in cef

Postby videoaudio » Tue Dec 01, 2015 11:57 am

Hi,

I am trying to disable the video compositing & rendering of images in cef (which is running in offscreen rendering mode) but keeping intact of all other features of cef as is. I am hoping not compositing anything will give cpu & memory savings (usecase is little different, I am trying to run cef based app on which there is no display facility)

To achieve this I return 0x0 sized CefRect in CefRenderHandler::GetViewRect() and CefRenderHandler::OnPaint() will not be called.

Is this the right way to achieve this?
videoaudio
Techie
 
Posts: 36
Joined: Tue Feb 17, 2015 10:08 am

Re: disable compositing in cef

Postby magreenblatt » Tue Dec 01, 2015 12:03 pm

What OS and CEF version? If you specify a 0x0 view rect then nothing will be rendered. If you don't want rendering then what specifically are you using the browser for?
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: disable compositing in cef

Postby videoaudio » Tue Dec 01, 2015 8:40 pm

Thanks for the reply.

Os: Ubuntu (64bit)
Cef version: 2454

I am trying to optimise cef's memory & cpu usage if my display device is powered off, but rest of the system is still running.
videoaudio
Techie
 
Posts: 36
Joined: Tue Feb 17, 2015 10:08 am

Re: disable compositing in cef

Postby amaitland » Tue Dec 01, 2015 8:45 pm

You can use `CefBrowserHost->WasHidden(true)` to temporarily disable rendering.

apidocs3/projects/%28default%29/CefBrowserHost.html#WasHidden%28bool%29
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: disable compositing in cef

Postby videoaudio » Wed Dec 02, 2015 12:42 am

I tried with browserObject->GetHost()->WasHidden(true); in GetViewRect() callback and it helped.
Setting cefRectangle to 0x0 in CefRenderHandler::GetViewRect() is also serving the purpose.

As of now I am using both of the above ways to make sure there is compositing done when display is off.

Thanks a lot.
videoaudio
Techie
 
Posts: 36
Joined: Tue Feb 17, 2015 10:08 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 23 guests