CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

DirectX rendering

Open alphamax opened this issue 9 years ago • 43 comments

Hello,

It is not a real Issue but a way to propose modifications. I have made changes on CefSharp in a multiple way :

  • On windows OSR, make a Direct X rendering instead of Bitmap rendering
    • Allow region partial rendering
    • Merge combobox inside rendering (and manage rotation)
  • On windows OSR, take touch natively
    • with this PR : https://bitbucket.org/chromiumembedded/cef/pull-requests/104/touch-processing-for-osr-different-api/diff
  • On windows OSR, enhanced rendering
    • with this PR : https://bitbucket.org/chromiumembedded/cef/pull-requests/96/osr-fix-gpu-cpu-readback-performance/diff

I think the two last points are now temporary work and Cef55 binaries are available on this repository : https://github.com/intuilab/CefSharp/tree/55-Touch-DirectX in Nuget folders. I want to know how to propose the first point. Do you prefer a new "Cef.WPF.DirectX" project and people can chose it ? do you prefer it in the already existing Cef.WPF project ? Another question, do you want an adaptative rendering system (if DirectX is to lame, switch on bitmap rendering) ?

Thanks for you ideas !

alphamax avatar Aug 11 '17 10:08 alphamax

Hello,

First point, you may try on master branch. You should build without problems (reply if not). On master, i move everything on v63:

  • I rebuild cef 63 with Touch pull request.
  • I rebuild the wrapper to expose the touch Api
  • I adapt the C++ & Chromium cef browser to handle it on Wpf component. (i do not handle it on Wpf test app, i was too lazy)

Second point : your error come from a wrong version of the cef wrapper. It is due to a wrong flag on the command line for this specific utilisation. If you checkout and, without any changes, there is this error: blame me. I should fail replacing all wrappers properly in the solution. If you dont want to move to 63, i will fix this issue. What platform are you trying to build ? Debug or Release ?

Thanks

(ps on master, cef v63 have gpu rendering optimisation pull request & cefsharp may be rendered on directX texture)

alphamax avatar May 09 '18 19:05 alphamax

Hello @alphamax , i've tried to compile the master branch but doesn't work. I think that the cef pakages are missing. Or I have to compile the relative cef branch too and repacking for cefsharp ?

Thanks

cristiancarli avatar May 10 '18 09:05 cristiancarli

Hello @cristiancarli

No you do not need anything special. If it does not compile immediately, i need to fix it. Let me have a look (i was on holiday, sorry for the long delay). I'll call you back when it is ok/fixed.

Regards,

alphamax avatar May 12 '18 22:05 alphamax

Hello @cristiancarli

It was totally my fault, i did not deactivate Nuget for the CEF packages. I also did not commit the entire workload of CEF (due to gitignore).

You can now test again. I tryied on a fresh new cloned repo and it succeed.

Feel free to reply if you have any problems.

alphamax avatar May 14 '18 12:05 alphamax

Hi @alphamax , Thank you so much, now it works.

Regards.

cristiancarli avatar May 14 '18 15:05 cristiancarli

Hi @alphamax , I see that there is the new version of cefsharp (65), do you think it is difficult to bring these features into the new version?

cristiancarli avatar Jul 26 '18 13:07 cristiancarli

Hi @cristiancarli ,

At this time we do not choose vif we stay in 63 or move in v65 (we might prefer 65). We will achieve this after holidays with @Intuilab-Daures (early September).

Regards,

alphamax avatar Jul 27 '18 13:07 alphamax

CEF has added support for D3D11 shared textures, closing this, you can track progress of exposing the CEF API at #2527

The changes were only merged into CEF's master build, it will be roughly December/January before they are available in a stable release build.

amaitland avatar Sep 28 '18 01:09 amaitland

HI, we found and issue (crash) of v65 with DirextX render and touch fix 👍 From inside a CefSharp instance, please navigate to: https://www.google.com/doodles

and click onto the language dropdown. You’ll get this error: System.AccessViolationException CopyMemoryGentle DirectXRenderHandler

webcris77 avatar Oct 02 '18 17:10 webcris77

I will have a look as soon as I can :)

alphamax avatar Oct 02 '18 20:10 alphamax

Hi @alphamax I found a problem in a dropdown menu, if i click on the button to open it the menu opens correctly but then im not able to select one option in the menu (using touch input, instead with mouse works correctly)

Best regards!

cristiancarli avatar Dec 11 '18 09:12 cristiancarli

Well thanks for your feedback. I already gave a way to fix it to another person. I just detect when popup is open and handle a touch as a mouse click (through Cef primitives). When I have time, I will fix it properly, but I am 200% busy :/

alphamax avatar Dec 13 '18 19:12 alphamax

Is directx released yet in any version of CefSharp or I need to use alphamax's fork? I have a webgl page and it is chewing up a lot of cpu from all that bitmap copying even though the actual rendering is in GPU.

rukiman avatar Jan 14 '19 23:01 rukiman

Is directx released yet in any version of CefSharp

@rukiman No. For best performance I still recommend using the WinForms version in a WindowsFormsHost. I understand this doesn't suite everyone's requirements, regardless it is currently the best option for performance.

Now #2527 has been resolved someone with experience in DirectX can investigate how the DirectX 11 implementation provided by CEF can be used with WPF (which supports DirectX 9).

amaitland avatar Jan 15 '19 02:01 amaitland

Does anyone have news about select box issue ?

Regards

cristiancarli avatar Jan 15 '19 13:01 cristiancarli

Is directx released yet in any version of CefSharp or I need to use alphamax's fork? I have a webgl page and it is chewing up a lot of cpu from all that bitmap copying even though the actual rendering is in GPU.

I ended up setting the windowless frame rate to 20 and also reducing the dimensions of the webview as much as possible as I am using a transparent background webgl page. This brought down my cpu to acceptable levels. In case anyone wants a work around. I'm using the standard WPF CefSharp version.

rukiman avatar Jan 16 '19 23:01 rukiman

Thanks for the tips !

2019-01-17 0:56 UTC+01:00, rukiman [email protected]:

Is directx released yet in any version of CefSharp or I need to use alphamax's fork? I have a webgl page and it is chewing up a lot of cpu from all that bitmap copying even though the actual rendering is in GPU.

I ended up setting the windowless frame rate to 20 and also reducing the dimensions of the webview as much as possible as I am using a transparent background webgl page. This brought down my cpu to acceptable levels. In case anyone wants a work around.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/cefsharp/CefSharp/issues/2108#issuecomment-454989538

alphamax avatar Jan 16 '19 23:01 alphamax

Well thanks for your feedback. I already gave a way to fix it to another person. I just detect when popup is open and handle a touch as a mouse click (through Cef primitives). When I have time, I will fix it properly, but I am 200% busy :/

Hi sorry to bother you but can you link or quote the solution you gave to this bug so we can try to resolve it ourself ? Best regards.

cristiancarli avatar Jan 17 '19 08:01 cristiancarli

I am sorry, the code I speak about belongs to my client, I can't link it because I don't have the right to give it. I can guide you through the resolution: In the ChromiumWebBrowser class, you can override the Touch events and then, if popup is open, You should be able to send mouse click or move to the browser instead...

Best regards,

Benjamin

alphamax avatar Jan 17 '19 09:01 alphamax

I am sorry, the code I speak about belongs to my client, I can't link it because I don't have the right to give it. I can guide you through the resolution: In the ChromiumWebBrowser class, you can override the Touch events and then, if popup is open, You should be able to send mouse click or move to the browser instead...

Best regards,

Benjamin

Hi, thanks for the tip, we manage to resolve the bug. Another question I have seen that in v65 there is no directx render, is that for technical reasons? Do you think it is possible to adapt the v63 directx stuff in v65 ?

Best regards Cristian

cristiancarli avatar Jan 18 '19 14:01 cristiancarli