[webkit-qt] WebGL rendering offscreen

Jorge Fernandez Monteagudo jorgefm at cirsa.com
Tue Nov 11 07:07:40 PST 2014

>> QGLFramebufferObject *mp_fbo;
>> QWebPage *mp_Page;
>> QPainter m_Painter;
>> void TGSWebNavigator::onRepaintRequested(const QRect& _rect)
>> {
>>         ...
>>         // Paint the view in the FBO.
>>         m_Painter.begin( mp_fbo );
>>         mp_Page->mainFrame()->render( &m_Painter, _rect );
>>         m_Painter.end();
>>         // Repaint QGLWidget with the new FBO.
>> }
>> If I try to do the same with an URL pointing to a WebGL I get OpenGL
>> errors. The problem I think is related to OpenGL contexts because the
>> OpenGL widget has his own context and the WebGL rendering is done is
>> another one. In a static html page no new context is created when
>> rendering is done. I've set several traces to show the current context:
>Why are you not using a QGraphicsWebView with a QGLWidget viewport? I would
>recommend that over trying to use the print-preview API in a way that it
>wasn't meant to be used.

Hi Allan! Thank you for answering.

I'm open to use the correct way to do it. My only need is to be able to render the given
page in my opengl context. The typical example rendering a WebGL in the faces of
a cube in OpenGL will be great! Is there any demo like this? :)

Or, at least, where can I find an example using QGraphicsWebView with a QGLWidget viewport?

Best regards,

Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o CONFIDENCIAL. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.

This message is intended exclusively for its addressee and may contain information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.

More information about the webkit-qt mailing list