I have an oscilloscope component whose parent provides an
setComponentPaintEnabled(true), and this oscilloscope draws its line with a simple
I’m not well-versed in what happens beneath that
strokePath call, so I have a few questions along the lines of the tradeoff between smooth line drawing and fast rendering.
- Does the path rendering here happen on the GPU? Or does the CPU compute the set of vertices and pass that off to the GPU for rendering? (Realizing as I type that I can probably find the answer by profiling. I will report back with my findings)
- Is there any benefit to providing more than one Y value per pixel? E.g.
p.lineTo(0.25f, getOutputPoint(0.25f));Obviously I don’t have quarter-pixels to draw here, but I could imagine, for example, that adding extra Y values perhaps helps inform the anti-aliasing in the path rendering algorithm? Or perhaps those extra Y values come into play for better scaling to HiDPI displays with the
AffineTransformunder the hood? But obviously more points = more cost, so I’m trying to make sure I understand both sides of the tradeoff here to make a well-informed decision about how I draw this.
I think that’s all, thank you!