I want to use QWebEngine to render an animated webpage offscreen (with transparency). And I want to do it fast (e.g. 60 fps, which imposes ~16 ms maximum time per render).
This other SO question Is it possible to render QWebEnginePage/QWebEngineView offscreen? gives some hints:
- get a
QWebEngineView
withQt::WA_DontShowOnScreen
attribute - get a
QPainter
on aQImage
(withQImage::Format_ARGB32
) - call
QWidget::render()
on the saidQWebEngineView
instance
This works! But it's quite slow when the transparency (QImage::Format_ARGB32
) is needed. By slow I mean >50-60 milliseconds per render on my machine (which is an equvalent of <20fps).
The question is: is there a faster, Qt-based alternative to rendering a webpage offscreen (to memory)?