Mask with Android App

Hi there!

Someone so kind as helped me with a mask that I need. The Code works perfectly on the pc, but not in the android app . Can you please help me with that? Thanks!

PGraphics mask, buffer;

void setup() {
  size(1024, 1024, P2D);
  
  mask = createGraphics(width, height, P2D);
  buffer = createGraphics(width, height, P2D); 
}

void draw() {
  background(255);
  updateMask();
  updateBuffer();
  buffer.mask(mask);
  image(buffer, 0, 0);
}


void updateMask() {
  mask.beginDraw();
  mask.noStroke();
  mask.fill(255);
  mask.quad(500, 300, 700, 500, 500, 700, 300, 500);
  mask.endDraw();
}

void updateBuffer() {
  buffer.beginDraw();
  buffer.background(255, 255, 0);
  buffer.strokeWeight(25);
  buffer.stroke(0, 0, 0);
  for (float x=312.5; x<700; x=x+50) {
    buffer.line(x, 300, x, 700);
  }
  buffer.endDraw();
}