diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-08 23:00:16 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-11-10 07:59:48 +0100 |
commit | fe3b9a813c53d71ed5ac98419e0f450176fd99b6 (patch) | |
tree | e22ae1c0d2a0b2cda22d2680c63589b0664d7bc3 | |
parent | 4c42104fadecd34e138d40d8b3b864c3bbf7c6aa (diff) |
vcl: Fix some viewport issues when rendering with OpenGL
Change-Id: I99a76baeac07c1d9ec44ed492caa1d3416eb43ac
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index a9a68840a299..74f725249025 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -498,6 +498,7 @@ void OpenGLSalGraphicsImpl::drawPixel( long nX, long nY ) if( mnLineColor != SALCOLOR_NONE ) { maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); BeginSolid( mnLineColor ); DrawPoint( nX, nY ); EndSolid(); @@ -510,6 +511,7 @@ void OpenGLSalGraphicsImpl::drawPixel( long nX, long nY, SalColor nSalColor ) if( nSalColor != SALCOLOR_NONE ) { maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); BeginSolid( nSalColor ); DrawPoint( nX, nY ); EndSolid(); @@ -522,6 +524,7 @@ void OpenGLSalGraphicsImpl::drawLine( long nX1, long nY1, long nX2, long nY2 ) if( mnLineColor != SALCOLOR_NONE ) { maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); BeginSolid( mnLineColor ); DrawLine( nX1, nY1, nX2, nY2 ); EndSolid(); @@ -560,6 +563,7 @@ void OpenGLSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pP { SAL_INFO( "vcl.opengl", "::drawPolyLine" ); maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); if( mnLineColor != SALCOLOR_NONE && nPoints > 1 ) { @@ -587,6 +591,7 @@ void OpenGLSalGraphicsImpl::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPt } maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); if( mnFillColor != SALCOLOR_NONE ) { @@ -610,6 +615,7 @@ void OpenGLSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* return; maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); if( mnFillColor != SALCOLOR_NONE ) { @@ -767,6 +773,7 @@ void OpenGLSalGraphicsImpl::drawMask( SAL_INFO( "vcl.opengl", "::drawMask" ); maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); DrawMask( nTexture, nMaskColor, rPosAry ); } @@ -788,6 +795,7 @@ SalColor OpenGLSalGraphicsImpl::getPixel( long nX, long nY ) char pixel[3]; maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); glReadPixels( nX, nY, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel); return MAKE_SALCOLOR( pixel[0], pixel[1], pixel[2] ); } @@ -803,6 +811,7 @@ void OpenGLSalGraphicsImpl::invert( // * SAL_INVERT_TRACKFRAME (dash-line rectangle?) maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); if( nFlags & SAL_INVERT_TRACKFRAME ) { @@ -823,6 +832,7 @@ void OpenGLSalGraphicsImpl::invert( void OpenGLSalGraphicsImpl::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) { maContext.makeCurrent(); + glViewport( 0, 0, GetWidth(), GetHeight() ); if( nFlags & SAL_INVERT_TRACKFRAME ) { |