@Override public Canvas clip(Path path) { currentState().clipper = (JavaPath) path; return this; }
@Override protected Canvas createCanvasImpl (Scale scale, int pixelWidth, int pixelHeight) { BufferedImage bitmap = new BufferedImage( pixelWidth, pixelHeight, BufferedImage.TYPE_INT_ARGB_PRE); return new JavaCanvas(this, new JavaImage(this, scale, bitmap, "<canvas>")); }
@Override public int ensureTexture() { // if we have a canvas, and it's dirty, force the recreation of our texture which will obtain // the latest canvas data if (canvas.dirty()) { canvas.clearDirty(); refreshTexture(); } return super.ensureTexture(); }
@Override protected Canvas createCanvasImpl (Scale scale, int pixelWidth, int pixelHeight) { BufferedImage bitmap = new BufferedImage( pixelWidth, pixelHeight, BufferedImage.TYPE_INT_ARGB_PRE); return new JavaCanvas(this, new JavaImage(this, scale, bitmap, "<canvas>")); }
@Override public int ensureTexture() { // if we have a canvas, and it's dirty, force the recreation of our texture which will obtain // the latest canvas data if (canvas.dirty()) { canvas.clearDirty(); refreshTexture(); } return super.ensureTexture(); }
@Override public Canvas setMiterLimit(float miter) { currentState().miterLimit = miter; return this; }
JavaCanvasImage(GLContext ctx, float width, float height) { super(ctx, new BufferedImage(ctx.scale.scaledCeil(width), ctx.scale.scaledCeil(height), BufferedImage.TYPE_INT_ARGB_PRE), ctx.scale); Graphics2D gfx = img.createGraphics(); gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gfx.scale(ctx.scale.factor, ctx.scale.factor); canvas = new JavaCanvas(gfx, width(), height()); }
@Override public Canvas setStrokeWidth(float w) { currentState().strokeWidth = w; return this; }
JavaCanvasImage(GLContext ctx, float width, float height) { super(ctx, new BufferedImage(ctx.scale.scaledCeil(width), ctx.scale.scaledCeil(height), BufferedImage.TYPE_INT_ARGB_PRE), ctx.scale); Graphics2D gfx = img.createGraphics(); gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gfx.scale(ctx.scale.factor, ctx.scale.factor); canvas = new JavaCanvas(gfx, width(), height()); }
@Override public Canvas setStrokeWidth(float w) { currentState().strokeWidth = w; return this; }
@Override public Canvas setFillPattern(Pattern pattern) { currentState().fillPattern = (JavaPattern) pattern; currentState().fillGradient = null; currentState().fillColor = 0; return this; }
@Override public Canvas clip(Path path) { currentState().clipper = (JavaPath) path; return this; }
@Override public Canvas setFillColor(int color) { currentState().fillColor = color; currentState().fillGradient = null; currentState().fillPattern = null; return this; }
@Override public Canvas setFillPattern(Pattern pattern) { currentState().fillPattern = (JavaPattern) pattern; currentState().fillGradient = null; currentState().fillColor = 0; return this; }
@Override public Canvas setLineJoin(LineJoin join) { currentState().lineJoin = join; return this; }
@Override public Canvas setStrokeWidth(float w) { currentState().strokeWidth = w; return this; }
@Override public Canvas setCompositeOperation(Composite composite) { currentState().composite = composite; return this; }
@Override public Canvas setFillGradient(Gradient gradient) { currentState().fillGradient = (JavaGradient) gradient; currentState().fillPattern = null; currentState().fillColor = 0; return this; }
@Override public Canvas setCompositeOperation(Composite composite) { currentState().composite = composite; return this; }
@Override public Canvas setCompositeOperation(Composite composite) { currentState().composite = composite; return this; }