Mark the unexported functions as static

Some functions are only used by the scanline algorithm and thus should
be static since they're not even exported to the .h.

Signed-off-by: Celelibi <celelibi@gmail.com>
Remove useless comment

This comment was saying "add if necessary". And it have already been added.

Signed-off-by: Celelibi <celelibi@gmail.com>
Rework sorting of active_edge to make it simpler

The code that pick the smallest head of two lists has been made a
function. So that the main code is clearer.

Signed-off-by: Celelibi <celelibi@gmail.com>
Corrected a few bits of indentation

Try not to make lines larger than 80 columns and indent the multi-lines
/**/ comments. And add some spaces around keywords.

Signed-off-by: Celelibi <celelibi@gmail.com>
ScanLine: move active edge addition

Move the active edge addition at the beginning of the loop so that it
will be merged with the code of initial filling of the active edges.

Signed-off-by: Celelibi <celelibi@gmail.com>
ScanLine: merge initial and in-run active edge addition

Those were basically the same code with only a few optimisations for the
initial active edge addition. Moreover, those optimisation should be
gone soon.

Signed-off-by: Celelibi <celelibi@gmail.com>
ScanLine: simpler handling of horizontal edges

When an active edge ends and is linked to an horizontal one, don't try
to be smart, we'll need to re-sort the active edge list anyway. Just
remove it and let the normal active edge addition handle the addition
(or not) of the next edge.

Signed-off-by: Celelibi <celelibi@gmail.com>