+ virtual void RenderUsingCPU(Objects & objects, const View & view, const CPURenderTarget & target, unsigned first_obj_id, unsigned last_obj_id);
+ };
+
+ /** Renderer for bezier curves **/
+ class BezierRenderer : public ObjectRenderer
+ {
+ public:
+ BezierRenderer() : ObjectRenderer(BEZIER, "shaders/rect_vert.glsl", "shaders/rect_frag.glsl", "shaders/bezier_texbuf_geom.glsl") {}
+ virtual ~BezierRenderer() {}
+ virtual void RenderUsingGPU(unsigned first_obj_id, unsigned last_obj_id);
+ virtual void RenderUsingCPU(Objects & objects, const View & view, const CPURenderTarget & target, unsigned first_obj_id, unsigned last_obj_id);
+ void PrepareBezierGPUBuffer(Objects & objects);
+
+ static void RenderBezierOnCPU(const Bezier & relative, const Rect & bounds, const View & view, const CPURenderTarget & target, const Colour & c=Colour(0,0,0,255));
+
+ private:
+ GraphicsBuffer m_bezier_coeffs;
+ GraphicsBuffer m_bezier_ids;
+ struct GPUBezierCoeffs
+ {
+ float x0, y0;
+ float x1, y1;
+ float x2, y2;
+ float x3, y3;
+ };
+
+ GLuint m_bezier_buffer_texture;
+ GLuint m_bezier_id_buffer_texture;
+
+ };
+
+ /** Renderer for filled paths **/
+ class PathRenderer : public ObjectRenderer
+ {
+ public:
+ PathRenderer() : ObjectRenderer(PATH, "shaders/rect_vert.glsl", "shaders/rect_frag.glsl", "shaders/bezier_texbug_geom.glsl") {}
+ virtual ~PathRenderer() {}
+ virtual void RenderUsingCPU(Objects & objects, const View & view, const CPURenderTarget & target, unsigned first_obj_id, unsigned last_obj_id);
+ // do nothing on GPU
+ virtual void RenderUsingGPU(unsigned first_obj_id, unsigned last_obj_id) {}
+
+ };
+
+ class FakeRenderer : public ObjectRenderer
+ {
+ public:
+ FakeRenderer() : ObjectRenderer(PATH,NULL,NULL,NULL) {}
+ ~FakeRenderer() {}
+ virtual void RenderUsingCPU(Objects & objects, const View & view, const CPURenderTarget & target, unsigned first_obj_id, unsigned last_obj_id) {}
+ virtual void RenderUsingGPU(unsigned first_obj_id, unsigned last_obj_id) {}