*
* @param[in] updateBufferIndex The current update buffer index.
* @param[in] node The current node of the scene-graph.
- * @param[in] parentVisibilityChanged The parent node's visibility was changed at current frame.
+ * @param[in] parentVisibilityChanged The parent node's visibility might be changed at current frame. (Due to visibility property, or ancient's clipping mode change)
* @param[in] currentLayer The current layer containing lists of opaque/transparent renderables.
* @param[in] renderTask The current render-task.
* @param[in] inheritedDrawMode The draw mode of the parent
parentVisibilityChanged = true;
}
+ // If the node's clipping mode is changed, we need to mark all descendent nodes as updated
+ if(node.IsClippingModeChanged())
+ {
+ parentVisibilityChanged = true;
+ }
+
if(parentVisibilityChanged)
{
node.SetUpdated(true);
#define DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Flag whether property has changed, during the Update phase.
*/
enum class NodePropertyFlags : uint8_t
-// 8 bits is enough for 6 flags (compiler will check it)
+// 8 bits is enough for 7 flags (compiler will check it)
{
NOTHING = 0x000,
TRANSFORM = 0x001,
CHILD_DELETED = 0x008,
CHILDREN_REORDER = 0x010,
DESCENDENT_HIERARCHY_CHANGED = 0x020,
- ALL = (DESCENDENT_HIERARCHY_CHANGED << 1) - 1 // all the flags
+ CLIPPING_MODE = 0x040,
+ ALL = (CLIPPING_MODE << 1) - 1 // all the flags
};
struct NodeDepthPair
class Node;
// Flags which require the scene renderable lists to be updated
-static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED;
+static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED | NodePropertyFlags::CLIPPING_MODE;
/**
* Node is the base class for all nodes in the Scene Graph.
*/
void SetClippingMode(const ClippingMode::Type clippingMode)
{
- mClippingMode = clippingMode;
- SetDirtyFlag(NodePropertyFlags::TRANSFORM);
+ if(mClippingMode != clippingMode)
+ {
+ mClippingMode = clippingMode;
+ SetDirtyFlag(NodePropertyFlags::CLIPPING_MODE);
+ }
}
/**
return mDirtyFlags & NodePropertyFlags::DESCENDENT_HIERARCHY_CHANGED;
}
+ /**
+ * @brief Get whether clipping mode was changed.
+ * @note It will be reset when mDirtyFlag reseted.
+ * @return True if current node's clipping mode was changed.
+ */
+ bool IsClippingModeChanged() const
+ {
+ return mDirtyFlags & NodePropertyFlags::CLIPPING_MODE;
+ }
+
/**
* @brief Propagate the heirarchy changeness flag to it's parent node.
*/