Drawing Engine
Chapter 8
8.5.8 Rasterization optimization
During rasterization it is necessary to step through the whole bounding box one
pixel after the other. This can lead to an unnecessary amount of steps through
pixels that will not be drawn anyway. A contiguous horizontal line is called a span.
For all convex primitives it is known beforehand that they can have only one span
per line. One optimization is to detect a span start and save the information for
the next line. The other optimization is to detect a span end and stop rasterization
for this line.
8.5.8.1
Spanstore
Consider the following case:
If the grey triangle has to be rendered half of the pixel processed by the rendering
engine, the dotted bounding box, would not be drawn. This can be optimized with
the spanstore operation. When spanstore is activated and a span start is detected
the x position of the span start is detected.
In the next line the rendering starts with the stored x position. This only works if
the edge is monotone growing which means y
> y
=> x
≥ x
.
1
2
1
2
Consider the following case:
In this case the normal span store operation could not be made. In this case the
y direction of the rendering would be reversed. Then spanstore could operate
again.
Preliminary User's Manual S19203EE1V3UM00
237