diff options
author | Wouter Huysentruit <wouter.huysentruit@dzine.be> | 2013-01-12 13:52:32 +0100 |
---|---|---|
committer | Thomas McGuire <thomas.mcguire@kdab.com> | 2013-01-14 09:05:31 +0100 |
commit | 5ea6ebf4fbe909724a587d32f199c8b34d21ac60 (patch) | |
tree | cecf3e4503ad8442bedb8ba32c26f24d71f8a9ce | |
parent | ed9b5462a5b5f224a0c80e619d4cc36fd5267670 (diff) |
Fix: Only flip video once for BottomToTop scanline directions
Top & bottom of the texture coordinates are already flipped
for BottomToTop scanline directions. So there is no need to
flip top & bottom of the vertex coordinates too.
This is a backport of change I221b94afb65c194bdedb787414e6a436b8095fb2
from the qt/qtmultimedia project
Change-Id: I11f85299a381708647d06d483c9aa780e167a82f
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@gmail.com>
-rw-r--r-- | src/multimedia/qpaintervideosurface.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/multimedia/qpaintervideosurface.cpp b/src/multimedia/qpaintervideosurface.cpp index da67730e26..4b077debe7 100644 --- a/src/multimedia/qpaintervideosurface.cpp +++ b/src/multimedia/qpaintervideosurface.cpp @@ -859,19 +859,12 @@ QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint( txRight, txTop }; - const GLfloat vTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? target.top() - : target.bottom() + 1; - const GLfloat vBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? target.bottom() + 1 - : target.top(); - const GLfloat v_array[] = { - GLfloat(target.left()) , GLfloat(vBottom), - GLfloat(target.right() + 1), GLfloat(vBottom), - GLfloat(target.left()) , GLfloat(vTop), - GLfloat(target.right() + 1), GLfloat(vTop) + GLfloat(target.left()) , GLfloat(target.bottom() + 1), + GLfloat(target.right() + 1), GLfloat(target.bottom() + 1), + GLfloat(target.left()) , GLfloat(target.top()), + GLfloat(target.right() + 1), GLfloat(target.top()) }; glEnable(GL_FRAGMENT_PROGRAM_ARB); @@ -1226,20 +1219,12 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint( } }; - const GLfloat vTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? target.top() - : target.bottom() + 1; - const GLfloat vBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? target.bottom() + 1 - : target.top(); - - const GLfloat vertexCoordArray[] = { - GLfloat(target.left()) , GLfloat(vBottom), - GLfloat(target.right() + 1), GLfloat(vBottom), - GLfloat(target.left()) , GLfloat(vTop), - GLfloat(target.right() + 1), GLfloat(vTop) + GLfloat(target.left()) , GLfloat(target.bottom() + 1), + GLfloat(target.right() + 1), GLfloat(target.bottom() + 1), + GLfloat(target.left()) , GLfloat(target.top()), + GLfloat(target.right() + 1), GLfloat(target.top()) }; const GLfloat txLeft = source.left() / m_frameSize.width(); |