patch by Andrej Spielmann (GSOC):

* Prepared the AGG base_renderer code with two more functions needed to
  handle subpixel scanline coverage values.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26356 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-07-10 08:11:04 +00:00
parent c816464287
commit 3a0814fdae
+39
View File
@@ -205,6 +205,22 @@ namespace agg
m_ren->blend_hline(x1, y, x2 - x1 + 1, c, cover);
}
//--------------------------------------------------------------------
void blend_hline_subpix(int x1, int y, int x2,
const color_type& c, cover_type cover)
{
if(x1 > x2) { int t = x2; x2 = x1; x1 = t; }
if(y > ymax()) return;
if(y < ymin()) return;
if(x1 > xmax()) return;
if(x2 < xmin()) return;
if(x1 < xmin()) x1 = xmin();
if(x2 > xmax()) x2 = xmax();
m_ren->blend_hline_subpix(x1, y, x2 - x1 + 1, c, cover);
}
//--------------------------------------------------------------------
void blend_vline(int x, int y1, int y2,
@@ -280,6 +296,29 @@ namespace agg
}
m_ren->blend_solid_hspan(x, y, len, c, covers);
}
//--------------------------------------------------------------------
void blend_solid_hspan_subpix(int x, int y, int len,
const color_type& c,
const cover_type* covers)
{
if(y > ymax()) return;
if(y < ymin()) return;
if(x < xmin())
{
len -= 3 * (xmin() - x);
if(len <= 0) return;
covers += 3*(xmin() - x);
x = xmin();
}
if(x + len / 3 > xmax())
{
len = 3 * (xmax() - x + 1);
if(len <= 0) return;
}
m_ren->blend_solid_hspan_subpix(x, y, len, c, covers);
}
//--------------------------------------------------------------------
void blend_solid_vspan(int x, int y, int len,