Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2022-01-11 10:10:36 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2022-01-11 10:11:14 +0300
commitfd922f59404fa67d921691eac83288503f164b32 (patch)
treee3c8d6929f4c8d9640da99ce6577b21dbd70f792 /source/blender/nodes/composite/nodes/node_composite_color_spill.cc
parentf2fb9a0c59ab64358301e4d98ba35b5f122a0eaf (diff)
Cleanup: Composite nodes: add namespace for every file
This puts all static functions in composite node files into a new namespace. This allows using unity build which can improve compile times significantly. This is a follow up on rB1df8abff257030ba79bc23dc321f35494f4d91c5 but for compositor nodes. The namespace name is derived from the file name. That makes it possible to write some tooling that checks the names later on. The filename extension (`cc`) is added to the namespace name as well. his also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file. Reviewed By: JacquesLucke, HooglyBoogly, jbakker Differential Revision: https://developer.blender.org/D13466
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_color_spill.cc')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_color_spill.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc
index 187b1dfdfc5..1ee7686a8b1 100644
--- a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc
@@ -30,7 +30,7 @@
/* ******************* Color Spill Suppression ********************************* */
-namespace blender::nodes {
+namespace blender::nodes::node_composite_color_spill_cc {
static void cmp_node_color_spill_declare(NodeDeclarationBuilder &b)
{
@@ -39,8 +39,6 @@ static void cmp_node_color_spill_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Color>(N_("Image"));
}
-} // namespace blender::nodes
-
static void node_composit_init_color_spill(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeColorspill *ncs = MEM_cnew<NodeColorspill>(__func__);
@@ -98,14 +96,18 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C)
}
}
+} // namespace blender::nodes::node_composite_color_spill_cc
+
void register_node_type_cmp_color_spill()
{
+ namespace file_ns = blender::nodes::node_composite_color_spill_cc;
+
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE);
- ntype.declare = blender::nodes::cmp_node_color_spill_declare;
- ntype.draw_buttons = node_composit_buts_color_spill;
- node_type_init(&ntype, node_composit_init_color_spill);
+ ntype.declare = file_ns::cmp_node_color_spill_declare;
+ ntype.draw_buttons = file_ns::node_composit_buts_color_spill;
+ node_type_init(&ntype, file_ns::node_composit_init_color_spill);
node_type_storage(
&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage);