Bug 410838 - [regression] Using move tool with lab 16 bit float is slow, and hangs krita when enabling instant preview
Summary: [regression] Using move tool with lab 16 bit float is slow, and hangs krita w...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Move (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 08:17 UTC by Raghavendra kamath
Modified: 2019-08-14 16:41 UTC (History)
0 users

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 Raghavendra kamath 2019-08-12 08:17:45 UTC
SUMMARY
When testing the HDR machine at sprint, I selected a part of character and started to move it, the machine although powerful started to slow things. I then tried to enable instant preview and the programm hung with the window going transparent.

The canvas size was A4 300ppi the color model was LAB 16 bit float. the monitor was HDR enabled. 

STEPS TO REPRODUCE
we weren't able to reproduce the hang but, the slowness in move tool was reproduced.


SOFTWARE/OS VERSIONS
Windows: windows 10

This might be probably related to this bug - https://bugs.kde.org/show_bug.cgi?id=400484

Also Dmitry said he had implemented something that might trigger this bug.
Comment 1 Dmitry Kazakov 2019-08-12 13:46:10 UTC
Git commit dcdef2ea1163a5b764e4bb9acebed95a0c52101f by Dmitry Kazakov.
Committed on 12/08/2019 at 13:45.
Pushed by dkazakov into branch 'master'.

Fix lags in Move Tool when using tablet device

Now the Move Tool uses the same FSP-limiting compression as the freehand
tool does. The relevant code has been moved into a special class
KisAsyncronousStrokeUpdateHelper, which implements a logic of issuing
threshold events.

Bascially, all the sources of event (tablet move and async update from
KisAsyncronousStrokeUpdateHelper) now try to initiate a canvas update.
If enough time has passed and previous updates has finished, then a new
update is started.

One more important change: now actual layer offset change is executed in
the same exclusive job as the updates (with limited FPS), therefore, it
avoids garbage-looking leftovers of the intemediate move states.

M  +5    -0    libs/image/kis_image.cc
M  +8    -0    libs/image/kis_image.h
M  +2    -0    libs/image/kis_image_interfaces.h
M  +5    -0    libs/image/kis_update_scheduler.cpp
M  +2    -0    libs/image/kis_update_scheduler.h
M  +1    -0    libs/ui/CMakeLists.txt
M  +3    -1    libs/ui/tests/FreehandStrokeBenchmark.cpp
M  +2    -1    libs/ui/tests/KisPaintOnTransparencyMaskTest.cpp
M  +2    -1    libs/ui/tests/freehand_stroke_test.cpp
A  +76   -0    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.cpp     [License: GPL (v2+)]
A  +85   -0    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.h     [License: GPL (v2+)]
M  +2    -1    libs/ui/tool/kis_figure_painting_tool_helper.cpp
M  +9    -20   libs/ui/tool/kis_tool_freehand_helper.cpp
M  +0    -1    libs/ui/tool/kis_tool_freehand_helper.h
M  +4    -2    libs/ui/tool/strokes/freehand_stroke.cpp
M  +0    -23   libs/ui/tool/strokes/freehand_stroke.h
M  +45   -11   libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +16   -2    libs/ui/tool/strokes/move_stroke_strategy.h
M  +3    -2    libs/ui/widgets/kis_preset_live_preview_view.cpp
M  +15   -0    plugins/tools/basictools/kis_tool_move.cc
M  +3    -0    plugins/tools/basictools/kis_tool_move.h

https://invent.kde.org/kde/krita/commit/dcdef2ea1163a5b764e4bb9acebed95a0c52101f
Comment 2 Dmitry Kazakov 2019-08-14 16:41:49 UTC
Git commit 435a5dbf3dfa5da450c517b77a162498b34fdf5b by Dmitry Kazakov.
Committed on 14/08/2019 at 16:21.
Pushed by dkazakov into branch 'krita/4.2'.

Fix lags in Move Tool when using tablet device

Now the Move Tool uses the same FSP-limiting compression as the freehand
tool does. The relevant code has been moved into a special class
KisAsyncronousStrokeUpdateHelper, which implements a logic of issuing
threshold events.

Bascially, all the sources of event (tablet move and async update from
KisAsyncronousStrokeUpdateHelper) now try to initiate a canvas update.
If enough time has passed and previous updates has finished, then a new
update is started.

One more important change: now actual layer offset change is executed in
the same exclusive job as the updates (with limited FPS), therefore, it
avoids garbage-looking leftovers of the intemediate move states.

M  +5    -0    libs/image/kis_image.cc
M  +8    -0    libs/image/kis_image.h
M  +2    -0    libs/image/kis_image_interfaces.h
M  +5    -0    libs/image/kis_update_scheduler.cpp
M  +2    -0    libs/image/kis_update_scheduler.h
M  +1    -0    libs/ui/CMakeLists.txt
M  +3    -1    libs/ui/tests/FreehandStrokeBenchmark.cpp
M  +2    -1    libs/ui/tests/KisPaintOnTransparencyMaskTest.cpp
M  +2    -1    libs/ui/tests/freehand_stroke_test.cpp
A  +76   -0    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.cpp     [License: GPL (v2+)]
A  +85   -0    libs/ui/tool/KisAsyncronousStrokeUpdateHelper.h     [License: GPL (v2+)]
M  +2    -1    libs/ui/tool/kis_figure_painting_tool_helper.cpp
M  +9    -20   libs/ui/tool/kis_tool_freehand_helper.cpp
M  +0    -1    libs/ui/tool/kis_tool_freehand_helper.h
M  +4    -2    libs/ui/tool/strokes/freehand_stroke.cpp
M  +0    -23   libs/ui/tool/strokes/freehand_stroke.h
M  +45   -11   libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +16   -2    libs/ui/tool/strokes/move_stroke_strategy.h
M  +3    -2    libs/ui/widgets/kis_preset_live_preview_view.cpp
M  +15   -0    plugins/tools/basictools/kis_tool_move.cc
M  +3    -0    plugins/tools/basictools/kis_tool_move.h

https://invent.kde.org/kde/krita/commit/435a5dbf3dfa5da450c517b77a162498b34fdf5b