Bug 423150 - Layer Style Stroke - Layer Duplication Loses Color
Summary: Layer Style Stroke - Layer Duplication Loses Color
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: layer styles (show other bugs)
Version: 4.3.0
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-06-18 12:04 UTC by KST
Modified: 2020-07-15 09:33 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 KST 2020-06-18 12:04:48 UTC
SUMMARY

Duplicating {Layer Style > Stroke Applied}Layer will lose color and only duplicate the stroke. Close and re-Open the file will show normally.


STEPS TO REPRODUCE
1. Apply Layer Style > Stroke
2. Duplicate the applied layer
3. Hide the old layer.

OBSERVED RESULT

Color has disappeared

EXPECTED RESULT

Color should appear

Video of the bug:
https://youtu.be/Xs9QZrBxNtE


Krita

 Version: 4.3.0
 Languages: en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.18362
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce GT 740/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 432.00" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::sRGBColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: false
Comment 1 Ahab Greybeard 2020-06-19 15:01:07 UTC
I can confirm this for the 4.3.0 and 18 Jun 5.0.0 prealpha (git a98fccf) appimages.

If the layer style of the duplicated layer is turned off then the original colours are restored but they vanish again if the layer style is turned back on.

If the duplicated layer has its layer style window opened (with no further action needed), then the colours are restored and remain restored after Cancel is pressed on the layer style window.
Comment 2 Ahab Greybeard 2020-06-21 16:57:57 UTC
This does not happen with the 4.2.9 appimage.

A user has reported a similar situation for the Colour Overlay layer style here:
https://krita-artists.org/t/bug-the-layer-copied-in-krita-4-3-0-will-become-abnormal/8699
In that case, after opening and Cancelling the layer style window, turning off the background layer is sometimes needed to restore the correct appearance.

Using the Bevel and Emboss layer style, there is a problem with the appearance if the layer is duplicated, which shows similar requirements for 'recovery'.

I haven't investigated any other layer styles.
Comment 3 Dmitry Kazakov 2020-06-26 15:35:53 UTC
Git commit 263b547da09f625568cd1ddab89e770542bbb675 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:35.
Pushed by dkazakov into branch 'krita/4.3'.

Fix cloning of a stroke layers style with "center" position

It was obviously a copy-paste mistake :)

M  +9    -1    libs/image/layerstyles/kis_layer_style_projection_plane.cpp

https://invent.kde.org/graphics/krita/commit/263b547da09f625568cd1ddab89e770542bbb675
Comment 4 Dmitry Kazakov 2020-06-26 15:35:53 UTC
Git commit 426b4313bff86ba0c2c8d3d05f5f920c4e27c851 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:35.
Pushed by dkazakov into branch 'krita/4.3'.

Fix cloning of stroke layer style

KisLayerStyleKnockoutBlower should clone the internal selection
as well.

M  +10   -0    libs/image/layerstyles/KisLayerStyleKnockoutBlower.cpp
M  +3    -0    libs/image/layerstyles/KisLayerStyleKnockoutBlower.h
M  +1    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.cpp

https://invent.kde.org/graphics/krita/commit/426b4313bff86ba0c2c8d3d05f5f920c4e27c851
Comment 5 Dmitry Kazakov 2020-06-26 15:35:54 UTC
Git commit ccbadb281f5b475e39ae18571c8d0a654246a486 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:35.
Pushed by dkazakov into branch 'krita/4.3'.

Add a unittest for cloning layer styles

M  +46   -10   libs/image/tests/kis_layer_style_projection_plane_test.cpp

https://invent.kde.org/graphics/krita/commit/ccbadb281f5b475e39ae18571c8d0a654246a486
Comment 6 Dmitry Kazakov 2020-06-26 15:35:59 UTC
Git commit 0641afda61b663a38788bca57aa91aecd171730d by Dmitry Kazakov.
Committed on 26/06/2020 at 15:35.
Pushed by dkazakov into branch 'krita/4.3'.

Fix a thread-safety problem in Stroke layer style

It should not write into a knockout-selection outside its
applyRect, becasue there are no thread-safety guarantees outside it.

M  +14   -14   libs/image/layerstyles/kis_ls_stroke_filter.cpp

https://invent.kde.org/graphics/krita/commit/0641afda61b663a38788bca57aa91aecd171730d
Comment 7 Dmitry Kazakov 2020-06-26 15:42:11 UTC
Git commit c77027bbae9e8c4d26a8eb364d5df7ff99d65cd9 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:36.
Pushed by dkazakov into branch 'master'.

Fix cloning of a stroke layers style with "center" position

It was obviously a copy-paste mistake :)

M  +9    -1    libs/image/layerstyles/kis_layer_style_projection_plane.cpp

https://invent.kde.org/graphics/krita/commit/c77027bbae9e8c4d26a8eb364d5df7ff99d65cd9
Comment 8 Dmitry Kazakov 2020-06-26 15:42:11 UTC
Git commit ea9daff5a71a1fb817c87778d88129c2a462ea07 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:36.
Pushed by dkazakov into branch 'master'.

Fix cloning of stroke layer style

KisLayerStyleKnockoutBlower should clone the internal selection
as well.

M  +10   -0    libs/image/layerstyles/KisLayerStyleKnockoutBlower.cpp
M  +3    -0    libs/image/layerstyles/KisLayerStyleKnockoutBlower.h
M  +1    -0    libs/image/layerstyles/kis_layer_style_filter_projection_plane.cpp

https://invent.kde.org/graphics/krita/commit/ea9daff5a71a1fb817c87778d88129c2a462ea07
Comment 9 Dmitry Kazakov 2020-06-26 15:42:11 UTC
Git commit a37cbcec401cab859c240037e3f377e12dbbd757 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:40.
Pushed by dkazakov into branch 'master'.

Fix a thread-safety problem in Stroke layer style

It should not write into a knockout-selection outside its
applyRect, becasue there are no thread-safety guarantees outside it.

# Conflicts:
#	libs/image/layerstyles/kis_ls_stroke_filter.cpp

M  +15   -14   libs/image/layerstyles/kis_ls_stroke_filter.cpp

https://invent.kde.org/graphics/krita/commit/a37cbcec401cab859c240037e3f377e12dbbd757
Comment 10 Dmitry Kazakov 2020-06-26 15:42:11 UTC
Git commit 689fe924c56712ee1986269fdbace1c7450f7549 by Dmitry Kazakov.
Committed on 26/06/2020 at 15:41.
Pushed by dkazakov into branch 'master'.

Add a unittest for cloning layer styles

M  +46   -10   libs/image/tests/kis_layer_style_projection_plane_test.cpp

https://invent.kde.org/graphics/krita/commit/689fe924c56712ee1986269fdbace1c7450f7549
Comment 11 Dmitry Kazakov 2020-06-26 15:45:07 UTC
The bug is fixed now (and two more different bugs).
Comment 12 Halla Rempt 2020-07-15 09:33:05 UTC
Git commit 8ac480cba8d7bf9feece348f6944f89880737779 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 15/07/2020 at 08:53.
Pushed by rempt into branch 'krita/4.3.0'.

Add a unittest for cloning layer styles
(cherry picked from commit 689fe924c56712ee1986269fdbace1c7450f7549)

M  +46   -10   libs/image/tests/kis_layer_style_projection_plane_test.cpp

https://invent.kde.org/graphics/krita/commit/8ac480cba8d7bf9feece348f6944f89880737779