Chromium嵌入式框架:我可以使用DirectX渲染到画布中吗? [英] Chromium Embedded Framework: Can I render into a canvas using DirectX?
问题描述
我想将CEF嵌入我的DirectX应用程序中。现在,我想使用DirectX在显示的html页面上绘制Canvas元素。该画布可能会被其上方的其他html元素遮挡,因此我不能仅使用Canvas的绝对坐标并在其上进行渲染,因为那样一来,它也将渲染到画布上的元素上。
i want to embed CEF into my DirectX application. Now I want to draw onto a Canvas element in the displayed html page using DirectX. This canvas may be obscured by other html elements above it so I cannot just take the absolute Canvas coordinates and render on it because then it would also render onto the elements on my canvas.
我看到两种解决方案:
- 我可以让CEF在页面中显示纹理,因此CEF使用字节缓冲区作为图像并经常更新该区域。
- 我可以获取Canvas元素所在的屏幕区域,并且可以实际看到它。
我无法确定在文档或示例应用程序中是否有这两种可能性。
I could not find out if any of those two possibilities is possible in the docs or the sample application.
所以我的问题是是:使用CEF是否可以实现?
So my question is: Is this possible to achieve with CEF? And if yes how.
推荐答案
您正在寻找的CEF功能名为屏幕外渲染,今年将被重命名为无窗口渲染。
The CEF feature what you are looking for named "off-screen rendering" and in this year it is renamed to "windowless rendering".
目前真正可用的东西(在1916年稳定的分支中)-它是由纯软件渲染器渲染到像素缓冲区的。之后,您可以将像素缓冲区移到表面。请注意,软件渲染器不支持纯GPU加速内容。即诸如3D CSS转换之类的内容和某些动画将不起作用。
What are really available just now (in stable 1916 branch) - it is rendering to pixel buffer by software-only renderer. After this you can move your's pixel buffer to surface. Note that software renderer did not support gpu-only accelerated content. I.e. something like 3D CSS transforms and some animations will not work. But in general it is works fine.
您可以通过运行 cefclient --off-screen-rendering-enabled $ c来测试此模式。 $ c>。
在CEF干线分支2042中-切换到新的呈现代码路径。然后,一旦发出 https://code.google.com/p/chromiumembedded/ issue / detail?id = 1006 将得到解决-您可以直接渲染到表面。
In CEF trunk branch 2042 - it is switched to new rendering codepath. And once issue https://code.google.com/p/chromiumembedded/issues/detail?id=1006 will be resolved - you can able to render directly into surface.
希望这会有所帮助。
这篇关于Chromium嵌入式框架:我可以使用DirectX渲染到画布中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!