unrolled span rendering a little more (switch stamement is now just once

per span 0 thats good enough.... :) )


SVN revision: 3491
This commit is contained in:
Carsten Haitzler 2000-09-16 18:16:11 +00:00
parent 6cedec71a8
commit 77a68dc413
1 changed files with 43 additions and 24 deletions

View File

@ -1939,30 +1939,49 @@ span(ImlibImage * im, int y, edgeRec * pt1, edgeRec * pt2, DATA8 r, DATA8 g,
if (ix1 == ix2) if (ix1 == ix2)
return; return;
do p = &(im->data[(im->w * y) + ix1]);
{ switch (op)
p = &(im->data[(im->w * y) + ix1]); {
switch (op) /* unrolled loop - on loop inside each render mode per span */
{ case OP_RESHADE:
case OP_RESHADE: do
BLEND_RE(r, g, b, a, p); {
break; BLEND_RE(r, g, b, a, p);
case OP_SUBTRACT: p++;
BLEND_SUB(r, g, b, a, p); ix1++;
break; }
case OP_ADD: while (ix1 < ix2);
BLEND_ADD(r, g, b, a, p); break;
break; case OP_SUBTRACT:
case OP_COPY: do
BLEND(r, g, b, a, p); {
break; BLEND_SUB(r, g, b, a, p);
default: p++;
break; ix1++;
} }
while (ix1 < ix2);
ix1++; break;
} case OP_ADD:
while (ix1 < ix2); do
{
BLEND_ADD(r, g, b, a, p);
p++;
ix1++;
}
while (ix1 < ix2);
break;
case OP_COPY:
do
{
BLEND(r, g, b, a, p);
p++;
ix1++;
}
while (ix1 < ix2);
break;
default:
break;
}
} }
void void