Add virtual render method for sg_object - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/canvas.h
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年06月20日 09:31:28 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年06月20日 09:31:28 +0200
commit4cf954200f830cf7fd62751a33da57f45f1f9ff2 (patch)
tree4ae38faadd6d3aab7fb1b1bbbf1da17ef82cc6c8 /agg-plot/canvas.h
parent29309ebb162dabd6b533f3c48fac88e13bf3e570 (diff)
downloadgsl-shell-4cf954200f830cf7fd62751a33da57f45f1f9ff2.tar.gz
Add virtual render method for sg_object
The render method will be used by the canvas class if available to directly render into the buffer and bypass normal rendering mechanisms based on vertex_source. This is meant to allow subpixel LCD font rendering.
Diffstat (limited to 'agg-plot/canvas.h')
-rw-r--r--agg-plot/canvas.h 15
1 files changed, 11 insertions, 4 deletions
diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h
index 9b79f871..92e5111c 100644
--- a/agg-plot/canvas.h
+++ b/agg-plot/canvas.h
@@ -61,12 +61,14 @@ class canvas_gen : private pixel {
double m_width;
double m_height;
+ agg::rendering_buffer& m_rbuf;
+
public:
canvas_gen(agg::rendering_buffer& ren_buf, double width, double height,
agg::rgba bgcol):
pixel(ren_buf), rb(pixel::pixfmt), rs(rb),
ras(), sl(), bg_color(bgcol),
- m_width(width), m_height(height)
+ m_width(width), m_height(height), m_rbuf(ren_buf)
{
};
@@ -90,9 +92,14 @@ public:
void draw(sg_object& vs, agg::rgba8 c)
{
- this->ras.add_path(vs);
- this->rs.color(c);
- agg::render_scanlines(this->ras, this->sl, this->rs);
+ bool direct_render = vs.render(m_rbuf, this->ras, this->sl, c);
+
+ if (!direct_render)
+ {
+ this->ras.add_path(vs);
+ this->rs.color(c);
+ agg::render_scanlines(this->ras, this->sl, this->rs);
+ }
};
void draw_outline(sg_object& vs, agg::rgba8 c)
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月28日 04:02:49 +0000

AltStyle によって変換されたページ (->オリジナル) /