To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Hi,I'm trying to understand how canvas is rendered, and specifically if path fills are rendered on the GPU.The following things puzzle me, and I would appreciate any answers that help bring clarity to any of these questions.1. Three years ago, code was committed to WebKit that did Blinn/Loop rendering of cubic splines via the GPU. This code doesn't seem to be in the Blink repo anymore. Was it ever used. If not, why not?
2. I have setup an example, linked to below, which seems to indicate a sub-pixel resolution of 1/4 pixels. Is this the Skia backend, and are there plans to improve on this quality?
3. I cannot see any difference when #disable-accelerated-2d-canvas is on or off. I also can't find code in the Blink repo that draws 2D canvas paths via the GPU. What does this setting actually control?
Hi,I'm trying to understand how canvas is rendered, and specifically if path fills are rendered on the GPU.The following things puzzle me, and I would appreciate any answers that help bring clarity to any of these questions.1. Three years ago, code was committed to WebKit that did Blinn/Loop rendering of cubic splines via the GPU. This code doesn't seem to be in the Blink repo anymore. Was it ever used. If not, why not?
2. I have setup an example, linked to below, which seems to indicate a sub-pixel resolution of 1/4 pixels. Is this the Skia backend, and are there plans to improve on this quality?
3. I cannot see any difference when #disable-accelerated-2d-canvas is on or off. I also can't find code in the Blink repo that draws 2D canvas paths via the GPU. What does this setting actually control?
On Sat, Feb 28, 2015 at 6:48 AM, Ben Harper <rog...@gmail.com> wrote:Hi,I'm trying to understand how canvas is rendered, and specifically if path fills are rendered on the GPU.The following things puzzle me, and I would appreciate any answers that help bring clarity to any of these questions.1. Three years ago, code was committed to WebKit that did Blinn/Loop rendering of cubic splines via the GPU. This code doesn't seem to be in the Blink repo anymore. Was it ever used. If not, why not?Path rasterization is entirely handled in skia. Skia does something similar, but we are currently missing an implementation for rendering anti-aliased concave paths on the GPU. In those cases, we end up rasterizing the path on the CPU, and uploading it as a texture to the GPU. senorblanco@ is working on making this better.2. I have setup an example, linked to below, which seems to indicate a sub-pixel resolution of 1/4 pixels. Is this the Skia backend, and are there plans to improve on this quality?@senorblanco?
2. Where is the code that does the GPU-based path rasterization?
On Saturday, 28 February 2015 13:48:17 UTC+2, Ben Harper wrote:Hi,I'm trying to understand how canvas is rendered, and specifically if path fills are rendered on the GPU.The following things puzzle me, and I would appreciate any answers that help bring clarity to any of these questions.1. Three years ago, code was committed to WebKit that did Blinn/Loop rendering of cubic splines via the GPU. This code doesn't seem to be in the Blink repo anymore. Was it ever used. If not, why not?2. I have setup an example, linked to below, which seems to indicate a sub-pixel resolution of 1/4 pixels. Is this the Skia backend, and are there plans to improve on this quality?3. I cannot see any difference when #disable-accelerated-2d-canvas is on or off. I also can't find code in the Blink repo that draws 2D canvas paths via the GPU. What does this setting actually control?Here is a link to an example which demonstrates the antialiasing quality:As you move the cursor in and out of pixel (1,1), you'll notice big jumps on the number at the bottom. You'll also notice those big jumps on the canvas image itself. An ideal system would give you 256 levels, even if you move the cursor only horizontally or only vertically.Thanks,Ben
Thanks for all the feedback, much appreciated!My GPU is not blacklisted, but my small canvas size was the problem. The path I'm drawing is convex.I tried raising the canvas size to 260x260, and indeed the quality is much better. By moving the cursor in a specific way I can still produce some discreet jumps, but generally it looks like 1/256 precision.So this raises another two questions from me:1. Why is the threshold 256x257? Map tiles, especially "Canvas" tiles as rendered by Leaflet, are 256x256 pixels big, and the poor quality 4x4 sampling happens there. It would be great if our map layers that render themselves via HTML Canvas had better quality. Would you consider lowering this threshold, or suggesting another workaround?