CURA-12752
Otherwise, when merging the polygons and undo-ing the whole stroke, there may be some remaining pixels outside the mesh triangles that would not be cleared, because the rasterizing is not 100% identical
... because the extruders used for the current object can change (clear all bits of extruder #2 paint on a single object, which results in the object printed with extruder #1 only, which could result in the prime-tower needing to be gone -- or the other way around).
The _previous_ way of doing that was just spamming the stack changes, but that gave other problems.
part of CURA-12752
CURA-12752
The previous method was not efficient enough in case of large models, where a single painting stroke can easily cover almost the whole texture (in bounding box). Reverted to the version where the whole texture is counted, but cached in the SliceableObjectDecorator and updated on timer so that it is not done during painting.
Rewrite the whole 'count pixels to get extruders for paint on materials' so that it's cached outside of the extruder manager instead, so that counting pixels in a 4096x4096 image isn't called xx of times per second.
part of CURA-12752