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>
This commit is contained in:
Wouter Huysentruit
2013-01-11 11:20:06 +01:00
committed by The Qt Project
parent 4760e1fb02
commit 9a9293df5a

View File

@@ -864,19 +864,12 @@ QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint(
txRight, txTop 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[] = const GLfloat v_array[] =
{ {
GLfloat(target.left()) , GLfloat(vBottom), GLfloat(target.left()) , GLfloat(target.bottom() + 1),
GLfloat(target.right() + 1), GLfloat(vBottom), GLfloat(target.right() + 1), GLfloat(target.bottom() + 1),
GLfloat(target.left()) , GLfloat(vTop), GLfloat(target.left()) , GLfloat(target.top()),
GLfloat(target.right() + 1), GLfloat(vTop) GLfloat(target.right() + 1), GLfloat(target.top())
}; };
glEnable(GL_FRAGMENT_PROGRAM_ARB); 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[] = const GLfloat vertexCoordArray[] =
{ {
GLfloat(target.left()) , GLfloat(vBottom), GLfloat(target.left()) , GLfloat(target.bottom() + 1),
GLfloat(target.right() + 1), GLfloat(vBottom), GLfloat(target.right() + 1), GLfloat(target.bottom() + 1),
GLfloat(target.left()) , GLfloat(vTop), GLfloat(target.left()) , GLfloat(target.top()),
GLfloat(target.right() + 1), GLfloat(vTop) GLfloat(target.right() + 1), GLfloat(target.top())
}; };
const GLfloat txLeft = source.left() / m_frameSize.width(); const GLfloat txLeft = source.left() / m_frameSize.width();