Browser lags when animation_frame_rate is set to value != 0

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.

Browser lags when animation_frame_rate is set to value != 0

Postby Czarek » Wed Dec 26, 2012 5:34 pm

Hi,

I tried changing CefSettings.animation_frame_rate and the browser lags, everything loads slow, scrolling is slow, it doesn't matter whether I set animation_frame_rate to 30, 60 or 90, it's still the same, it works fine only when I set it to 0, which is strange because the documentation says that when I set it to 0 then the default of 30fps will be used, but when I set it to 30 then it lags. The CPU is fine, only 3-4% in use.

I'm using off-screen rendering in a Panda3D game engine:
http://code.google.com/p/cefpython/wiki/Panda3D

The application is using CefDoMessageLoopWork().

From the documenation:
animation_frame_rate - The number of frames per second (fps) for animation and windowless rendering. When window rendering is enabled and the JavaScript requestAnimationFrame method is used the browser client area will be invalidated at the rate specified. When window rendering is disabled the CefRenderHandler::OnPaint() method will be called at the rate specified. This value must be between 0 and 90. Specify a value of zero for the default frame rate of 30 fps. Changing this value may affect display performance and/or CPU usage.


Using CEF 1, rev 942, branch 1271, Chrome 23.0.1271.95.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Browser lags when animation_frame_rate is set to value !

Postby magreenblatt » Wed Dec 26, 2012 6:03 pm

Set a breakpoint in CEF and check that the value is being set as you expect?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Browser lags when animation_frame_rate is set to value !

Postby Czarek » Wed Dec 26, 2012 6:06 pm

magreenblatt wrote:Set a breakpoint in CEF and check that the value is being set as you expect?

Mystery solved :) It was a bug, the int value was casted to bool, so it was always 1 fps after setting it != 0. Now it works much better after setting it to 60. Thank you.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 198 guests