-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does CefSharp support accelerated compositing? #316
Comments
Looked thru the CefSharp code and found a call to set off screen rendering mode in the CefSharp.Wpf WebView constructor ... managedCefBrowserAdapter.CreateOffscreenBrowser(...). So it would seem that the WPF version is unconditionally coded to use off screen rendering, so does not support accelerated compositing. |
Yes right. Seems someone has started working on accelerated OSR upstream though... http://www.magpcss.org/ceforum/viewtopic.php?f=8&t=11635 Here's hoping that it will land before milestone 3000 😉 |
Is it necessary for CefSharp.Wpf to unconditionally use CEF in OSR mode? What are the reasons, pros and cons? |
I guess an alternative could be implemented either at the HWND or WinFormsHost level. I think it would be nice if CefSharp had both options if a solid solution can be built. That just hasn't been done - yet. https://www.simple-talk.com/dotnet/.net-framework/mixing-wpf-and-winforms/ seems like a good introduction to the WinFormsHost approach including a pointer to some "gotchas". BTW #241 mentions the opposite direction of embedding.
For what reasons, if I may ask? |
I do see WinFormsHost as my first option. |
Hi @oxbough. The reason the WPF control uses OSR is that it must do so to properly support the features that are native to WPF, like transparency (being able to overlay a These features are more crucial for some people (like me) than being able to support use cases like the one you describe. Generally, as a user, I would be quite annoyed by an application that tries to display 9 videos concurrently... 😜 But perhaps I'm missing your point a bit. |
(As far as WinForms is concerned, it should be fairly easy to support though. Feel free to experiment with it and get back to us if you cannot make it work for whatever reason. So either write your app as a WinForms app, or - like @jornh is suggesting - try the approach of embedding the WinForms control in a WPF app.) Bear in mind though that the CefSharp3 (i.e. the current |
Hi @perlun We have existing development using WPF. But there are reasons for not using the VS WPF default rendering engine (trident), so we are looking to replace with Chromium. This is an embedded browser control that is part of a larger app. The embedded browser control will not be a general use browser with navigation buttons, but will load specific, proprietary HTML/CSS/JavaScript code. Our users want multiple video windows in this product. |
Right. Well, I think it is hard to combine this requirement with requirements from other people (like me). But feel free to hack around; if you manage to patch CefSharp so that it works for you, I guess we can include the changes in the |
FYI, was able to get WinForms control version of CefSharp embedded in a WPF frame. I'm relatively new to C# and WPF, but now even newer to WinForms. Some gotchas I hit, like had to explicitly set visibility to true before it was visible or else CEF didn't start the renderer process. However, in the end, this may not be what we go with. Looking at embedding C++ WInForms CEF3 in WPF frame instead. Not sure it is possible in all our use cases. |
Out of curiosity, what exacrtly is C++ WinForms CEF3? |
Please tell me that CefSharp does indeed support accelerated compositing. In #309 @jornh said that CefSharp.Wpf.Example uses off-screen rendering mode. And https://code.google.com/p/chromiumembedded/wiki/GeneralUsage very clearly states that off-screen rendering mode does not support accelerated compositing. Is it just the Wpf.Example that uses off screen rendering? Or is it CefSharp.Wpf ? Or not at all? This is an important factor for me in using CefSharp.Wpf.
The text was updated successfully, but these errors were encountered: