RESOLVED CONFIGURATION CHANGED 158527
Similar SVGs drawn to a WebGL canvas are rendered incorrectly
https://bugs.webkit.org/show_bug.cgi?id=158527
Summary Similar SVGs drawn to a WebGL canvas are rendered incorrectly
Gurmukh Panesar
Reported 2016-06-08 08:37:04 PDT
Created attachment 280806 [details] Demo showing issue I've come across a bug whereby drawing very similar (but different) SVGs onto the Canvas using WebGL results in the SVGs being drawn on top of each other. An example is attached to better help understand the bug. When the same application is run without using WebGL, everything works fine. I know this app uses Pixi JS, but I've tried this on ThreeJS with the same problem. This occurs on iOS and Mac Safari, but is not an issue on Chrome (Blink). Steps to Reproduce - Load index.html on Chrome and Safari - Inspect the last image and see that it's different. - Loading via data URL or files makes absolutely no difference. If the last SVG is left empty (everything inside the SVG element is deleted), Chrome doesn't render it (which is correct) but Safari does (which isn't). If the height, width or viewport of any SVG is changed, then it will be rendered correctly. Adding ID's or other params to the SVG string make absolutely no difference.
Attachments
Demo showing issue (380.22 KB, application/zip)
2016-06-08 08:37 PDT, Gurmukh Panesar
no flags
Blink preview (correct) (140.30 KB, image/png)
2016-06-09 00:34 PDT, Gurmukh Panesar
no flags
WebKit Preview (incorrect) (160.91 KB, image/png)
2016-06-09 00:34 PDT, Gurmukh Panesar
no flags
Simplified Circle Demo (works in FF and Chrome) (295.46 KB, application/zip)
2016-06-09 13:04 PDT, Gurmukh Panesar
no flags
Simple circle example displaying as expected on FF and Chrome (7.12 KB, image/png)
2016-06-09 13:04 PDT, Gurmukh Panesar
no flags
Simple circle example displaying incorrectly on WebKit (8.04 KB, image/png)
2016-06-09 13:05 PDT, Gurmukh Panesar
no flags
Gurmukh Panesar
Comment 1 2016-06-09 00:34:29 PDT
Created attachment 280892 [details] Blink preview (correct)
Gurmukh Panesar
Comment 2 2016-06-09 00:34:50 PDT
Created attachment 280893 [details] WebKit Preview (incorrect)
Alex Christensen
Comment 3 2016-06-09 11:29:45 PDT
I believe this is indeed incorrect, but your example doesn't draw anything in Firefox. Could you please reduce your test case? Right now all I can tell is that something is wrong in 29000 lines of code.
Gurmukh Panesar
Comment 4 2016-06-09 11:50:34 PDT
Hi Alex, How would you like me to reduce the test case? I am using a third party library to show an image in WebGL since it's not as easy as ctx.drawImage() like it is without WebGL. I could go through and remove code in the Pixi.JS library but I'm not sure how this would help?
Alex Christensen
Comment 5 2016-06-09 12:09:56 PDT
There is a very complicated set of SVG's, and a very complicated drawing path. Ideally we would have something like "these two triangles should not be connected"
Alex Christensen
Comment 6 2016-06-09 12:11:20 PDT
Also, your test case is large, and it could indicate a bug in Pixi JS. I think it is indeed a bug in WebKit, but your demo doesn't show me this.
Gurmukh Panesar
Comment 7 2016-06-09 13:03:27 PDT
I've simplified the sample. Now there are two very simple circles showing. One large red one and a smaller yellow one. No intersection or anything. This works as expected in Firefox and Chrome but not in Safari/Webkit. Do you know how I can simplify this example further? I was unable to find any code that easily draws an image to a canvas using WebGL. Hopefully this will be simple enough?
Gurmukh Panesar
Comment 8 2016-06-09 13:04:04 PDT
Created attachment 280934 [details] Simplified Circle Demo (works in FF and Chrome)
Gurmukh Panesar
Comment 9 2016-06-09 13:04:43 PDT
Created attachment 280936 [details] Simple circle example displaying as expected on FF and Chrome
Gurmukh Panesar
Comment 10 2016-06-09 13:05:09 PDT
Created attachment 280937 [details] Simple circle example displaying incorrectly on WebKit
Gurmukh Panesar
Comment 11 2016-06-11 04:38:55 PDT
Here's a bug raised for Chrome with this exact issue. It's got an example which is now fixed in Chrome but not Firefox. It's a very simple example. Hopefully the bug report will help you isolate the issue and fix it? https://bugs.chromium.org/p/chromium/issues/detail?id=500180 Example: http://www.stagexl.org/temp/example18/example18.html
Gurmukh Panesar
Comment 12 2016-06-11 04:41:51 PDT
Marcin Ignac
Comment 13 2018-04-11 04:46:04 PDT
This is still happening in Version 11.1 (13605.1.33.1.2) But seems to be fixed in Release 53 (Safari 11.2, WebKit 13606.1.11.2)? Temporary workaround is to render SVG image to temp canvas and then use that temp canvas to upload to a texture.
Kimmo Kinnunen
Comment 14 2024-01-17 02:39:21 PST
works now
Note You need to log in before you can comment on or make changes to this bug.