Program crashes when scrolling large canvas
Description
Creating a large canvas makes everything laggy. I can see from the activity monitor that drawing uses 12% of my 4/8 core processor (100% of one core) which probably means everything is being done in a single thread.
I'd like to point out that the 1800x3600 empty canvas lags a lot on scroll.
After scrolling for a while (with no visual feedback) the app crashes and this is the output:
➜ ~ flatpak run com.github.maoschanz.drawing
Gdk-Message: 14:19:48.175: Lost connection to Wayland compositor.
Knowing GTK and GTK development I can safely say that this is caused due to heavy computations in the same thread as your GTK app is running.
Steps to reproduce the bug:
- Create a 1800x3600 canvas
- Scroll around
System
- Laptop, R7 3700U @4GHz 8Gb RAM
- OS: Fedora 31, kernel 5.4.10-200
- Desktop environment: GNOME 3.34.3
- Package format (flatpak, native package, snap?): Flatpak 1.4.3
- App version: 0.4.10
Wow, I believe your next release will close this issue. Just downloaded master, built it and it runs smoothly!

More seriously, the next version has several major differences concerning tools and bottom panels... but displaying images on the canvas? No, that part didn't change that much, and everything is still on the same single thread.
So i don't believe the bug is fixed. Maybe you need bigger images to trigger it, but it's still there. ~~You can also saturate the memory with the history, and undoing something is still a spectacular failure~~ not anymore!
- [x] Methods to count frames per second
- [x] show it in the infobar
- [x] dev-only action to enable/disable it (disabled by default)
- [x] Don't render all frames (method
DrImage.on_motion_on_area)- [x] pass down the info to each tool