summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-05-12 13:37:33 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-05-12 13:37:33 +0100
commit52be0ed7a2adbbe89235bb50f1c2b2da122b11a1 (patch)
tree415471a3b7c5d0fdff9d144a486d04849a0e7f3a /src/corelib
parent6026da8b7fed1186c4f5c2926b621269bf77cea0 (diff)
downloadfpGUI-52be0ed7a2adbbe89235bb50f1c2b2da122b11a1.tar.xz
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.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/render/software/agg_renderer_base.pas12
1 files changed, 12 insertions, 0 deletions
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