Bug 384282 - Adjustment still render inside of a hidden group
Summary: Adjustment still render inside of a hidden group
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Filter Layers (show other bugs)
Version: 3.2.1
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-02 10:09 UTC by Nathan GDquest
Modified: 2017-09-26 14:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan GDquest 2017-09-02 10:09:27 UTC
Adjustment layers still update with every drawing operation if they're inside a hidden group, but the individual layers are set to visible. They don't affect the document, but it hits the drawing performances pretty hard. And when you toggle the group's visibility back on, often the adjustment layer will show an old composite of the document.

If you toggle the visibility off on the individual adjustment layers, they don't update, as expected.

It's convenient to put all compositing-related layers inside a separate group, at the top of the document. If you need to change the underlying painting, all you need is 1 click/key press to hide the group, and get back to it.
Comment 1 Halla Rempt 2017-09-19 13:24:34 UTC
Hi Nathan,

I can confirm the issue. Note: the group layer must be in pass-through mode.
Comment 2 Halla Rempt 2017-09-19 13:34:03 UTC
Another note: this patch _should_ help, but it doesn't:

diff --git a/libs/image/kis_base_node.cpp b/libs/image/kis_base_node.cpp
index 48d7e6adac..586d8bdb6d 100644
--- a/libs/image/kis_base_node.cpp
+++ b/libs/image/kis_base_node.cpp
@@ -224,7 +224,7 @@ bool KisBaseNode::visible(bool recursive) const
     KisBaseNodeSP parentNode = parentCallback();
 
     return recursive && isVisible && parentNode ?
-        parentNode->visible() : isVisible;
+        parentNode->visible(recursive) : isVisible;
 }
 
 void KisBaseNode::setVisible(bool visible, bool loading)
diff --git a/libs/image/kis_base_node.h b/libs/image/kis_base_node.h
index 54a15c1df7..f4991ffeaa 100644
--- a/libs/image/kis_base_node.h
+++ b/libs/image/kis_base_node.h
@@ -341,6 +341,9 @@ public:
      * @return true if this node is visible (i.e, active (except for
      * selection masks where visible and active properties are
      * different)) in the graph
+     *
+     * @param bool recursive if true, check whether all parents of
+     * this node are visible as well.
      */
     virtual bool visible(bool recursive = false) const;
 
diff --git a/libs/image/kis_layer.cc b/libs/image/kis_layer.cc
index 0ca50e4fc5..c5f0aa706e 100644
--- a/libs/image/kis_layer.cc
+++ b/libs/image/kis_layer.cc
@@ -663,7 +663,7 @@ QRect KisLayer::updateProjection(const QRect& rect, KisNodeSP filthyNode)
     QRect updatedRect = rect;
     KisPaintDeviceSP originalDevice = original();
     if (!rect.isValid() ||
-            !visible() ||
+            !visible(true) ||
             !originalDevice) return QRect();
 
     if (!needProjection() && !hasEffectMasks()) {
lines 1-40/40 (END)


We're really going to have to discuss this with Dmitry once he's done with his current work on making the pixel brush engine faster.
Comment 3 Dmitry Kazakov 2017-09-26 14:47:45 UTC
Git commit 43908f87d45b1a0b47965d96ab75ffb139340f0e by Dmitry Kazakov.
Committed on 26/09/2017 at 14:47.
Pushed by dkazakov into branch 'kazakov/multithreaded-brushes'.

Don't recalculate an adjustment layer, which is in invisible passthrough group

The great care should be taken when we show that window again. We should
fully recalculate it. Previously, the layer was considered to be in
"always-ready" state.

M  +15   -3    libs/image/commands/kis_node_property_list_command.cpp
M  +2    -2    libs/image/kis_async_merger.cpp

https://commits.kde.org/krita/43908f87d45b1a0b47965d96ab75ffb139340f0e
Comment 4 Dmitry Kazakov 2017-09-26 14:48:38 UTC
Git commit 6169d822f47d9b4298d724dcc81fd459af060a7d by Dmitry Kazakov.
Committed on 26/09/2017 at 14:48.
Pushed by dkazakov into branch 'master'.

Don't recalculate an adjustment layer, which is in invisible passthrough group

The great care should be taken when we show that window again. We should
fully recalculate it. Previously, the layer was considered to be in
"always-ready" state.

M  +15   -3    libs/image/commands/kis_node_property_list_command.cpp
M  +2    -2    libs/image/kis_async_merger.cpp

https://commits.kde.org/krita/6169d822f47d9b4298d724dcc81fd459af060a7d