That's the ideal. In practice, "any point in time" will in any case be limited to a limited number of code junctions, and if we space them too densely, we will lose too much time on the constant checks "do we have an interrupting event?" So we need to find a compromise between granularity of interruption points and responsiveness to events.
There are several checks per shape even now (e.g. checking if the shape has a filter, and whether it is transparent), so even many checks likely wouldn't make a difference.
So, it may be that something - like the hardware-accelerated rendering
- forces us to switch to Illustrator repaint method. But in any case
please don't do this switch without careful consideration and testing. Our method has served us very well, and what you call "artefacts" are in fact, after you get used to them, useful hints that enable you to work much faster than what our slow renderer would alow otherwise.
It's not necessary to switch to the Illustrator method (which by the way I find very hard to justify). What I wanted is to redraw everything in one go. It would make the renderer less responsive, but I intended that to be overcome by the speed increase from hardware acceleration.
Obviously there are two conflicting goals: 1. Respond to user actions as quickly as possible. 2. Do not show a partially redrawn screen. I think the best solution is an adaptive strategy. Here's an example of one.
First, I would make the renderer reasonably interruptible. Then I would set a configurable threshold, say 20ms, for what should be considered "instantaneous". On every redraw I set a 20ms timer. If the timer expires before I'm done, I throw away whatever I was doing, split the image into 4 tiles and start over. When drawing each tile I set a timer as well, and I progressively reduce the tile size as the timers expire before I'm done, until I hit some minimum tile size at which expiring timers do not cause a tile shrink. I would keep rendering at that tiling level as long as the redraw of each tile takes more than 1/4 of the time limit.
A simple and relatively cheap method, similar to your proposal, which I for some time was thinking of trying, would be to start by testing, from top to bottom, if any object in the repaint buffer covers it completely and has no opacity and filters; if yes, then discard objects below it and render only from this object up.
The action of pruning invisible objects is useful in itself. If it could be done without rendering, only by considering the geometry and style of the objects, we could add it to "Vacuum defs" (which should be named "Clean up document" and do a few things more than it does at present, for example remove broken references).
Regards, Krzysztof