Globalized a ton of stuff, able to queue-ify flood fill

The queue grows ever large, and should shrink itself once
as the queue gets consumed.  In the meantime, it seems to help.

At 3000x2000, with starters/mosaic.svg cut into four via Panels
magic tool, I get a VERY complicated drawing, which no longer
causes a crash.

(It crashed for me, even after some other improvements -- globalizing
many of the unchanging args to the recursive function, calling the
progress bar animation and sound effects calls less frequently --
helped prevent crashing for me with that starter image as-is.)
This commit is contained in:
Bill Kendrick 2021-11-20 01:17:17 -08:00
parent e06ead84c5
commit 5cfc185d77
2 changed files with 161 additions and 179 deletions

View file

@ -197,10 +197,13 @@ $Id$
(e.g., when returning from the "Open" dialog).
(Closes https://sourceforge.net/p/tuxpaint/feature-requests/186/)
* WIP - Attempt to void crashing (by blowing up the stack) when doing
a flood-fill of a complicated shape on a large canvas
(e.g., `tuxpaint --3000x2000` with `starters/mosaic.svg`).
(h/t Yang for reporting, and Pere for confirming)
* Avoid possibility of crashing when doing a flood-fill of a
complicated shape on a large canvas (e.g., `tuxpaint --3000x2000`
with `starters/mosaic.svg`
+ Replace recursion with a queue (span filling method)
+ Call the progress bar animation updates and playsound() function
less frequently
h/t Yang for reporting & Pere for confirming
* Ports & Building
----------------