summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/multimedia/base/qgraphicsvideoitem.cpp6
-rw-r--r--src/multimedia/base/qpaintervideosurface.cpp6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/multimedia/base/qgraphicsvideoitem.cpp b/src/multimedia/base/qgraphicsvideoitem.cpp
index 8aba269..85369db 100644
--- a/src/multimedia/base/qgraphicsvideoitem.cpp
+++ b/src/multimedia/base/qgraphicsvideoitem.cpp
@@ -47,7 +47,7 @@
#include <QtMultimedia/qvideooutputcontrol.h>
#include <QtMultimedia/qvideorenderercontrol.h>
#include <QtMultimedia/qvideosurfaceformat.h>
-
+#include <QtOpenGL/qgl.h>
QT_BEGIN_NAMESPACE
@@ -384,9 +384,6 @@ void QGraphicsVideoItem::paint(
if (d->surface && d->surface->isActive()) {
d->surface->paint(painter, d->boundingRect, d->sourceRect);
d->surface->setReady(true);
-#ifndef QGRAPHICSVIDEOITEM_SHADERS // Flickers
- }
-#else
} else if (d->updatePaintDevice && (painter->paintEngine()->type() == QPaintEngine::OpenGL
|| painter->paintEngine()->type() == QPaintEngine::OpenGL2)) {
d->updatePaintDevice = false;
@@ -398,7 +395,6 @@ void QGraphicsVideoItem::paint(
d->surface->setShaderType(QPainterVideoSurface::FragmentProgramShader);
}
}
-#endif
}
/*!
diff --git a/src/multimedia/base/qpaintervideosurface.cpp b/src/multimedia/base/qpaintervideosurface.cpp
index f451809..f7ffb02 100644
--- a/src/multimedia/base/qpaintervideosurface.cpp
+++ b/src/multimedia/base/qpaintervideosurface.cpp
@@ -982,6 +982,9 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint(
if (m_frame.isValid()) {
painter->beginNativePainting();
+ glEnable(GL_STENCIL_TEST);
+ glEnable(GL_SCISSOR_TEST);
+
const int width = QGLContext::currentContext()->device()->width();
const int height = QGLContext::currentContext()->device()->height();
@@ -1072,6 +1075,9 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint(
m_program.release();
+
+ glDisable(GL_SCISSOR_TEST);
+ glDisable(GL_STENCIL_TEST);
painter->endNativePainting();
}
return QAbstractVideoSurface::NoError;