ScanLine rasterizer

git-svn-id: svn://ultimatepp.org/upp/trunk@824 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-01-29 11:06:17 +00:00
parent 989a81ecfc
commit 00580386fa
5 changed files with 46 additions and 34 deletions

View file

@ -117,18 +117,20 @@ String ScanLine::ToString() const
void Apply(RGBA *t, int len, const RGBA& color, const ScanLine& s)
{
RGBA *e = t + len;
const char *q = ~s.data;
const char *qe = s.data.End();
t += s.x;
int si = 0;
const RGBA *e = t + len;
while(t < e && si < s.data.GetLength()) {
byte val = s.data[si++];
while(t < e && q < qe) {
byte val = *q++;
if(val > 128) {
int n = min(e - t, val - 128);
val = s.data[si++];
while(n--)
RGBA *e1 = min(e, t + val - 128);
val = *q++;
while(t < e1)
AlphaBlendCover7(*t++, color, val);
}
else
AlphaBlendCover7(*t++, color, val);
// DDUMP(t - e);
}
}