Closed vorg closed 8 years ago
I don't think anything should have changed... if it did it's because of a new build of Skia which has the color ordering incorrect. Have a simple reproduction case?
So I just quickly tested the current build vs a build from 2014, and it looks like the ordering is the same as it has always been. Just to clarify that ordering is BGRA. What does the following print for you? I get 3 2 1, which is BGRA.
var plask = require('plask') var canvas = new plask.SkCanvas(3, 3); canvas.clear(1, 2, 3, 255); canvas = canvas.pixels || canvas; console.log(canvas[0]); console.log(canvas[1]); console.log(canvas[2]);
Sorry my fault. I do this
if (data instanceof plask.SkCanvas) {
and use texImage2DSkCanvas
for Canvas, but for pixels it branches to texImage2D
which is obviously wrong as it uploads BGRA data as RGBA
Why
SkCanvas
isBGRA
butSkCanvas.pixels
areRGBA
?texImage2DSkCanvas
is usingGL_BGRA
so I get different results. I was supposed to update my code to always usepixels
but if I do that for texture upload i get inverted R & B channels.