Commit 6675c4a5 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix warning about QOffscreenSurface thread

BUG: 374095
parent 107adf6c
...@@ -109,6 +109,7 @@ GLWidget::GLWidget(int id, QObject *parent) ...@@ -109,6 +109,7 @@ GLWidget::GLWidget(int id, QObject *parent)
mlt_properties_set_data(mlt_global_properties(), "glslManager", NULL, 0, NULL, NULL); mlt_properties_set_data(mlt_global_properties(), "glslManager", NULL, 0, NULL, NULL);
emit gpuNotSupported(); emit gpuNotSupported();
} }
connect(this, SIGNAL(sceneGraphInitialized()), SLOT(createOffscreen()));
connect(this, SIGNAL(sceneGraphInitialized()), SLOT(initializeGL()), Qt::DirectConnection); connect(this, SIGNAL(sceneGraphInitialized()), SLOT(initializeGL()), Qt::DirectConnection);
connect(this, SIGNAL(beforeRendering()), SLOT(paintGL()), Qt::DirectConnection); connect(this, SIGNAL(beforeRendering()), SLOT(paintGL()), Qt::DirectConnection);
} }
...@@ -142,14 +143,17 @@ void GLWidget::updateAudioForAnalysis() ...@@ -142,14 +143,17 @@ void GLWidget::updateAudioForAnalysis()
m_frameRenderer->sendAudioForAnalysis = KdenliveSettings::monitor_audio(); m_frameRenderer->sendAudioForAnalysis = KdenliveSettings::monitor_audio();
} }
void GLWidget::initializeGL() void GLWidget::createOffscreen()
{ {
if (m_isInitialized || !isVisible() || !openglContext()) return;
if (!m_offscreenSurface.isValid()) { if (!m_offscreenSurface.isValid()) {
m_offscreenSurface.setFormat(openglContext()->format()); m_offscreenSurface.setFormat(openglContext()->format());
m_offscreenSurface.create(); m_offscreenSurface.create();
openglContext()->makeCurrent(this);
} }
}
void GLWidget::initializeGL()
{
if (m_isInitialized || !isVisible() || !openglContext()) return;
initializeOpenGLFunctions(); initializeOpenGLFunctions();
qDebug() << "OpenGL vendor: " << QString::fromUtf8((const char*) glGetString(GL_VENDOR)); qDebug() << "OpenGL vendor: " << QString::fromUtf8((const char*) glGetString(GL_VENDOR));
qDebug() << "OpenGL renderer: " << QString::fromUtf8((const char*) glGetString(GL_RENDERER)); qDebug() << "OpenGL renderer: " << QString::fromUtf8((const char*) glGetString(GL_RENDERER));
......
...@@ -182,6 +182,7 @@ private slots: ...@@ -182,6 +182,7 @@ private slots:
void updateTexture(GLuint yName, GLuint uName, GLuint vName); void updateTexture(GLuint yName, GLuint uName, GLuint vName);
void paintGL(); void paintGL();
void onFrameDisplayed(const SharedFrame &frame); void onFrameDisplayed(const SharedFrame &frame);
void createOffscreen();
protected: protected:
void resizeEvent(QResizeEvent* event); void resizeEvent(QResizeEvent* event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment