diff options
author | Wouter Huysentruit <wouter.huysentruit@dzine.be> | 2013-01-11 11:20:06 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-14 09:05:15 +0100 |
commit | 9a9293df5a439c4b8e0826c9497948fdf0a05bcf (patch) | |
tree | 13bddcd96f24302c5c7b59830b36a4491cec2b7b /src/multimediawidgets/qpaintervideosurface.cpp | |
parent | 4760e1fb02aac87e4186fb1bedf0ba4a3845d7be (diff) | |
download | qtmultimedia-9a9293df5a439c4b8e0826c9497948fdf0a05bcf.tar.gz |
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.
Change-Id: I221b94afb65c194bdedb787414e6a436b8095fb2
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@gmail.com>
Diffstat (limited to 'src/multimediawidgets/qpaintervideosurface.cpp')
-rw-r--r-- | src/multimediawidgets/qpaintervideosurface.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp index d7f8a3686..c678c230f 100644 --- a/src/multimediawidgets/qpaintervideosurface.cpp +++ b/src/multimediawidgets/qpaintervideosurface.cpp @@ -864,19 +864,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); @@ -1231,20 +1224,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(); |