function mergeWithLayer(olayer) {
  const layer = olayer.clone();
  // TODO: fix merging referenced layers
  const main = this.batch;
  const opacity = this.opacity;
  const ldata = layer.batch.data;
  const lw = layer.bounds.w;
  const lh = layer.bounds.h;
  const lx = layer.x + layer.bounds.x;
  const ly = layer.y + layer.bounds.y;
  const sx = this.x + this.bounds.x;
  const sy = this.y + this.bounds.y;
  const dx = sx - lx; const dy = sy - ly;
  const bx = sx - dx; const by = sy - dy;
  const batch = this.createBatchAt(bx, by);
  // pre-resize batch
  batch.bounds.w = lw;
  batch.bounds.h = lh;
  // allocate pixel memory
  batch.data = new Uint8Array(ldata.length);
  batch.reverse = new Uint8Array(ldata.length);
  // draw batch matrix into layer matrix
  // and save earlier state
  for (let ii = 0; ii < ldata.length; ii += 4) {
    const idx = (ii / 4) | 0;
    const xx = (idx % lw) | 0;
    const yy = (idx / lw) | 0;
    const pixel = layer.getPixelAt(lx + xx, ly + yy);
    if (pixel === null) continue;
    //console.log(pixel[3], layer.oapcity);
    pixel[3] = pixel[3] * (opacity * layer.opacity);
    batch.drawPixelFast(lx + xx, ly + yy, pixel);
  };
  batch.refreshTexture(true);
  return (batch);
}
Merges two layers
Resize this by layer<->this bounding diff
Inject this matrix into layer matrix at layer bound pos
@param {Layer} olayer
@return {Batch}