Version 11 (modified by 14 years ago) ( diff ) | ,
---|
Overview
WebGL can be enabled by setting QWebSettings::WebGLEnabled
in your application. In addition, QWebSettings::AcceleratedCompositingEnabled
needs to be enabled. For performance reasons, at the moment WebGL is scoped to work only together with accelerated compositing. For the best performance, you should use QGraphicsWebView
with QGLWidget
viewport. With this configuration QtWebKit is able to texture map the WebGL canvas directly. Otherwise, it has to do expensive memory copying into canvas image buffer for each frame.
In order to compile the WebGL support, use the following command-line:
Tools/Scripts/build-webkit --qt --3d-canvas
For QtTestBrowser, use command-line options -graphicsbased -gl-viewport -webgl
to enable WebGL.
Things left to do
- [Qt] When we render WebGL offscreen, color conversion cost a lot of CPU cycles
- https://bugs.webkit.org/show_bug.cgi?id=40884
- This is important optimization for render-to-image and printing use cases.
- Create autotest suite Source/WebKit/qt/tests
- Test implementation on Symbian and fix possible defects.
Autotests for WebGL
At least these tests cases are needed:
- Render to QImage
- Printing page with WebGL content