remove tiny-skia and replace chunk renderer with a GPU-based one
This commit is contained in:
parent
39632f56a7
commit
b4c3260f49
10 changed files with 253 additions and 434 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue