WPF renderer?

60 views
Skip to first unread message

Raimund Bauer

unread,
Jul 29, 2015, 3:23:38 AM7/29/15
to CefSharp
Just out of curiosity: what would be necessary to get the WPF control rendering without the offscreen renderer?

Alex Maitland

unread,
Jul 29, 2015, 4:26:02 AM7/29/15
to CefSharp, ray...@gmail.com
Can you elaborate more? What exactly are you trying to achieve?

There is obviously a WinForms version which theoretically you can host in `WPF`.

Raimund Bauer

unread,
Jul 29, 2015, 10:32:05 AM7/29/15
to CefSharp, maitla...@gmail.com
It is my understanding, that the offscreen renderer has to render a whole page for every little change in the page's markup.
With a big window and animations running or animated gifs showing, the application's cpu usage goes up to about 40% (from below 10%) and customers complained about it...
Disabling hw acceleration has already helped a bit, but isn't really the solution we're happy with.

Using the WinForms control in WPF also doesn't sound like an efficient solution, do you think I should try it?

Alex Maitland

unread,
Jul 29, 2015, 6:12:06 PM7/29/15
to CefSharp, ray...@gmail.com
You can try using a different implementation for generating the bitmaps. The alternate implementation supports only updating dirty rects, so it may prove some performance benefit, it also may not if you have a large number of animations all happening at once as there is only one rect that's updated, so if you have things happening everywhere, it basically redraws the whole screen.

https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf/Rendering/BitmapFactory.cs#L13
https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf/Rendering/WritableBitmapInfo.cs#L45

Unless your aware of some other tech that I'm not (which is possible), then trying the WinForms version is the only other option that I know of.

There are reports of someone implementing Direct X support for rendering, though no PR ever emerged.
https://github.com/cefsharp/CefSharp/issues/654#issuecomment-88344428
Reply all
Reply to author
Forward
0 new messages