Hi Chris,
Thanks so much for putting this together! This is the exact effect I'm looking for. But looking at the code, seems like it's buried deep in the GPU path rendering pipeline. I don't see an easy way to expose the interface for application code to utilize this effect... Also, will that require additional work for this effect to work in other backends such as PDF?
The GrStrokePatchBuilder however looks very promising... I think it should be easier to change the output from chunks of GrBuffer to SkVertices, and then add necessary data for custom SKSL based shaders. The result from the wire frame in your post looks much better than my homemade naive tessellator. :)
I think adding some details of our scenario might be helpful, esp. if Skia is considering enhancements to path API such as "stroke coordinate" which sounds very promising for our scenario.
For this particular effect, we want to add an "ephemeral stroke" feature where users can draw strokes with a stylus but the stroke will disappear after a short period of time. We want a smooth disappear effect so fading out along the stroke would be ideal. Before moving to Skia we put the length information on vertex z value, extract it in vertex shader and use that to modify alpha value in the fragment shader. In Skia we first implemented a similar effect using Skia's particle system, but it has issues like not guaranteed to be a continuous stroke...
Another feature we would like to have in the path or stroke API is the ability to dynamically change stroke width, based on things like pressure, speed, or even angle of the stylus, to provide a higher fidelity drawing experience than uniformly stroked path. I haven't started working on it but SkStrokeRec related code seems to be well encapsulated and customizable for that purpose.