Closed nealsanche closed 8 years ago
Downside of this clip path drawing technique is that the concave endcap is not antialiased and so looks poor under close scrutiny. See:
http://stackoverflow.com/questions/2719535/how-do-i-antialias-the-clip-boundary-on-androids-canvas
So, a bitmap rendering technique would have to be developed. I'll have a look into this soon.
Thanks Neal, yeah the lack of anti alias clipping is an issue. I hope to be able to build a solution that overcomes this and the other issues with adding end caps, although I don't have the time at the moment. Feel free to explore alternative solutions.
Thanks Brent, I will do so. It's an interesting exercise going through the Android canvas stuff and seeing what it actually looks like when rendered. Screen resolution is almost high enough now that the non-antialiasing was almost missed. But as soon as I enabled the triple-tap to magnify gesture, it was pretty obvious that it wasn't looking very good.
I'll iterate, and hopefully it'll help you bring it back into the library in a way you're happy with.
This morning I tried using PorterDuff.Mode.CLEAR
, which involved drawing into an offscreen bitmap, because the PorterDuff modes only work on bitmaps, apparently. This technique works, but even if I only create the bitmaps and paints once during the drawing cycle, there is a significant slow-down to the simple arc painting technique used currently.
It might be possible to just draw the end-cap into a small bitmap, use the current masking technique to replace only the end-cap part of the image.
I'll leave this branched for now. It's definitely a step backwards, performance wise.