Kaydet (Commit) 930b3017 authored tarafından Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Kaydeden (comit) Markus Mohrhard

vcl: Some fixes to the OpenGL impl

Change-Id: I58466142e0a47beb892e10113c1bc34d5ac3abcd
üst 8bb1fb8c
...@@ -65,7 +65,7 @@ private: ...@@ -65,7 +65,7 @@ private:
void DrawLine( long nX1, long nY1, long nX2, long nY2 ); void DrawLine( long nX1, long nY1, long nX2, long nY2 );
void DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bClose ); void DrawLines( sal_uInt32 nPoints, const SalPoint* pPtAry, bool bClose );
void DrawConvexPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); void DrawConvexPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry );
void DrawRect( long nX, long nY, long nWidth, nHeight ); void DrawRect( long nX, long nY, long nWidth, long nHeight );
void DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ); void DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry );
void DrawPolyPolygon( const basegfx::B2DPolyPolygon& pPolyPolygon ); void DrawPolyPolygon( const basegfx::B2DPolyPolygon& pPolyPolygon );
void DrawTextureRect( const SalTwoRect& pPosAry ); void DrawTextureRect( const SalTwoRect& pPosAry );
......
...@@ -86,7 +86,6 @@ void OpenGLSalGraphicsImpl::ResetClipRegion() ...@@ -86,7 +86,6 @@ void OpenGLSalGraphicsImpl::ResetClipRegion()
} }
// set the line color to transparent (= don't draw lines) // set the line color to transparent (= don't draw lines)
void OpenGLSalGraphicsImpl::SetLineColor() void OpenGLSalGraphicsImpl::SetLineColor()
{ {
if( mnLineColor != SALCOLOR_NONE ) if( mnLineColor != SALCOLOR_NONE )
...@@ -151,9 +150,7 @@ bool OpenGLSalGraphicsImpl::CreateSolidProgram( void ) ...@@ -151,9 +150,7 @@ bool OpenGLSalGraphicsImpl::CreateSolidProgram( void )
bool OpenGLSalGraphicsImpl::CreateTextureProgram( void ) bool OpenGLSalGraphicsImpl::CreateTextureProgram( void )
{ {
static const char aFragShaderSrc[] = mnTextureProgram = OpenGLHelper::LoadShaders( "textureVertexShader", "textureFragmentShader" );
mnTextureProgram = OpenGLHelper::( "textureVertexShader", "textureFragmentShader" );
if( mnTextureProgram == 0 ) if( mnTextureProgram == 0 )
return false; return false;
...@@ -358,7 +355,7 @@ void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& pPol ...@@ -358,7 +355,7 @@ void OpenGLSalGraphicsImpl::DrawPolyPolygon( const basegfx::B2DPolyPolygon& pPol
} }
glEnableVertexAttribArray( GL_ATTRIB_POS ); glEnableVertexAttribArray( GL_ATTRIB_POS );
glVertexAttribPointer( GL_ATTRIB_POS, pVertices.size(), GL_UNSIGNED_SHORT, GL_FALSE, 0, pVertices.size() ); glVertexAttribPointer( GL_ATTRIB_POS, pVertices.size(), GL_UNSIGNED_SHORT, GL_FALSE, 0, pVertices.data() );
glDrawArrays( GL_TRIANGLES, 0, pVertices.size() / 2 ); glDrawArrays( GL_TRIANGLES, 0, pVertices.size() / 2 );
glDisableVertexAttribArray( GL_ATTRIB_POS ); glDisableVertexAttribArray( GL_ATTRIB_POS );
} }
...@@ -611,7 +608,7 @@ void OpenGLSalGraphicsImpl::copyArea( ...@@ -611,7 +608,7 @@ void OpenGLSalGraphicsImpl::copyArea(
// CopyBits and DrawBitmap --> RasterOp and ClipRegion // CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
void OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) void OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* /*pSrcGraphics*/ )
{ {
// TODO Check if SalGraphicsImpl is the same // TODO Check if SalGraphicsImpl is the same
const bool bSameGraphics( false ); const bool bSameGraphics( false );
...@@ -720,7 +717,7 @@ void OpenGLSalGraphicsImpl::invert( ...@@ -720,7 +717,7 @@ void OpenGLSalGraphicsImpl::invert(
else // just invert else // just invert
{ {
BeginInvert(); BeginInvert();
DrawPolygon( 4, aPoints ); DrawRect( nX, nY, nWidth, nHeight );
EndInvert(); EndInvert();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment