News for hackers. Stuff that matters.
Re:CanvasKit – Skia and WebAssembly by skybrian on Friday July 19, 2019 @01:14PM (#20480540)
Right, but I'm wondering if it runs entirely on the CPU or uses GPU-based acceleration via WebGL.
Re:CanvasKit – Skia and WebAssembly by Lerc on Friday July 19, 2019 @02:02PM (#20480996)
It is certainly a WebGL Context.

Running this on one of the examples.

let c=document.querySelector("#canvas");

c.getContext("2d"); >>>> null

c.getContext("webgl"); >>>> WebGLRenderingContext { vertexAttribDivisor: vertexAttribDivisor(), drawArraysInstanced: drawArraysInstanced(), drawElementsInstanced: drawElementsInstanced(), createVertexArray: createVertexArray(), deleteVertexArray: deleteVertexArray(), bindVertexArray: bindVertexArray(), isVertexArray: isVertexArray(), drawBuffers: drawBuffers(), Yu: null, canvas: canvas#canvas }

c.getContext("webgl2"); >>>> null

Of course that doesn't stop it from using any amount of software rendering layers before it hits the canvas, but it's a good sign.

Re:CanvasKit – Skia and WebAssembly by espeed on Friday July 19, 2019 @01:57PM (#20480947)
The docs say it uses WebGL [1]. And I found a "fixed" pull-request saying it too [2].

   WebGL context encapsulated as an SkSurface, 
   allowing for direct drawing to an HTML canvas.
However, I just discovered this project a few hours ago so I don't know if there's any "gotchas" -- hopefully someone more knowledgeable or on the chrome/skia team will chime in.

[1] https://skia.org/user/modules/canvaskit

[2] https://bugs.chromium.org/p/skia/issues/detail?id=8378

Re:CanvasKit – Skia and WebAssembly by rikroots on Friday July 19, 2019 @02:58PM (#20481508)
As far as I'm aware, browsers have been making use of any available GPU acceleration for rendering 2d contexts since 2012[1]? The example supplied by Google[2] (on the first link) definitely requests a 2d context for the canvas.

[1] - https://developers.google.com/web/updates/2012/07/Taking-adv... [2] - http://fhtr.org/gravityring/sprites.html