Canvas 2d uses premultiplied alpha, and therefore makes it impossible to have the image stored on the canvas in a lossless way.
TextureGLManager: A singleton webgl renderer that renders a list of TextureLayer
TextureLayer creates a webgl texture. Currently, this is just a single WebGLTexture, but in the future we can split this up into:
Background texture: the image background
Staging texture: the current "edit". This would mean that pixels don't stack up like they do on the old studio. When an edit is complete, we render the staging texture on top of the background texture, and set the background texture as the result, and clear the staging texture.
Note that we have to read from a framebuffer, as canvas.toDataUrl always premultiplies the image, no matter the configuration or options
Canvas 2d uses premultiplied alpha, and therefore makes it impossible to have the image stored on the canvas in a lossless way.
TextureGLManager
: A singleton webgl renderer that renders a list ofTextureLayer
TextureLayer
creates a webgl texture. Currently, this is just a singleWebGLTexture
, but in the future we can split this up into:Note that we have to read from a framebuffer, as canvas.toDataUrl always premultiplies the image, no matter the configuration or options