• Kai Willadsen's avatar
    Draw all same-coloured DiffMap chunks together for performance · 0284ef72
    Kai Willadsen authored
    In situations with complicated DiffMaps, there is a significant
    performance cost to doing all of the colour setting and individually
    filling and stroking each chunk. This commit avoids this cost by
    pre-sorting the chunk list into blocks of the same type, allowing us
    to set up all of our paths of a single colour, and stroke/fill in one
    Cairo call.
    In theory, this may cause visual changes by altering the order in which
    we overwrote pixels (i.e., instead of top-to-bottom, we now do
    colour-by-colour). In practice, this was never really defined anyway.
diffmap.py 6.52 KB