Bug 435255 - Transforming is laggy compared to 4.x
Summary: Transforming is laggy compared to 4.x
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
: 438245 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-04-02 10:31 UTC by acc4commissions
Modified: 2021-06-09 13:53 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 acc4commissions 2021-04-02 10:31:56 UTC
SUMMARY
krita-nightly-x64-5.0.0-prealpha-2522006fe8

The title says it all, and it seems that the progress reporting on the layer is updated with every actions with Transform Tool and even with zooming actions while transforming. 

In 4.x krita, there's 0 delay.

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: Win10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 tomtomtomreportingin 2021-04-03 08:13:39 UTC
By default, Krita 5.0 uses a new in-stack preview for more accurate rendering during the transformation. This comes with a performance trade-off.

Does going to Settings -> Configure Krita -> Performance -> Instant Preview and disabling in-stack preview solve your problem with the performance?
Comment 2 acc4commissions 2021-04-03 12:24:44 UTC
Yes, it fixed the problem. So this is intentional?

Even with the instant preview it doesn't seem 'instant' at all...
Comment 3 Bug Janitor Service 2021-04-04 04:33:44 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 4 Tiar 2021-05-10 20:29:36 UTC
I think that it's slower even with both of those options unchecked, compared to Krita 4.4.3.
Comment 5 Halla Rempt 2021-05-11 09:52:27 UTC
Yes, it will always be slower, because the new preview means the image has to be recomposited for every change.
Comment 6 Tiar 2021-05-11 09:56:38 UTC
@Halla - but without "in-stack compositing" turned on? I think it should work just as before. Unless I forgot about some other preview changes?
Comment 7 Dmitry Kazakov 2021-05-21 04:54:08 UTC
Hi, acc4commissions!

To have instant preview for the transform tool you need to have two conditions satisfied:

1) The canvas should be in OpenGL mode
2) Either zoom level should be lower than 50% or the transformed piece should be bigger than 2000px in size.

If any of these conditions is false, then Krita does full stack recalculation on any change to the transformation. That is kind of expected behavior :(

If your image satisfies these conditions, but is still slow, please attach a video, so I could dig a bit deeper :)

I'll mark the bug as "needsinfo" for now.

PS:

@Tiar: 
> but without "in-stack compositing" turned on?

acc4commissions has confirmed that with overlay preview the problem goes away, so it is just the new mode is slower.
Comment 8 acc4commissions 2021-05-23 10:41:37 UTC
(In reply to Dmitry Kazakov from comment #7)

> To have instant preview for the transform tool you need to have two
> conditions satisfied:
> 
> 1) The canvas should be in OpenGL mode
> 2) Either zoom level should be lower than 50% or the transformed piece
> should be bigger than 2000px in size.
> 
> If any of these conditions is false, then Krita does full stack
> recalculation on any change to the transformation. That is kind of expected
> behavior :(
> 
> If your image satisfies these conditions, but is still slow, please attach a
> video, so I could dig a bit deeper :)
> 

So basically I tested every senario That I think it's possible and all of them showed the same behaviour and performance. In every cases the prograss bar in the layers updated with every move I make while transforming something.

The only case Krita showed the same behaviour to 4.x was when I turned off the 'Use In-stack preview in Transform Tool'.

I'll try to make a video and attach it later.
Comment 9 Bug Janitor Service 2021-05-24 04:33:42 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 10 Dmitry Kazakov 2021-05-24 07:55:59 UTC
Hi, @acc4commissions!

> The only case Krita showed the same behaviour to 4.x was when I turned off the 'Use In-stack preview in Transform Tool'

That is exactly the expected behavior. When you switch it off, Krita switches into the old mode and stops previewing any blending mode and masking of the layer. When you enable this option, Krita starts previewing the result inside the layer stack, basically, rerendering the whole image on every change. In some sense, the transform tool now works in exactly the same way as Move Tool.
Comment 11 acc4commissions 2021-05-24 08:16:24 UTC
(In reply to Dmitry Kazakov from comment #10)
> Hi, @acc4commissions!
> 
> > The only case Krita showed the same behaviour to 4.x was when I turned off the 'Use In-stack preview in Transform Tool'
> 
> That is exactly the expected behavior. When you switch it off, Krita
> switches into the old mode and stops previewing any blending mode and
> masking of the layer. When you enable this option, Krita starts previewing
> the result inside the layer stack, basically, rerendering the whole image on
> every change. In some sense, the transform tool now works in exactly the
> same way as Move Tool.

Does that mean, in Krita 5, the layer will be updated with every transforming moves even when I'm transforming it with 'instant preview'? That part is where I felt it's a bit odd.
Comment 12 Dmitry Kazakov 2021-05-24 08:25:50 UTC
Yes, in Krita 5 the layer will be updated every time you change the transformation to give you better preview. This behavior is activated by "Use in-stack transform preview".

Additionally, if you have openGL enabled and either of the two is true: 1) zoom < 50% or 2) selected piece is bigger than 2000px, then Instant Preview will be triggered and speed up the update by doing lower quality preview. But this preview will still happen inside the layer stack, so the layer will still be updated on every change, just much faster.
Comment 13 Dmitry Kazakov 2021-06-09 13:52:37 UTC
*** Bug 438245 has been marked as a duplicate of this bug. ***
Comment 14 Dmitry Kazakov 2021-06-09 13:53:05 UTC
Git commit fe6826768d392f24dd25aee386c570b65f4c7ccc by Dmitry Kazakov.
Committed on 09/06/2021 at 13:52.
Pushed by dkazakov into branch 'master'.

Fix initialization of the user preferences in the transform tool

We cannot read settings in the contructor, because the toolId() is
not yet available (due to the absence of factory() pointer set).

So the patch moves this initialization into activate() method,
which is mode stable.

M  +5    -1    plugins/tools/tool_transform2/kis_tool_transform.cc

https://invent.kde.org/graphics/krita/commit/fe6826768d392f24dd25aee386c570b65f4c7ccc