Bug 263171 - Experimental paintop is slow
Summary: Experimental paintop is slow
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: git master (please specify the git hash!)
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 20:49 UTC by LukasT
Modified: 2012-11-20 16:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LukasT 2011-01-14 20:49:39 UTC
Version:           svn trunk (using KDE 4.5.5) 
OS:                Linux

Painting with the experimental paintop is slow and flickers if the painted shape is huge

Reproducible: Always



Expected Results:  
Faster response
Comment 1 Dmitry Kazakov 2011-01-15 11:15:29 UTC
I would say the following about this bug ;)
http://old.nabble.com/About-the-experimental-paintop-optimization-td30535002.html
Comment 2 LukasT 2011-01-15 16:15:45 UTC
That advice is nice. I finally got it and it works only in one case -- when you do not use tablet or when you turn off the opacity sensor .. I mean when the opacity of the whole shape is not changed. It also does not work with some options where the shape is preprocessed and post-processed and the whole shape is changed in one dab.

I also tried your idea with the transaction, but it had slower performance but no flickering. I will clean up some patch and post it.
Comment 3 LukasT 2011-02-26 17:23:00 UTC
Git commit fd141b2788f6cc518eb0175858253c37e07aa89b by Luk���� Tvrd��.
Committed on 26/02/2011 at 17:16.
Pushed by lukast into branch 'master'.

Fix flickering of the experimental paintop

o render the shape on the internal device
o move the rendering of the polygon to separate class
  and improve the performance
o fix the bug with speed option

CCBUG:263171

M  +1    -0    krita/plugins/paintops/experiment/CMakeLists.txt     
M  +68   -144  krita/plugins/paintops/experiment/kis_experiment_paintop.cpp     
M  +14   -12   krita/plugins/paintops/experiment/kis_experiment_paintop.h     
A  +143  -0    krita/plugins/paintops/experiment/kis_fixed_painter.cpp         [License: GPL (v2+)]
A  +48   -0    krita/plugins/paintops/experiment/kis_fixed_painter.h         [License: GPL (v2+)]

http://commits.kde.org/calligra/fd141b2788f6cc518eb0175858253c37e07aa89b
Comment 4 Halla Rempt 2012-02-29 12:41:28 UTC
Maybe the best thing we can do here is first generate a preview on the canvas, and only on mouse-up actually translate that to the paint device?
Comment 5 Dmitry Kazakov 2012-11-11 11:16:09 UTC
David Revoy reported that this paintop is important to him and its speed is the reason why he doesn't use it right now, so I'll try to take a look into this bug.
Comment 6 Dmitry Kazakov 2012-11-18 11:44:39 UTC
Git commit 79eef41f0b1fbcc3e2cecb85347bfd71e8a88144 by Dmitry Kazakov.
Committed on 18/11/2012 at 12:43.
Pushed by dkazakov into branch 'krita-new-move-tool-kazakov'.

Fixed KisExperimentPaintOp to be much faster

Implemented an idea which we discussed long-long ago. The updates are
coming now only for the areas that really changed. In this tool the
changed area can be easily represented as a set of triangles. These
triangles are then split into a set of rectangles and the path is
rendered for these areas only.

Notes:
+ now the tool can be used by artists for real work
+ smoothing and speed options work perfectly
- mirroring doesn't work right now (will be fixed in the next patch)
- displacement doesn't work (I've disabled it, because efficient
  implementation of it may take some time). I'll do it only if
  artists will really need it.

M  +11   -9    krita/image/kis_painter.cc
M  +8    -0    krita/image/kis_painter.h
M  +150  -118  krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
M  +18   -34   krita/plugins/paintops/experiment/kis_experiment_paintop.h
M  +5    -12   krita/plugins/paintops/experiment/kis_experiment_paintop_settings.cpp
M  +0    -5    krita/plugins/paintops/experiment/kis_experiment_paintop_settings.h
M  +1    -9    krita/plugins/paintops/experiment/kis_experiment_paintop_settings_widget.cpp
M  +1    -8    krita/plugins/paintops/experiment/kis_experiment_paintop_settings_widget.h
M  +55   -16   krita/plugins/paintops/experiment/kis_experimentop_option.cpp
M  +15   -6    krita/plugins/paintops/experiment/kis_experimentop_option.h
M  +55   -29   krita/plugins/paintops/experiment/wdgexperimentoptions.ui

http://commits.kde.org/calligra/79eef41f0b1fbcc3e2cecb85347bfd71e8a88144
Comment 7 Dmitry Kazakov 2012-11-18 15:08:56 UTC
Git commit 89ae3e70452bd703d6b2bb1b63bebf9c125769c4 by Dmitry Kazakov.
Committed on 18/11/2012 at 16:08.
Pushed by dkazakov into branch 'krita-new-move-tool-kazakov'.

Fixed a KisExperimentalPaintOp to work with mirroring

M  +56   -35   krita/image/kis_painter.cc
M  +13   -8    krita/image/kis_painter.h
M  +0    -1    krita/plugins/paintops/experiment/CMakeLists.txt
M  +25   -4    krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
M  +4    -1    krita/plugins/paintops/experiment/kis_experiment_paintop.h
M  +1    -1    krita/plugins/paintops/experiment/kis_experimentop_option.cpp
D  +0    -142  krita/plugins/paintops/experiment/kis_fixed_painter.cpp
D  +0    -48   krita/plugins/paintops/experiment/kis_fixed_painter.h
M  +6    -1    krita/ui/tool/kis_resources_snapshot.cpp

http://commits.kde.org/calligra/89ae3e70452bd703d6b2bb1b63bebf9c125769c4
Comment 8 David REVOY 2012-11-18 20:58:36 UTC
I don't know if the kind of comment I'll write here is productive, necessary or wanted, but ;
### THANK YOU ! ###
Comment 9 Halla Rempt 2012-11-18 22:22:04 UTC
Encouragement is always welcome!
Comment 10 Dmitry Kazakov 2012-11-20 16:13:47 UTC
Git commit 54ff87423b632758b88159d8effa81cc98d72fc2 by Dmitry Kazakov.
Committed on 18/11/2012 at 12:43.
Pushed by dkazakov into branch 'calligra/2.6'.

Fixed KisExperimentPaintOp to be much faster

Implemented an idea which we discussed long-long ago. The updates are
coming now only for the areas that really changed. In this tool the
changed area can be easily represented as a set of triangles. These
triangles are then split into a set of rectangles and the path is
rendered for these areas only.

Notes:
+ now the tool can be used by artists for real work
+ smoothing and speed options work perfectly
- mirroring doesn't work right now (will be fixed in the next patch)
- displacement doesn't work (I've disabled it, because efficient
  implementation of it may take some time). I'll do it only if
  artists will really need it.

M  +11   -9    krita/image/kis_painter.cc
M  +8    -0    krita/image/kis_painter.h
M  +150  -118  krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
M  +18   -34   krita/plugins/paintops/experiment/kis_experiment_paintop.h
M  +5    -12   krita/plugins/paintops/experiment/kis_experiment_paintop_settings.cpp
M  +0    -5    krita/plugins/paintops/experiment/kis_experiment_paintop_settings.h
M  +1    -9    krita/plugins/paintops/experiment/kis_experiment_paintop_settings_widget.cpp
M  +1    -8    krita/plugins/paintops/experiment/kis_experiment_paintop_settings_widget.h
M  +55   -16   krita/plugins/paintops/experiment/kis_experimentop_option.cpp
M  +15   -6    krita/plugins/paintops/experiment/kis_experimentop_option.h
M  +55   -29   krita/plugins/paintops/experiment/wdgexperimentoptions.ui

http://commits.kde.org/calligra/54ff87423b632758b88159d8effa81cc98d72fc2
Comment 11 Dmitry Kazakov 2012-11-20 16:13:47 UTC
Git commit 24a9c9929176d5d8687351a23703f97584c8654e by Dmitry Kazakov.
Committed on 18/11/2012 at 16:08.
Pushed by dkazakov into branch 'calligra/2.6'.

Fixed a KisExperimentalPaintOp to work with mirroring

M  +56   -35   krita/image/kis_painter.cc
M  +13   -8    krita/image/kis_painter.h
M  +0    -1    krita/plugins/paintops/experiment/CMakeLists.txt
M  +25   -4    krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
M  +4    -1    krita/plugins/paintops/experiment/kis_experiment_paintop.h
M  +1    -1    krita/plugins/paintops/experiment/kis_experimentop_option.cpp
D  +0    -142  krita/plugins/paintops/experiment/kis_fixed_painter.cpp
D  +0    -48   krita/plugins/paintops/experiment/kis_fixed_painter.h
M  +6    -1    krita/ui/tool/kis_resources_snapshot.cpp

http://commits.kde.org/calligra/24a9c9929176d5d8687351a23703f97584c8654e