List of usage examples for com.google.gwt.canvas.dom.client Context2d restore
public final native void restore() ;
From source file:playn.html.HtmlGroupLayerCanvas.java
License:Apache License
@Override public void paint(Context2d ctx, float parentAlpha) { if (!visible()) return;/*from w ww.j a v a 2 s . c o m*/ ctx.save(); transform(ctx); render(ctx, parentAlpha * alpha); ctx.restore(); }
From source file:playn.html.HtmlImageLayerCanvas.java
License:Apache License
@Override public void paint(Context2d ctx, float parentAlpha) { if (!visible() || !img.isReady()) return;// w w w . ja va 2 s . c o m ctx.save(); transform(ctx); ctx.setGlobalAlpha(parentAlpha * alpha); float width = width(); float height = height(); if (repeatX || repeatY) { updatePattern(ctx); ctx.setFillStyle(pattern); ctx.beginPath(); ctx.rect(0, 0, width, height); ctx.scale(repeatX ? 1 : width / img.width(), repeatY ? 1 : height / img.height()); ctx.fill(); } else { ((HtmlCanvas.Drawable) img).draw(ctx, 0, 0, width, height); } ctx.restore(); }
From source file:playn.html.HtmlImmediateLayerCanvas.java
License:Apache License
@Override void paint(Context2d ctx, float parentAlpha) { if (!visible()) return;/*w w w . ja va 2 s .c om*/ ctx.save(); transform(ctx); ctx.setGlobalAlpha(parentAlpha * alpha); render(ctx); ctx.restore(); }
From source file:playn.html.HtmlSurfaceLayerCanvas.java
License:Apache License
@Override void paint(Context2d ctx, float parentAlpha) { if (!visible()) return;/*w ww. j av a 2 s . co m*/ ctx.save(); transform(ctx); ctx.setGlobalAlpha(parentAlpha * alpha); ctx.drawImage(canvas.canvas(), 0, 0); ctx.restore(); }