I am attempting to make the dashed line drawing use the start of the requested line rather than the absolute (x,y). That would be my feature request. Also, notice that the code seems to recalculate the mask_buf multiple times – stepping over lv_draw_sw_blend() did not seem to wipe out the content so I assume it could be optimized to just calculate the mask once?
I updated to version 9.6.0 because of a reported issue where dash length was one pixel longer for horizontal lines.
This is from draw_line_ver in lv_draw_sw_line.c
The quick evidence of a problem can be seen for when dash_start evaluates to 0. This makes dash_cnt==0. The first time through the comparison that decides dash/gap is with dash_cnt at zero. Later, dash_cnt is incremented after it is potentially reset. This means that dash_cnt will never go through the comparison as zero except for the first time. (Problem i saw was a two-dot dash at the start when I requested dash lengths of 1)
I noticed some other things. lv_memset() is called within the loop so it will execute for each pixel. It could be moved above the loop, but since blend_dsc.mask_res is never set to a value that uses the mask, it can just be commented out. I don’t understand why lv_draw_sw_blend() is called for each pixel and called to draw the gap regions. Might be more efficient to calculate what is needed for the next dash or partial dash and draw the dashes and not the gaps. If I am missing something, please let me know.
The #includes are just my way of having a minimal footprint in the source to provide a feature enhancement. What is being done is to conditionally alter dash_start to provide a line where the dash always starts at the first point of the line. This moves the dash/gap sequence away from dependency on the underlying grid. The specific use is to draw a focus rect on a control. Without the enhancement, the dash/gap pattern is dependent on where the control happens to be located. (My actual rect drawing draws two lines per side, from ends inward. It makes sure each corner is shown and the dash/gap pattern is consistent for any place the focus rect is drawn)

