summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2016-02-24 00:44:58 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-29 09:41:17 +0000
commit334288af53e15f4b16f520a48e84e84c6980b8c7 (patch)
treeff281ab3bc0ded1e69503719a118b59bc2cadea8 /vcl/inc
parent0f571cf2781d98a1897952aa53329ebb3716dc19 (diff)
opengl: shader based polyline rendering - fixes tdf#97137 for OGL
Adds native opengl polyline rendering to draw polylines, line joins and line caps as triangle strips. The vertex shader allows for the dynamic line width by calculating the correct vertex posiitons, and the fragment shader is used for anti-aliasing. (cherry picked from commit d18ad8a7fb3257001a5045e11f3f770a48a7fa69) Change-Id: If7982c828cae1fae59c57194c8ac77e5ad7f1d26 Reviewed-on: https://gerrit.libreoffice.org/22706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/opengl/program.hxx4
-rw-r--r--vcl/inc/openglgdiimpl.hxx4
2 files changed, 7 insertions, 1 deletions
diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx
index 5de3c1bdbe5f..780cba72380f 100644
--- a/vcl/inc/opengl/program.hxx
+++ b/vcl/inc/opengl/program.hxx
@@ -37,6 +37,7 @@ private:
GLuint mnTexCoordAttrib;
GLuint mnAlphaCoordAttrib;
GLuint mnMaskCoordAttrib;
+ GLuint mnNormalAttrib;
TextureList maTextures;
bool mbBlending;
@@ -59,6 +60,7 @@ public:
void SetTextureCoord( const GLvoid* pData );
void SetAlphaCoord( const GLvoid* pData );
void SetMaskCoord(const GLvoid* pData);
+ void SetExtrusionVectors(const GLvoid* pData);
void SetUniform1f( const OString& rName, GLfloat v1 );
void SetUniform2f( const OString& rName, GLfloat v1, GLfloat v2 );
@@ -80,7 +82,7 @@ public:
bool DrawTexture( const OpenGLTexture& rTexture );
protected:
- void SetVertexAttrib( GLuint& rAttrib, const OString& rName, const GLvoid* pData );
+ void SetVertexAttrib( GLuint& rAttrib, const OString& rName, const GLvoid* pData, GLint nSize = 2 );
GLuint GetUniformLocation( const OString& rName );
};
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index a178d18f756e..ca8232ae2c45 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -113,6 +113,7 @@ public:
bool UseSolid( SalColor nColor );
bool UseSolidAA( SalColor nColor, double fTransparency );
bool UseSolidAA( SalColor nColor );
+ bool UseLine(SalColor nColor, double fTransparency, GLfloat fLineWidth, bool bUseAA);
bool UseInvert50();
bool UseInvert(SalInvert nFlags);
@@ -127,6 +128,9 @@ public:
void DrawRect( long nX, long nY, long nWidth, long nHeight );
void DrawRect( const Rectangle& rRect );
void DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry );
+ void DrawLineSegment(float x1, float y1, float x2, float y2);
+ void DrawLineCap(float x1, float y1, float x2, float y2, css::drawing::LineCap eLineCap, float fLineWidth);
+ void DrawPolyLine( const basegfx::B2DPolygon& rPolygon, float fLineWidth, basegfx::B2DLineJoin eLineJoin, css::drawing::LineCap eLineCap);
void DrawPolyPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, bool blockAA = false );
void DrawRegionBand( const RegionBand& rRegion );
void DrawTextureRect( OpenGLTexture& rTexture, const SalTwoRect& rPosAry, bool bInverted = false );