Skip to content
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

Feature Request - Add CefRenderHandler::OnAcceleratedPaint #2527

Closed
4 tasks done
amaitland opened this issue Sep 28, 2018 · 15 comments
Closed
4 tasks done

Feature Request - Add CefRenderHandler::OnAcceleratedPaint #2527

amaitland opened this issue Sep 28, 2018 · 15 comments

Comments

@amaitland
Copy link
Member

amaitland commented Sep 28, 2018

CEF has added support for shared textures on Windows using D3D11 (and only D3D11). See commit https://bitbucket.org/chromiumembedded/cef/commits/713eebcafcd7799d4e0eb58b8c2ab58d03ab9b65 for full details.

These changes have been merged into the CEF master branch and will be available in version 71 (CEF builds will be roughly available sometime in early December).

  • Add IWindowInfo.SharedTextureEnabled
  • Add IRenderHandler.OnAcceleratedPaint
  • Add IWindowInfo.ExternalBeginFrameEnabled
  • Add IBrowserHost.SendExternalBeginFrame

Actually implementing D3D rendering in CefSharp is outside the scope of this issue. This issue reflects work to be done exposing the relevant CEF API methods/handlers.

Just for reference Microsoft have an open source project for enabling D3D11 support, see https://github.com/Microsoft/WPFDXInterop

@amaitland amaitland added this to the 71.0.0 milestone Sep 28, 2018
@amaitland
Copy link
Member Author

There is one known issue with shared textures and PDF rendering currently, https://bitbucket.org/chromiumembedded/cef/issues/2516/windows-osr-pdf-viewer-does-not-render

I expect there will be quite a few issues that will need to be addressed. Others are reporting issues on the original PR see https://bitbucket.org/chromiumembedded/cef/pull-requests/158/support-external-textures-in-osr-mode/ for details.

I expect it will take a while before this feature is production ready.

@mitchcapper
Copy link
Contributor

It seems the pdf shared textures is fixed in master so by 71 time will not be an issue, but there still are some others that seem relevant.

@amaitland
Copy link
Member Author

Another issue https://bitbucket.org/chromiumembedded/cef/issues/2538/windows-osr-with-shared-textures-renders

@mcdis
Copy link

mcdis commented Nov 30, 2018

Any progress? IWindowInfo.SharedTextureEnabled?

@amaitland
Copy link
Member Author

When progress has been made this issue will be updated. Chrome hasn't even released a stable 71 build yet.

@amaitland amaitland self-assigned this Dec 10, 2018
@amaitland
Copy link
Member Author

@amaitland
Copy link
Member Author

OnAcceleratedPaint has been added to master. Some refactoring of the OffScreen and WPF browsers was required. I have yet to test OnAcceleratedPaint

  • WPF inherit from ChromiumWebBrowser and override CreateOffscreenBrowserWindowInfo, you can access IWindowInfo and change SharedTextureEnabled
  • OffScreen create the ChromiumWebBrowser instance and set automaticallyCreateBrowser = false in the constructor. Then call CreateBrowser passing in an instance of WindowInfo with the relevant properties set.

@amaitland
Copy link
Member Author

In WPF/OffScreen you will need to implement IRenderHandler and provide an implementation of OnAcceleratedPaint.

@EladBahar
Copy link

hey,
will you implement WPF/Offsccreen demo with OnAcceleratedPaint ?

@amaitland
Copy link
Member Author

I have no experience with DirectX and it's unclear if WPF only supporting DirectX 9 can be made to work with OnAcceleratedPaint that requires DirectX 11.

At a later point I will experiment with adding a demo to the WPF example (there's no generic use-case for the OffScreen project). Pull requests are welcome to add a demo in the short term.

If a stable WPF implementation can be developed then a new CefSharp.Wpf.DirectX project/nuget package can be created (I expect a new package will be required SharpDx or WPFDxInterop, so we'll isolate that dependency from the main WPF project).

@amaitland
Copy link
Member Author

Chrome changes will break OnAcceleratedPaint in newer version of CEF, see https://bitbucket.org/chromiumembedded/cef/issues/2559/cefclientexe-shared-texture-enabled-off for details.

@vwmberry95
Copy link
Contributor

Issue is closed yet it's listed in the v71.0.0-pre01 release?

@amaitland
Copy link
Member Author

Issue is closed yet it's listed in the v71.0.0-pre01 release?

@vwmberry95 What do you mean? The API has been added, this issue has been closed.

@AliFlux
Copy link

AliFlux commented Apr 6, 2019

Hi. Any update on this issue? I'm using the latest WPF nuget package and the rendering is still kinda slow.

@amaitland
Copy link
Member Author

Performance improvements are outside the scope of this issue.

@cefsharp cefsharp locked as resolved and limited conversation to collaborators Apr 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants