message: Use `.copyWithin()` to speed up `ColorPatchImageData`
diff: @@ -46,12 +46,14 @@ export class ColorPatchImageData {
  const rawImageData = imageData.data;
  const cellWidth = this._cellWidth;
  const cellHeight = this._cellHeight;
  + const rowWidthBytes = imageData.width * 4;
  for (let j=0; j<heightChars; j++) {
  - for (let cy=0; cy<cellHeight; cy++) {
  - let offset = (((cellHeight * j) + cy) * imageData.width) * 4;
  - for (let i=0; i<widthChars; i++) {
  + const startOffset = cellHeight * j * rowWidthBytes;
  + let offset = startOffset;
  +
  + for (let i=0; i<widthChars; i++) {
  let rgba = 0;
  const style = this._cellGrid.getStyle(i, j);
  if ((style & STYLE_MASK_CURSOR) && renderCursor) {
  @@ -78,6 +80,10 @@ export class ColorPatchImageData {
  offset++;
  }
  }
  +
  + for (let cy=1; cy<cellHeight; cy++) {
  + const targetOffset = startOffset + rowWidthBytes * cy;
  + rawImageData.copyWithin(targetOffset, startOffset, targetOffset + rowWidthBytes);
  }
  }
  }
  