@Override public void draw(GC gc, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) { parent.draw(gc, dx, dy, dw, dh, x+sx, y+sy, sw, sh); }
@Override void draw(GLShader shader, InternalTransform xform, int tint, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) { if (repeatX || repeatY) { // if we're repeating, then we have our own texture and want to draw it normally super.draw(shader, xform, tint, dx, dy, dw, dh, sx, sy, sw, sh); } else { float texWidth = (tex > 0) ? width : parent.width(); float texHeight = (tex > 0) ? height : parent.height(); sx += x(); sy += y(); parent.drawImpl(shader, xform, ensureTexture(), tint, dx, dy, dw, dh, sx / texWidth, sy / texHeight, (sx + sw) / texWidth, (sy + sh) / texHeight); } }
@Override public Canvas drawImage(Image img, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) { @SuppressWarnings("unchecked") AbstractImageGL<GC> d = (AbstractImageGL<GC>) img; d.draw(gc(), dx, dy, dw, dh, sx, sy, sw, sh); isDirty = true; return this; }
@Override public Canvas drawImage(Image img, float x, float y, float w, float h) { @SuppressWarnings("unchecked") AbstractImageGL<GC> d = (AbstractImageGL<GC>) img; d.draw(gc(), x, y, w, h); isDirty = true; return this; }
@Override public Surface drawImage(Image image, float x, float y, float dw, float dh) { bindFramebuffer(); ((AbstractImageGL<?>) image).draw(shader, topTransform(), tint, x, y, dw, dh); return this; }
@Override public Surface drawImage(Image image, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) { bindFramebuffer(); ((AbstractImageGL<?>) image).draw(shader, topTransform(), tint, dx, dy, dw, dh, sx, sy, sw, sh); return this; }
/** * Draws this image with the supplied transform in the specified target dimensions. */ void draw(GLShader shader, InternalTransform xform, int tint, float dx, float dy, float dw, float dh) { draw(shader, xform, tint, dx, dy, dw, dh, 0, 0, (repeatX ? dw : width()), (repeatY ? dh : height())); }
@Override public void paint(InternalTransform curTransform, int curTint, GLShader curShader) { if (visible() && img != null) { if (tint != Tint.NOOP_TINT) curTint = Tint.combine(curTint, tint); img.draw((shader == null) ? curShader : shader, localTransform(curTransform), curTint, 0, 0, width(), height()); } }