
public class SideOptimizationPointAccepter extends Object implements PointAccepter
PointAccepter that simplifies the list of consecutive points with the same X or Y.
One goal is to have faster Path rendering.
As we clip the Path with a rectangle, additional segments are created by SegmentClipper.
When most of the Polygon is out of the screen, many consecutive segments are on the same side
of the clip rectangle (e.g. same X or same Y). Do we need to render all those segments? No.
We can simplify this list of consecutive segments into a tiny list of maximum 3 segments.
And that makes the Path rendering much faster.| Constructor and Description |
|---|
SideOptimizationPointAccepter(PointAccepter pPointAccepter)
We optimize on top of another
PointAccepter |
public SideOptimizationPointAccepter(PointAccepter pPointAccepter)
PointAccepterpublic void init()
init in interface PointAccepterpublic void add(long pX,
long pY)
add in interface PointAccepterpublic void end()
end in interface PointAccepter