Improve subpixel rendering time by using a specialized transform - 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年07月10日 23:22:02 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年07月10日 23:22:02 +0200
commit2f1fb2eebff0d6c2febec640ef1a0938a124de36 (patch)
treec3e3dca07d8adcbf532a1523cfc0f7f384e33ee7 /agg-plot/canvas.h
parent6a948f2402353a808b85016fdb2e1b6aea60890d (diff)
downloadgsl-shell-2f1fb2eebff0d6c2febec640ef1a0938a124de36.tar.gz
Improve subpixel rendering time by using a specialized transform
Diffstat (limited to 'agg-plot/canvas.h')
-rw-r--r--agg-plot/canvas.h 10
1 files changed, 8 insertions, 2 deletions
diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h
index fd618769..3a35a501 100644
--- a/agg-plot/canvas.h
+++ b/agg-plot/canvas.h
@@ -72,6 +72,12 @@ template <class Pixel>
class renderer_subpixel_aa
{
enum { subpixel_scale = 3 };
+
+ struct subpixel_scale_trans
+ {
+ void transform(double* x, double* y) const { *x = subpixel_scale * (*x); }
+ };
+
public:
renderer_subpixel_aa(agg::rendering_buffer& ren_buf, agg::rgba bg_color):
m_pixbuf(ren_buf), m_ren_base(m_pixbuf), m_ren_solid(m_ren_base),
@@ -105,8 +111,8 @@ public:
template <class Rasterizer, class VertexSource>
static void add_path(Rasterizer& ras, VertexSource& vs)
{
- agg::trans_affine_scaling subpixel_mtx(double(subpixel_scale), 1.0);
- agg::conv_transform<VertexSource> scaled_vs(vs, subpixel_mtx);
+ subpixel_scale_trans tr;
+ agg::conv_transform<VertexSource, subpixel_scale_trans> scaled_vs(vs, tr);
ras.add_path(scaled_vs);
}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月16日 22:12:09 +0000

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