Code example for Shader

Methods: setLocalMatrix

0
  } 
 
  void setSize(int size) {
    this.size = size;
    matrix.setScale(size, size);
    shader.setLocalMatrix(matrix);
  } 
 
  @Override 
  public void draw(Canvas canvas) {
    canvas.drawCircle(size / 2, size / 2, size / 2, fillPaint);
  } 
 
  @Override 
  public void setAlpha(int alpha) {
    fillPaint.setAlpha(alpha);
  } 
 
  @Override 
  public void setColorFilter(ColorFilter cf) {
    fillPaint.setColorFilter(cf);