author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年06月20日 09:31:28 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年06月20日 09:31:28 +0200 |
commit | 4cf954200f830cf7fd62751a33da57f45f1f9ff2 (patch) | |
tree | 4ae38faadd6d3aab7fb1b1bbbf1da17ef82cc6c8 /agg-plot/canvas.h | |
parent | 29309ebb162dabd6b533f3c48fac88e13bf3e570 (diff) | |
download | gsl-shell-4cf954200f830cf7fd62751a33da57f45f1f9ff2.tar.gz |
-rw-r--r-- | agg-plot/canvas.h | 15 |
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) |