[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/opengl
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Wed Jul 8 08:37:00 PDT 2015
vcl/opengl/gdiimpl.cxx | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
New commits:
commit e1ab783539b495e12fc769ac493db3f5cebec106
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Tue Jun 30 18:07:41 2015 +0900
opengl: draw rectangle lines with only one glDrawArrays call
Change-Id: I33e065fe6c084d0bed04ee99c447004fe573278a
Reviewed-on: https://gerrit.libreoffice.org/16859
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 2526cde..f56dd4a 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1195,13 +1195,24 @@ void OpenGLSalGraphicsImpl::drawRect( long nX, long nY, long nWidth, long nHeigh
if( UseSolid( mnLineColor ) )
{
- const long nX1( nX );
- const long nY1( nY );
- const long nX2( nX + nWidth );
- const long nY2( nY + nHeight );
- const SalPoint aPoints[] = { { nX1, nY1 }, { nX2, nY1 },
- { nX2, nY2 }, { nX1, nY2 } };
- DrawLines( 4, aPoints, true ); // No need for AA.
+ GLfloat fX1 = OPENGL_COORD_X(nX);
+ GLfloat fY1 = OPENGL_COORD_Y(nY);
+ GLfloat fX2 = OPENGL_COORD_X(nX + nWidth);
+ GLfloat fY2 = OPENGL_COORD_Y(nY + nHeight);
+
+ GLfloat pPoints[16];
+
+ pPoints[0] = fX1;
+ pPoints[1] = fY1;
+ pPoints[2] = fX2;
+ pPoints[3] = fY1;
+ pPoints[4] = fX2;
+ pPoints[5] = fY2;
+ pPoints[6] = fX1;
+ pPoints[7] = fY2;
+
+ mpProgram->SetVertices(pPoints);
+ glDrawArrays(GL_LINE_LOOP, 0, 4);
}
PostDraw();
More information about the Libreoffice-commits
mailing list