font.rasterizeGlyphs(text, buf, strokecolor, text_x, text_y, cx1, cy1, cx2, cy2);
}
- if (path != null) path.realize(Affine.translate(globalx, globaly)).stroke(buf, 1, strokecolor);
+ if (path != null) new Polygon(path, Affine.translate(globalx, globaly)).stroke(buf, strokecolor);
for(Box b = getChild(0); b != null; b = b.nextSibling())
b.render(globalx, globaly, cx1, cy1, cx2, cy2, buf, null);
case "shrink": CHECKSET_FLAG(HSHRINK | VSHRINK); RECONSTRAIN();
case "hshrink": CHECKSET_FLAG(HSHRINK); RECONSTRAIN();
case "vshrink": CHECKSET_FLAG(VSHRINK); RECONSTRAIN();
- case "path": path = Path.parse(JSU.toString(value)); RECONSTRAIN(); dirty();
+ case "path": path = new Path(JSU.toString(value)); RECONSTRAIN(); dirty();
case "width": setWidth(JSU.toInt(value), JSU.toInt(value));
case "height": setHeight(JSU.toInt(value), JSU.toInt(value));
case "maxwidth": setWidth(minwidth, JSU.toInt(value));
}
- // FIXME: hack
- private String toString;
- private Path(String s) { this.toString = s; }
- public String toString() { return toString; }
-
public static class Tokenizer {
// FIXME: check array bounds exception for improperly terminated string
String s;
/** Creates a concrete vector path transformed through the given matrix. */
public void addTo(Polygon ret, Affine a) {
- long start = System.currentTimeMillis(); try {
float NUMSTEPS = 5; // FIXME
ret.x[0] = a.multiply_px(x[0], y[0]);
ret.y[0] = a.multiply_py(x[0], y[0]);
}
}
- } finally { Scheduler.rasterizing += System.currentTimeMillis() - start; }
}
protected void parseSingleCommandAndArguments(Tokenizer t, char command, boolean relative) {
float y1 = p.y[p.edges[i]];\r
float x2 = p.x[p.edges[i]+1];\r
float y2 = p.y[p.edges[i]+1];\r
- long start = System.currentTimeMillis(); try {\r
- buf.drawLine((int)Math.floor(x1), (int)Math.floor(y1), (int)Math.ceil(x2), (int)Math.ceil(y2), color);\r
- } finally { Scheduler.drawing += System.currentTimeMillis() - start; }\r
+ buf.drawLine((int)Math.floor(x1), (int)Math.floor(y1), (int)Math.ceil(x2), (int)Math.ceil(y2), 1, color, false);\r
}\r
}\r
\r
int tx1b = intercept(p.edges[rightSegment], y0, true, true);\r
int tx2a = intercept(p.edges[leftSegment], y1, true, true);\r
int tx2b = intercept(p.edges[rightSegment], y1, true, true);\r
- long start = System.currentTimeMillis(); try {\r
- buf.fillTrapezoid(tx1a, tx1b, (int)y0, tx2a, tx2b, (int)y1, ((Paint.SingleColorPaint)paint).color);\r
- } finally { Scheduler.drawing += System.currentTimeMillis() - start; }\r
+ buf.fillTrapezoid(tx1a, tx1b, (int)y0, tx2a, tx2b, (int)y1, ((Paint.SingleColorPaint)paint).color);\r
}\r
if (useEvenOdd) count++;\r
else count += (p.y[p.edges[rightSegment]] < p.y[p.edges[rightSegment]+1]) ? -1 : 1;\r
\r
private static Polygon clip(byte op, Polygon subj, Polygon clip) {\r
try {\r
- long start = System.currentTimeMillis(); try {\r
return clip_(op, subj, clip);\r
- } finally { Scheduler.clipping += System.currentTimeMillis() - start; }\r
} catch (Exception npe) {\r
npe.printStackTrace();\r
return null;\r