Bug 399723

Summary: A visual glitch when using multiple views of the same document and soft proofing
Product: [Applications] krita Reporter: 8172635
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version First Reported In: 4.1.5   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: The subwindow displays some gray blocks around a newly drawn line, which should display as dark red

Description 8172635 2018-10-12 15:11:49 UTC
Created attachment 115601 [details]
The subwindow displays some gray blocks around a newly drawn line, which should display as dark red

If two different views of the same file are used while one of them has soft proofing turned on, the non-soft proofed view may end up showing parts of the other view. Seems to only occur when previously created KRA files are used. Doesn't seem to occur when editing newly created KRA files (until re-opening them) or with different file formats (PNG, JPG, PSD)

STEPS TO REPRODUCE
1. Open an existing KRA file
2. Create two different views of the same file 
3. Turn on soft proofing for one of the views
4. Draw something or edit the image in any other way

OBSERVED RESULT

Parts of the view with no soft proofing show the soft-proofed image (see attachment).
Comment 1 Halla Rempt 2018-10-14 09:28:15 UTC
I haven't seen it happen myself. Does this also happen for you if you disable canvas acceleration? 

If so, I think that this might be caused by Krita using the same textures for both views, which we do to save memory.
Comment 2 8172635 2018-10-23 14:48:41 UTC
(In reply to Boudewijn Rempt from comment #1)
> I haven't seen it happen myself. Does this also happen for you if you
> disable canvas acceleration? 
> 
> If so, I think that this might be caused by Krita using the same textures
> for both views, which we do to save memory.

I can't reproduce it with canvas acceleration turned off, but for a very different reason – I can't get soft proofing to work that way. It shows the 'Soft Proofing turned on' message, but the view doesn't change at all. Not sure if that's some problem on my side or just the way it works. 

Using the same textures for both views might explain it, but why does it only occur after opening a previously created KRA file? Shouldn't it be the same for all formats and even newly created files?
Comment 3 8172635 2018-11-04 20:19:20 UTC
Some extra details:

- I tested this with some more file types, and it really seems to occur only with KRA files, but only if it's a previously saved file that has been re-opened

- Can't reproduce it with canvas acceleration turned off, because I can't get soft proofing to work without canvas acceleration

- The problem gets temporary solved after turning soft proofing on and off for the subwindow that's supposed to have it turned off. The problem reoccurs as soon as soft proofing is turned off and on again for the other window.
Comment 4 Dmitry Kazakov 2021-12-01 10:13:28 UTC
Git commit 02f37d0514e6b5e6ed9fed86a5fa2680ab2e2b25 by Dmitry Kazakov, on behalf of Mathias Wein.
Committed on 01/12/2021 at 10:06.
Pushed by dkazakov into branch 'master'.

Fix soft proofing settings affecting other views

Contrary to the description, setProofingOptions() was messing with the
options stored inside the image.
Updating settings also avoids unnecessary canvas updates now when
soft proofing is not active.

M  +2    -2    libs/ui/KisView.cpp
M  +30   -23   libs/ui/canvas/kis_canvas2.cpp
M  +7    -5    libs/ui/canvas/kis_canvas2.h

https://invent.kde.org/graphics/krita/commit/02f37d0514e6b5e6ed9fed86a5fa2680ab2e2b25
Comment 5 Dmitry Kazakov 2021-12-01 10:23:18 UTC
Git commit 09713f2840d4ce831aab9cc576d7f44bfd1255f7 by Dmitry Kazakov, on behalf of Mathias Wein.
Committed on 01/12/2021 at 10:16.
Pushed by dkazakov into branch 'krita/5.0'.

Fix soft proofing settings affecting other views

Contrary to the description, setProofingOptions() was messing with the
options stored inside the image.
Updating settings also avoids unnecessary canvas updates now when
soft proofing is not active.
(cherry picked from commit 02f37d0514e6b5e6ed9fed86a5fa2680ab2e2b25)

M  +2    -2    libs/ui/KisView.cpp
M  +30   -23   libs/ui/canvas/kis_canvas2.cpp
M  +7    -5    libs/ui/canvas/kis_canvas2.h

https://invent.kde.org/graphics/krita/commit/09713f2840d4ce831aab9cc576d7f44bfd1255f7