servo / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
3.11k stars 275 forks source link

Add simple SVG primitives #402

Open jdm opened 8 years ago

jdm commented 8 years ago

Note: this is part of the NCSU SVG project; please don't work on this without talking with me first.

This task requires:

Code: webrender_traits/src/api.rs, webrender_traits/src/types.rs

@glennw If you can help fill out the details here, that would be great. I was basing this on https://github.com/servo/servo/issues/12973#issuecomment-241551718

splav commented 7 years ago

Can I take this since https://github.com/servo/webrender/issues/402 appears to depend on it?

jdm commented 7 years ago

Yep!

jrmuizel commented 7 years ago

For now, it's probably best to just rely on Skia or Cairo to rasterize, stroke and dash the path geometry into a A8 texture that's uploaded to the GPU. In the future we can look at more sophisticated GPU techniques.

FWIW, both of Direct2D's rasterization techniques seem like good options:

  1. scanline converting to a mesh instead of a bitmap (will work on any hardware)
  2. target independent rasterization (requires D3D 11.1 level)
jdm commented 7 years ago

@splav Have you made progress on this? @kvark is interested in working on it.

splav commented 7 years ago

Sorry for not replying shortly. I'm taking medical therapy now and was not able to send any message. There is some kind of prototype but it's not working right for now. I guess I was too optimistic and spent too much time trying to make GPU path rasterization working. As I'm not able to work on it right now, I guess it's a good idea to let @kvark implement it.


Александров Сергей Васильевич

2016-12-14 20:14 GMT+03:00 Josh Matthews notifications@github.com:

@splav https://github.com/splav Have you made progress on this? @kvark https://github.com/kvark is interested in working on it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/servo/webrender/issues/402#issuecomment-267094651, or mute the thread https://github.com/notifications/unsubscribe-auth/AALHIryO4jb16WQNFig9-HQCzp3ey3qfks5rICQOgaJpZM4J8VzF .

emilio commented 7 years ago

Thanks for replying, and get well! :)

kvark commented 7 years ago

We (as in - Quantum Rendering team) came up with a different API to provide SVG support: https://public.etherpad-mozilla.org/p/wr-toronto#lineNumber=176

First preparations are already in flight - #852 There are no plans currently to have SVG primitives defined as proposed in this issue, so I suppose it should be closed, but leaving this luxury to @jdm.

jrmuizel commented 7 years ago

I think it's probably still worth pursuing this approach. I think there's still value in having webrender understand the scene as much as possible. However, we'll likely use the vector image support in Gecko first.

jdm commented 7 years ago

@askalski expressed interest and experience with rendering and SVG. Is there some way they could contribute to this effort? They've made a number of contributions to Servo proper in the past.

glennw commented 7 years ago

Yes - we'd still like to have direct SVG support in WR eventually, so it could be fine to start working on that. It won't overlap / interfere with the current gecko plans, which is a good thing.

njskalski commented 7 years ago

well, to be honest I am a typical coder, not an architect. I leave the technical decisions to you guys, just show me the list I can pick tickets from :)