5 ms·
I'm curious of what the benefit of Canvas is over just a random string of characters generated based on OS, browser, etc?
by mattferderer 8y ago
I'm curious of what the benefit of Canvas is over just a random string of characters generated based on OS, browser, etc?
- m1el 8y agoText rendering depends on OS, browser, system configuration, browser configuration and installed fonts.
- CyberDildonics 8y agoYou only know what the browser tells you. Also that information can be used together with the fingerprinting from a canvas.
- the_pwner224 8y agoIt can't be changed. You can fake the user agent and JavaScript-accessible properties (Tor browser does this so every Tor user is indistinguishable), but canvas rendering depends on your actual OS, GPU, etc. Browsers could implement a software renderer to consistently draw canvases on all devices, but then you lose half the reason to use canvas - speed.
- est31 8y agoActually, on Firefox, the 2D canvas is drawn using skia, a CPU vector renderer. Think that Chrome does the same, but not sure. The WebGL canvas uses the GPU hardware though.
- kevingadd 8y agoFirefox and Chrome have been using hardware acceleration for Skia for ages. Even if you have HW acceleration shut off, Chrome is typically using SwiftShader to rasterize which basically emulates a GPU instead of doing traditional CPU rasterization. If you switch off hw accel in Chrome and Firefox your canvas performance will tank.
- est31 8y agoOh TIL that Skia has an OpenGL backend. I guess I was wrong then when saying Skia is a CPU renderer.
- pcwalton 8y agoGPU differences don't show up very well—the OpenGL spec and the D3D "spec" have standardized behavior across GPUs fairly well at this point. What does show up are text rendering differences and the different software vector renderers (Core Graphics vs. Skia vs. Cairo vs. Direct2D). A lot of Canvas is still in software. I'm working to change that, but it's a work in progress…
- est31 8y ago> fairly well Don't we still live in an age where GPU drivers need game-specific driver fixes in order to work correctly? Being bug free is a different question than being free from any noticeable difference in the output, and we seem to not even have reached the bug freedom stage yet. I mean even Firefox Webrender is only available to Nvidia GPUs at the start, no?
- kevingadd 8y agoThe driver fixes are usually performance improvements where the vendor rewrites shaders to make the game run better or add support for weird vendor features (like SLI). If the vendor had to hack around the game to make it work at all, the developers wouldn't have been able to even test the game during development. WebRender was locked to NVIDIA as a known target with a known set of driver bugs. They could've chosen AMD or Intel as the target instead and worked to figure out all the relevant driver bugs and worked around them, but for whatever reason they picked NV.
- kevingadd 8y agoIs anisotropic filtering standardized by the D3D or OpenGL specs now? I know in the last decade or so, it was still the case that if you did an image diff of the same scene being rendered with say, 8xAF on both NVIDIA and AMD GPUs, the result would be different since both vendors used a mix of heuristics to get good results. I'm guessing they might've dropped the hacks by now and converged on a known 'good' algorithm. I wouldn't be surprised if mobile GPUs are still cheating even if desktop ones have stopped, though, so you'd be able to detect that with WebGL. There's also the 'detect driver bugs' approach since there are test suites out there that detect various driver stack bugs using special shaders, you could run a set of those to identify the GPU (or even driver) being used to rasterize the WebGL content.