diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-11 10:10:36 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-11 10:11:14 +0300 |
commit | fd922f59404fa67d921691eac83288503f164b32 (patch) | |
tree | e3c8d6929f4c8d9640da99ce6577b21dbd70f792 /source/blender/nodes/composite/nodes/node_composite_antialiasing.cc | |
parent | f2fb9a0c59ab64358301e4d98ba35b5f122a0eaf (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_antialiasing.cc')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_antialiasing.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc b/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc index b42b219ced9..fcc04a85b38 100644 --- a/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc +++ b/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc @@ -30,7 +30,7 @@ /* **************** Anti-Aliasing (SMAA 1x) ******************** */ -namespace blender::nodes { +namespace blender::nodes::node_composite_antialiasing_cc { static void cmp_node_antialiasing_declare(NodeDeclarationBuilder &b) { @@ -38,8 +38,6 @@ static void cmp_node_antialiasing_declare(NodeDeclarationBuilder &b) b.add_output<decl::Color>(N_("Image")); } -} // namespace blender::nodes - static void node_composit_init_antialiasing(bNodeTree *UNUSED(ntree), bNode *node) { NodeAntiAliasingData *data = MEM_cnew<NodeAntiAliasingData>(__func__); @@ -62,16 +60,20 @@ static void node_composit_buts_antialiasing(uiLayout *layout, bContext *UNUSED(C uiItemR(col, ptr, "corner_rounding", 0, nullptr, ICON_NONE); } +} // namespace blender::nodes::node_composite_antialiasing_cc + void register_node_type_cmp_antialiasing() { + namespace file_ns = blender::nodes::node_composite_antialiasing_cc; + static bNodeType ntype; cmp_node_type_base(&ntype, CMP_NODE_ANTIALIASING, "Anti-Aliasing", NODE_CLASS_OP_FILTER); - ntype.declare = blender::nodes::cmp_node_antialiasing_declare; - ntype.draw_buttons = node_composit_buts_antialiasing; + ntype.declare = file_ns::cmp_node_antialiasing_declare; + ntype.draw_buttons = file_ns::node_composit_buts_antialiasing; ntype.flag |= NODE_PREVIEW; node_type_size(&ntype, 170, 140, 200); - node_type_init(&ntype, node_composit_init_antialiasing); + node_type_init(&ntype, file_ns::node_composit_init_antialiasing); node_type_storage( &ntype, "NodeAntiAliasingData", node_free_standard_storage, node_copy_standard_storage); |