From 52be0ed7a2adbbe89235bb50f1c2b2da122b11a1 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Sun, 12 May 2013 13:37:33 +0100 Subject: agg: Add agg_renderer_base.fill(color) method for blending a color. This complements the clear(color) method, which copies the color. This is a port of r82 from AGG project on SourceForge. --- src/corelib/render/software/agg_renderer_base.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/render/software/agg_renderer_base.pas b/src/corelib/render/software/agg_renderer_base.pas index 926aebd5..cc2bade4 100644 --- a/src/corelib/render/software/agg_renderer_base.pas +++ b/src/corelib/render/software/agg_renderer_base.pas @@ -79,6 +79,7 @@ type function bounding_ymax : int; virtual; procedure clear(c : aggclr_ptr ); + procedure fill(const c: aggclr_ptr); procedure copy_pixel (x ,y : int; c : aggclr_ptr ); virtual; procedure blend_pixel(x ,y : int; c : aggclr_ptr; cover : int8u ); virtual; @@ -348,6 +349,17 @@ begin end; +procedure renderer_base.fill(const c: aggclr_ptr); +var + y: unsigned; +begin + if (width > 0) and (height > 0) then + begin + for y:=0 to height - 1 do + m_ren.blend_hline(m_ren, 0, y, width, c, cover_mask); + end; +end; + { COPY_PIXEL } procedure renderer_base.copy_pixel(x, y: int; c: aggclr_ptr); begin -- cgit v1.2.3-70-g09d2