diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-31 03:41:07 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-31 03:41:07 (GMT) |
commit | edd41ee5488716cf8336a7d8ea0cb3d48d0e7b14 (patch) | |
tree | b9ff68dfb584cf03604e29081c130793200ac812 | |
parent | 1b7c80fb09e962c7a05249d4b2779b84701ed326 (diff) | |
parent | ffb3275775874a94a6882d5098ac963ad54c9bec (diff) | |
download | Qt-edd41ee5488716cf8336a7d8ea0cb3d48d0e7b14.zip Qt-edd41ee5488716cf8336a7d8ea0cb3d48d0e7b14.tar.gz Qt-edd41ee5488716cf8336a7d8ea0cb3d48d0e7b14.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
Fixed incorrectly clipped video when rendered on QGLWidget
-rw-r--r-- | src/multimedia/base/qpaintervideosurface.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/multimedia/base/qpaintervideosurface.cpp b/src/multimedia/base/qpaintervideosurface.cpp index b8028d8f..2fe941b 100644 --- a/src/multimedia/base/qpaintervideosurface.cpp +++ b/src/multimedia/base/qpaintervideosurface.cpp @@ -737,10 +737,15 @@ QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint( const QRectF &target, QPainter *painter, const QRectF &source) { if (m_frame.isValid()) { + bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); + bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); + painter->beginNativePainting(); - glEnable(GL_STENCIL_TEST); - glEnable(GL_SCISSOR_TEST); + if (stencilTestEnabled) + glEnable(GL_STENCIL_TEST); + if (scissorTestEnabled) + glEnable(GL_SCISSOR_TEST); const float txLeft = source.left() / m_frameSize.width(); const float txRight = source.right() / m_frameSize.width(); @@ -815,9 +820,6 @@ QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint( glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_FRAGMENT_PROGRAM_ARB); - glDisable(GL_STENCIL_TEST); - glDisable(GL_SCISSOR_TEST); - painter->endNativePainting(); } return QAbstractVideoSurface::NoError; @@ -1063,10 +1065,15 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint( const QRectF &target, QPainter *painter, const QRectF &source) { if (m_frame.isValid()) { + bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); + bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); + painter->beginNativePainting(); - glEnable(GL_STENCIL_TEST); - glEnable(GL_SCISSOR_TEST); + if (stencilTestEnabled) + glEnable(GL_STENCIL_TEST); + if (scissorTestEnabled) + glEnable(GL_SCISSOR_TEST); const int width = QGLContext::currentContext()->device()->width(); const int height = QGLContext::currentContext()->device()->height(); @@ -1158,9 +1165,6 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint( m_program.release(); - - glDisable(GL_SCISSOR_TEST); - glDisable(GL_STENCIL_TEST); painter->endNativePainting(); } return QAbstractVideoSurface::NoError; |