remove tiny-skia and replace chunk renderer with a GPU-based one

This commit is contained in:
りき萌 2025-09-05 17:41:25 +02:00
parent 39632f56a7
commit b4c3260f49
10 changed files with 253 additions and 434 deletions

View file

@ -160,40 +160,6 @@ canvasStrokeImpl = w.haku_pixmap_stroke;
w.haku_init_logging();
export class Pixmap {
#pPixmap = 0;
constructor(width, height) {
this.#pPixmap = allocCheck(w.haku_pixmap_new(width, height));
this.width = width;
this.height = height;
}
destroy() {
w.haku_pixmap_destroy(this.#pPixmap);
}
clear(r, g, b, a) {
w.haku_pixmap_clear(this.#pPixmap, r, g, b, a);
}
get ptr() {
return this.#pPixmap;
}
getArrayBuffer() {
return new Uint8ClampedArray(
memory.buffer,
w.haku_pixmap_data(this.#pPixmap),
this.width * this.height * 4,
);
}
getImageData() {
return new ImageData(this.getArrayBuffer(), this.width, this.height);
}
}
export const ContKind = {
Scribble: 0,
Dotter: 1,