Like nearly everything in paths, there are some speedups but not always in all circumstances.
Stroking
Distinguish between stroke-width 0 (hairline) and others. Hairlining (hairstroking) is a very different code-path than "thick" stroking. It is funny in that it doesn't zoom w/ the CTM, but it is bloody fast.
For thick strokes, speed tricks can depend on the complexity of the path and the backend (cpu -vs- gpu)
- If the path is really a rect or oval, please please call those draw methods instead, as they are very often faster (esp. on GPU)
- GPU : some paths are stroked analytically in the shader, but not all. Details from someone else...
- CPU : thick (non-rect) strokes are implemented by first generating a new path, and "filling" that one. This can be accelerated by the client doing this step themselves...
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(...);
// set other stroky things like caps, joins, patheffect
paint.getFillPath(original_path, &result_path, optional_cull_rect);
Now you can draw the "stroke" by filling result_path, which will save you the "getFillPath" step each time.