Cleanup: GPv3: Move inline Drawing methods

Moves the `blender::bke::greasepencil::Drawing` methods into the
`namespace blender::bke::greasepencil`.
This commit is contained in:
Falk David
2023-08-14 17:46:55 +02:00
parent ba574097b8
commit 2661747138

View File

@@ -504,6 +504,22 @@ class LayerGroup : public ::GreasePencilLayerTreeGroup {
void tag_nodes_cache_dirty() const;
};
inline void Drawing::add_user() const
{
this->runtime->user_count.fetch_add(1, std::memory_order_relaxed);
}
inline void Drawing::remove_user() const
{
this->runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
}
inline bool Drawing::is_instanced() const
{
return this->runtime->user_count.load(std::memory_order_relaxed) > 1;
}
inline bool Drawing::has_users() const
{
return this->runtime->user_count.load(std::memory_order_relaxed) > 0;
}
inline const TreeNode &LayerGroup::as_node() const
{
return *reinterpret_cast<const TreeNode *>(this);
@@ -568,26 +584,6 @@ class GreasePencilRuntime {
} // namespace blender::bke
inline void blender::bke::greasepencil::Drawing::add_user() const
{
this->runtime->user_count.fetch_add(1, std::memory_order_relaxed);
}
inline void blender::bke::greasepencil::Drawing::remove_user() const
{
this->runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
}
inline bool blender::bke::greasepencil::Drawing::is_instanced() const
{
return this->runtime->user_count.load(std::memory_order_relaxed) > 1;
}
inline bool blender::bke::greasepencil::Drawing::has_users() const
{
return this->runtime->user_count.load(std::memory_order_relaxed) > 0;
}
inline blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap()
{
return *reinterpret_cast<blender::bke::greasepencil::Drawing *>(this);