diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2016-05-12 13:37:11 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-05-19 02:47:57 +0000 |
commit | e480b2cf3e362760de8e35cbb950104e47ebe7ec (patch) | |
tree | 0d6cff1c68d392466104bcd48f056e8c300d26d6 /vcl/inc/opengl/program.hxx | |
parent | bd3ed061de068a03a7c75f093c9a9bd7b6f3ba57 (diff) |
opengl: track the state of blend, DrawArrays on OpenGLProgram
This adds tracking of GL_BLEND and glBlendFunc which are usually
set when setting up the current draw call on OpenGLProgram with
SetBlendFunc method.
Until now the final draw call (glDrawArrays) was called outside
of OpenGLProgram. This is a problem because we need to know if
we did call SetBlendFunc or not between when we used or reused
the current program. So we added DrawArrays to OpenGLProgram and
refactored all draw calls in OpenGLSalGraphicsImpl to use this.
From now on glDrawArrays should not be called directly but always
through OpenGLProgram.
Change-Id: I530b4b948af8a962669a3751e1a95ff3986ffec9
Reviewed-on: https://gerrit.libreoffice.org/25083
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/inc/opengl/program.hxx')
-rw-r--r-- | vcl/inc/opengl/program.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx index 780cba72380f..5944c72be127 100644 --- a/vcl/inc/opengl/program.hxx +++ b/vcl/inc/opengl/program.hxx @@ -51,9 +51,12 @@ public: OpenGLProgram(); ~OpenGLProgram(); + GLuint Id() { return mnId; } + bool Load( const OUString& rVertexShader, const OUString& rFragmentShader, const rtl::OString& preamble = "", const rtl::OString& rDigest = "" ); bool Use(); + void Reuse(); bool Clean(); void SetVertices( const GLvoid* pData ); @@ -81,6 +84,8 @@ public: bool DrawTexture( const OpenGLTexture& rTexture ); + void DrawArrays(GLenum GLenum, std::vector<GLfloat>& aVertices); + protected: void SetVertexAttrib( GLuint& rAttrib, const OString& rName, const GLvoid* pData, GLint nSize = 2 ); GLuint GetUniformLocation( const OString& rName ); |