summaryrefslogtreecommitdiff
path: root/vcl/inc/opengl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-05-29 15:36:39 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-06-08 11:39:22 +0900
commit2003076c4318511a3d621558d3b44b4e8e6c6529 (patch)
treeecc2742bb911d2960ecd96f320a802ff8d43816f /vcl/inc/opengl
parent344dc6939c45552dc162ea8b3f892e2ae4998d64 (diff)
opengl: batch draw polypolygons
Change-Id: Ie9c41f95815a57c3a9e68ce7b7b0c1e09291988b
Diffstat (limited to 'vcl/inc/opengl')
-rw-r--r--vcl/inc/opengl/RenderList.hxx3
-rw-r--r--vcl/inc/opengl/VertexUtils.hxx14
2 files changed, 17 insertions, 0 deletions
diff --git a/vcl/inc/opengl/RenderList.hxx b/vcl/inc/opengl/RenderList.hxx
index 0ba977a232a9..d533ad4af114 100644
--- a/vcl/inc/opengl/RenderList.hxx
+++ b/vcl/inc/opengl/RenderList.hxx
@@ -91,6 +91,9 @@ public:
const SalColor& rLineColor, const SalColor& rFillColor);
void addDrawLine(long nX1, long nY1, long nX2, long nY2, const SalColor& rLineColor, bool bUseAA);
+
+ void addDrawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon, double fTransparency,
+ const SalColor& rLineColor, const SalColor& rFillColor, bool bUseAA);
};
#endif // INCLUDED_VCL_INC_OPENGL_RENDERLIST_H
diff --git a/vcl/inc/opengl/VertexUtils.hxx b/vcl/inc/opengl/VertexUtils.hxx
index c64340b4a5e4..d99998cb3068 100644
--- a/vcl/inc/opengl/VertexUtils.hxx
+++ b/vcl/inc/opengl/VertexUtils.hxx
@@ -39,6 +39,20 @@ inline void addRectangle<GL_TRIANGLE_FAN>(std::vector<GLfloat>& rVertices, GLflo
});
}
+template<GLenum TYPE>
+inline void addTrapezoid(std::vector<GLfloat>& rVertices, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
+ GLfloat x3, GLfloat y3, GLfloat x4, GLfloat y4);
+
+template<>
+inline void addTrapezoid<GL_TRIANGLES>(std::vector<GLfloat>& rVertices, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
+ GLfloat x3, GLfloat y3, GLfloat x4, GLfloat y4)
+{
+ rVertices.insert(rVertices.end(), {
+ x1, y1, x2, y2, x3, y3,
+ x3, y3, x2, y2, x4, y4
+ });
+}
+
inline glm::vec4 createGLColor(const SalColor& rColor, GLfloat rTransparency)
{
return glm::vec4(SALCOLOR_RED(rColor) / 255.0f,