Bug 355104 - Canvas lag if zoomed in and rotated to a specific degree
Summary: Canvas lag if zoomed in and rotated to a specific degree
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: 2.9.8
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL: http://3kv.in/~techbot/ShareX/2015/11...
Keywords:
: 357765 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-09 20:34 UTC by Matthäus Egorov
Modified: 2016-04-20 04:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
dxdiag output (78.32 KB, text/plain)
2015-11-13 16:38 UTC, Matthäus Egorov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthäus Egorov 2015-11-09 20:34:49 UTC
When you rotate your Canvas by around 20-40 degrees in any direction and you're zoomed by a good amount the Canvas starts to get noticeable slower while dragging using the middle Mouse Button.
It works fine on any other Angle or if you Zoom out just a bit and on smaller sized canvases.

I couldn't test this on other Systems so it might also just be a Windows only issue.

Reproducible: Always

Steps to Reproduce:
1. Create a new Document with a relatively large format like A3.
2. Draw something so you can actually see the Canvas move
3. Zoom in to about 1000% 
4. Rotate Canvas by about 20-40° degrees in any direction.
5. Try panning your View, it should be noticeable slower than usual.  

Actual Results:  
Canvas is lagging/slowing down while dragging.

Expected Results:  
No impact at all.

I was actually on Version 2.9.9 (git 88fa8c9) (Steam Version), but I couldn't find it on the Drop-down Menu.
Comment 1 Halla Rempt 2015-11-10 08:09:52 UTC
Hi Matthäus,

Thanks for your report. Is this with opengl enabled or disabled?
Comment 2 Matthäus Egorov 2015-11-10 14:14:37 UTC
Hi,

I had OpenGL enabled, it's worse with it off.
Comment 3 Dmitry Kazakov 2015-11-13 08:26:51 UTC
Hi, Matthaeus!

Could you tell, what CPU and GPU model do you have?
Comment 4 Matthäus Egorov 2015-11-13 16:38:47 UTC
Created attachment 95482 [details]
dxdiag output
Comment 5 Dmitry Kazakov 2015-11-14 11:18:18 UTC
Hi, Matthaeus!

Could you please make a video, which compares the update speed on rotated and non-rotated canvas with openGL enabled?

I just checked on my Linux build and it seems that the update throughput on rotated canvas is, yes, a bit slower 50fps instead of 80 fps on non-rotated canvas, but our glSync check should make this slowness *not* lag, but tear the image a bit. So I would like to see a video of the bug to understand what happens.
Comment 6 Matthäus Egorov 2015-11-14 11:52:03 UTC
I attached it as "URL" when I created this bug report, but I made another one just in case.

http://3kv.in/~techbot/ShareX/2015/11/14/2015-11-14%2012-47-35.mp4

the weird thing about it is, if I zoom in further it's fine again.
It only seems to happen at a specific zoomlevel.
Comment 7 Halla Rempt 2015-11-14 13:56:21 UTC
That sounds like we're hitting a limit on the gpu and the gpu memory at those points.
Comment 8 Dmitry Kazakov 2016-03-25 12:09:45 UTC
Git commit 08fd3aa8e554557728f60f8571e51364070c09e8 by Dmitry Kazakov.
Committed on 25/03/2016 at 12:08.
Pushed by dkazakov into branch 'master'.

Fix "openGL lag at zoom 2000 + rotation"

The problem was not related to the openGL actualy. It was caused
by the implementation of QPainter::clipRegion() which generated
20k+ rectangles from a rotated rect when rotation angle was near to
a 0 or 90deg.

WARNING for the future:
Never use QPainter::clipRegion(). Use KisPaintingUtils::safeClipRegion()
instead. It workarounds the issue returning a bit bigger rect.

Fixes T1446
CC:kimageshop@kde.org

M  +3    -1    libs/flake/KoShapeContainer.cpp
M  +3    -1    libs/flake/KoShapeManager.cpp
M  +0    -3    libs/flake/tools/KoCreateShapeStrategy.cpp
M  +0    -2    libs/flake/tools/KoShapeRubberSelectStrategy.cpp
M  +1    -0    libs/global/CMakeLists.txt
A  +51   -0    libs/global/kis_painting_tweaks.cpp     [License: GPL (v2+)]
A  +45   -0    libs/global/kis_painting_tweaks.h     [License: GPL (v2+)]
M  +4    -1    plugins/flake/textshape/TextShape.cpp
M  +2    -1    plugins/flake/textshape/textlayout/KoTextLayoutArea_paint.cpp
M  +3    -1    plugins/flake/vectorshape/VectorShape.cpp

http://commits.kde.org/krita/08fd3aa8e554557728f60f8571e51364070c09e8
Comment 9 Raghavendra kamath 2016-04-20 04:21:50 UTC
*** Bug 357765 has been marked as a duplicate of this bug. ***