Answer the question
In order to leave comments, you need to log in
How to improve rendering performance on canvas?
Hello.
Qt has a rendering technique that inherits the QGlWidget (QOpenGlWidget) class as the base class for the canvas (widget). I understand correctly that in this case OpenGL is used for rendering, which is supposedly faster than some other way (but what is used according to the standard?).
Can a similar technique be applied to QWebKit (QWebView) to speed up the Canvas Web API?
By the way, what native tool is used for rendering in the web canvas?
PS Here in the comments I found a similar question, but did not understand the answer to it. Although I may not understand the question.
Answer the question
In order to leave comments, you need to log in
According to the documentation , QT always uses something derived from QPainter as its renderer.
QOpenGLPaintDevice is a renderer that uses OpenGL hardware acceleration.
If you set it as a renderer when starting the application, the entire GUI, including WebView, will be drawn through it.
Armenian Radio : I checked this code:
#include <QApplication>
#include <QWidget>
#include <QOpenGLPaintDevice>
#include <QDebug>
int main(int argv, char **args)
{
QApplication app(argv, args);
QWidget window;
QPaintDevice* pd = nullptr;
QOpenGLPaintDevice* pgld = nullptr;
pd = dynamic_cast<QPaintDevice*>(&window);
pgld = dynamic_cast<QOpenGLPaintDevice*>(&window);
window.resize(250, 150);
window.show();
qDebug() << pd; //0x7fffd5b2bb30
qDebug() << pgld; //0x0
return app.exec();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question