if (leftSegment == rightSegment || rightSegment == Integer.MAX_VALUE) break;
if (leftSegment != -1)
if ((useEvenOdd && count % 2 != 0) || (!useEvenOdd && count != 0))
- paint.fillJSTrapezoid(intercept(edges[leftSegment], y0, true, true),
+ paint.fillTrapezoid(intercept(edges[leftSegment], y0, true, true),
intercept(edges[rightSegment], y0, true, true), y0,
intercept(edges[leftSegment], y1, true, true),
intercept(edges[rightSegment], y1, true, true), y1,
public static interface Paint {
public abstract void
- fillJSTrapezoid(int tx1, int tx2, int ty1, int tx3, int tx4, int ty2, PixelBuffer buf);
+ fillTrapezoid(int tx1, int tx2, int ty1, int tx3, int tx4, int ty2, PixelBuffer buf);
}
public static class SingleColorPaint implements Paint {
int color;
public SingleColorPaint(int color) { this.color = color; }
- public void fillJSTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, PixelBuffer buf) {
- buf.fillJSTrapezoid(x1, x2, y1, x3, x4, y2, color);
+ public void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, PixelBuffer buf) {
+ buf.fillTrapezoid(x1, x2, y1, x3, x4, y2, color);
}
}
int[] stop_colors;
float[] stop_offsets;
- public void fillJSTrapezoid(float tx1, float tx2, float ty1, float tx3, float tx4, float ty2, PixelBuffer buf) {
+ public void fillTrapezoid(float tx1, float tx2, float ty1, float tx3, float tx4, float ty2, PixelBuffer buf) {
Affine a = buf.a;
Affine inverse = a.copy().invert();
float slope1 = (tx3 - tx1) / (ty2 - ty1);