gfx: Paint in parallel in CPU rendering mode

r? @larsbergstrom @mrobinson 
This patch would easier to read without the unnecessary formatting changes.