Bug 437950

Summary: Huge pattern size slows down the whole brush editor
Product: [Applications] krita Reporter: Tiar <tamtamy.tymona>
Component: Brush enginesAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, mirandagraphic
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tiar 2021-06-01 11:58:28 UTC
SUMMARY
When a huge pattern is selected in Texture->Pattern tab in brush editor, the rest of the editor is very very slow. Most probably because either there is no signal compressor, or even with the signal compressor the rate of repainting a stroke is too high for Krita to be able to paint it.
Note that the same brush doesn't really have trouble painting on the canvas in small sizes.

STEPS TO REPRODUCE
1. Download Flow's bundle 1.0 from here: https://krita-artists.org/t/flows-mixer-concept-brushes-v1-1-work-in-progress-krita-5/24304 . If it cannot be downloaded, any big pattern (1024x1024, or maybe 2048x2048) in .jpg format (not sure if format is important) will do.
2. Select f) Bristles-3 Large Smooth.
3. Confirm you can change the Spacing in Brush Tip tab easily.
4. Select "TheFlow Canvas 01".


OBSERVED RESULT
All sliders are super slow now. See Brush Tip -> Spacing, for example.
If you close the editor (with still usually high Spacing) and start painting, you'll see that the brush is painting with usual speed (very responsive).

EXPECTED RESULT
All sliders are still fast and responsive.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git 626af155fb)
 Languages: pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.4.0-58-generic
  Pretty Productname: Linux Mint 20.1
  Product Type: linuxmint
  Product Version: 20.1
  Desktop: X-Cinnamon

OpenGL Info
 
  Vendor:  "Intel" 
  Renderer:  "Mesa Intel(R) Iris(R) Plus Graphics (ICL GT2)" 
  Version:  "4.0 (Compatibility Profile) Mesa 20.2.6" 
  Shading language:  "4.60" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.0
     Supports deprecated functions true 
     is OpenGL ES: false
Comment 1 Tiar 2021-06-01 12:00:09 UTC
This is probably a similar issue to bug 436731, but the fix will probably have to be different (and note that the effects are a bit different: here there is no slowdown on the brush, that happens with big brush tips in the other bug report).
Comment 2 Tiar 2021-06-01 22:48:59 UTC
Confirmed by other people for example here: https://krita-artists.org/t/flows-mixer-concept-brushes-v1-1-work-in-progress-krita-5/24304/14, quote from Ramon:
> Pattern in 1024px is a not useful in this case for me, because not more perceived detail is added. and is hard when you tweak values. Even a newcomer could think Krita is frozen for a couple of seconds.
Comment 3 Tiar 2021-08-20 20:17:56 UTC
Related to bug 428090.
Comment 4 Dmitry Kazakov 2021-09-30 11:23:07 UTC
Hi, Tiar!

Could you please test the bug in the today's master with my start-slowdown fixes? I cannot reproduce the bug here...

https://invent.kde.org/graphics/krita/commit/cebb525047f5e51cb5ff6290e4ad0f81f3816c13
Comment 5 Dmitry Kazakov 2021-09-30 11:23:45 UTC
*** Bug 428090 has been marked as a duplicate of this bug. ***
Comment 6 Dmitry Kazakov 2021-10-06 12:39:23 UTC
I cannot reproduce this bug in master now. I think it has been fixed as part of brush caching refactoring.

I'm closing the bug. If you happen to reproduce it again, please reopen it.