Bug 408169

Summary: Transparent pattern fill layer renders incorrect on load
Product: [Applications] krita Reporter: Carl Olsson <carl.olsson>
Component: GeneralAssignee: vanyossi <ghevan>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard, ghevan
Priority: NOR    
Version: 4.2.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Above: after setting pattern, Below: after loading

Description Carl Olsson 2019-06-01 06:08:01 UTC
Created attachment 120466 [details]
Above: after setting pattern, Below: after loading

SUMMARY
When loading a document with a pattern fill layer where the pattern is 1-bit or has alpha transparency it is rendered incorrectly as though the pattern Grid01.pat is rendered first, then the correct pattern is rendered over the top with transparency.

It doesn't appear to happen with opaque (greyscale) patterns.

STEPS TO REPRODUCE
1. Add fill layer with 1-bit pattern (eg. Stripes04.pat)
2. Observe correct pattern rendering
3. Save as Krita document
4. Close document
5. Reopen document

OBSERVED RESULT
Renders with what looks like Grid01.pat under selected pattern

EXPECTED RESULT
Render with selected pattern only

SOFTWARE/OS VERSIONS
Windows: Microsoft Windows 10 Pro 10.0.17763 Build 17763
Comment 1 Ahab Greybeard 2019-06-02 03:37:59 UTC
This bug seems related: https://bugs.kde.org/show_bug.cgi?id=402978
Comment 2 vanyossi 2019-06-07 04:15:43 UTC
I can confirm this bug for 1bit patterns
Comment 3 vanyossi 2019-06-07 15:02:58 UTC
Git commit 92a9a440f3a9876678ea309bf984467b33157406 by Ivan Yossi.
Committed on 07/06/2019 at 14:35.
Pushed by ivany into branch 'master'.

Remove update on creating a generator fill layer.

This avoids drawing the path twice on load, update is made only from setFilter
which is also called on document load. If done from the creator it draws
the default pattern first and then overlays the saved pattern.

M  +0    -1    libs/image/generator/kis_generator_layer.cpp

https://invent.kde.org/kde/krita/commit/92a9a440f3a9876678ea309bf984467b33157406
Comment 4 Halla Rempt 2019-06-13 06:33:14 UTC
Git commit e8b0a914257ed15c465eba1462aeb3b6ce92ef79 by Boudewijn Rempt, on behalf of Ivan Yossi.
Committed on 13/06/2019 at 06:00.
Pushed by rempt into branch 'krita/4.2'.

Remove update on creating a generator fill layer.

This avoids drawing the path twice on load, update is made only from setFilter
which is also called on document load. If done from the creator it draws
the default pattern first and then overlays the saved pattern.

M  +0    -1    libs/image/generator/kis_generator_layer.cpp

https://invent.kde.org/kde/krita/commit/e8b0a914257ed15c465eba1462aeb3b6ce92ef79