offscreen rendering VS. native window rendering and WPF rendering VS. WinForms rendering

800 views
Skip to first unread message

Balázs Szántó

unread,
Jul 8, 2014, 2:14:25 PM7/8/14
to cef...@googlegroups.com
Hi!

First, great job with CefGlue! Thanks!

Second, I have few questions about rendering browser window. My understanding is:

CefGlue.WindowsForms:
- It uses Native window rendering
- The CefWebBrowser is a System.Windows.Forms.Control,
- the CefwebBrowser controls Handle is passed to CEF to render the content there

CefGlue.WPF:
- It uses offscreen rendering
- The WpfCefBrowser is System.Windows.Controls.ContentControl
- The content is written into a WriteableBitmap

My application is basically a game, rendering to a canvas, using javascript. My client app in WPF, so I'm using the WpfCefBrowser. The problem is that it has serious performance problems. I have the following questions:
1, During tweaking the command line switches, using these I gained some performance: 
        commandLine.AppendSwitch("--disable-accelerated-2d-canvas");
Any idea why?

2, With the Winforms control it is much faster, is it because that it uses the underlying native window rendering? (of couse I didn't disable the 2d canvas hw acceleration with the winforms control)

3, Is it possible to create a WPF control with native window rendering? If not, why? Using the WriteableBitmap was because of limitation of WPF? I know that I can use WinForms controls in WPF, but I'm interested in is it possible?

Thanks!

Balazs



StGeorge

unread,
Sep 16, 2014, 4:17:57 PM9/16/14
to cef...@googlegroups.com
I had the same results - WPF was much slower, possibly for the reasons you indicated. I really think the WPF control is just meant for when you have a majority WPF app and need to show some help screens or something using HTML. But for best performance where you don't care about the underlying tech, WinForms is the most "to the metal" you can get in the .NET world (other than rolling your own Win32 C++ wrapper around CEF proper).
Reply all
Reply to author
Forward
0 new messages