summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-12-12 10:40:18 +0100
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-12-12 12:05:16 +0000
commit5f3c14d765783c275118e18f7ec47d02a7794f8f (patch)
treee39daa2556c35bbb6acbdad89632a6c187dc92e7
parent10304528c20fb9a385c617a38b6be35d1b18598a (diff)
downloadqtmultimedia-5f3c14d765783c275118e18f7ec47d02a7794f8f.tar.gz
Fix rendering issue with QGraphicsView and QOpenGLWidget viewport
Since QOpenGLWidget always renders offscreen (uses QOffscreenSurface) the surface size is always (1, 1). Task-number: QTBUG-53099 Change-Id: I3803efba57e04c676eda85f0e29efa34f8d8d5e5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/multimediawidgets/qpaintervideosurface.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp
index 6e93e150d..0147690e1 100644
--- a/src/multimediawidgets/qpaintervideosurface.cpp
+++ b/src/multimediawidgets/qpaintervideosurface.cpp
@@ -1254,8 +1254,8 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint(
if (scissorTestEnabled)
glEnable(GL_SCISSOR_TEST);
- const int width = QOpenGLContext::currentContext()->surface()->size().width();
- const int height = QOpenGLContext::currentContext()->surface()->size().height();
+ const int width = painter->viewport().width();
+ const int height = painter->viewport().height();
const QTransform transform = painter->deviceTransform();