Bug 387071

Summary: Bristle engine performance issues in wrap around mode
Product: [Applications] krita Reporter: Alvin Wong <alvin>
Component: Brush Engine/BristleAssignee: Krita Bugs <krita-bugs-null>
Status: REOPENED ---    
Severity: normal CC: freebox64, ghevan, halla
Priority: NOR    
Version First Reported In: 3.3.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Wrap around mode slow paint performance if stroke made outside orignal image area

Description Alvin Wong 2017-11-18 14:35:51 UTC
Bristle engine performance is very bad when drawn outside of main canvas in wrap around mode, unlike when drawing inside the main canvas area it is very smooth.

Also affects master.
Comment 1 Halla Rempt 2017-11-23 09:25:58 UTC
Hm... Running Krita in valgrind to see whether something weird happens when painting outside the main canvas doesn't show anything. I do see the performance degradation, though.
Comment 2 mvowada 2018-01-20 18:28:54 UTC
(I can confirm on Ubuntu 14.04 - Krita 4.0.0-beta1.1.appimage, as well)
Comment 3 Halla Rempt 2019-05-10 08:15:50 UTC
I'm not sure what happened, but with a 512x512 texture, neither on Linux (32 gb T40p) nor on Windows (SP3, Windows 10) do I see any slowdown anymore. Of course, we did do a lot of performance work since 2017...
Comment 4 vanyossi 2019-05-10 23:40:49 UTC
Created attachment 119971 [details]
Wrap around mode slow paint performance if stroke made outside orignal image area

doesn't look like a bristle performance to me, but an OpenGL performace

The effect of this can be shown with a bigger texture, and a crappier graphics card. I use an Intel laptop Iris 6100. which by its own makes painting worse if another monitor is attached.

The strange part of this is: It really is slower to render the painting if the stroke is made the wrapped part (outside the original image area).

See attached video.


I don't mark as confirmed as this probably is expected to happen on slow systems.
Comment 5 Alvin Wong 2019-05-13 09:06:00 UTC
(I thought it might've been related to coordinates handling with the pixel iterators used in wraparound mode, perhaps with all the division and rounding... but I can't confirm anything.)

I just tried this again with a new build using a new file at 1600x1200px and while the performance is indeed way better, the updating of the brush stroke gets all blocky when drawing outside the main canvas. And the weird thing is that after having drawn outside the main canvas, the blocky update remains even when drawing on the main canvas area (which hadn't appeared before drawing outside the main canvas).

I don't feel that it's an issue with OpenGL performance, but I'll need to experiment a bit more. Reopening for now...