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_chroma_matte.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_chroma_matte.cc')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
index be27f747af0..a85cdd05b14 100644
--- a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc
@@ -28,7 +28,7 @@
/* ******************* Chroma Key ********************************************************** */
-namespace blender::nodes {
+namespace blender::nodes::node_composite_chroma_matte_cc {
static void cmp_node_chroma_matte_declare(NodeDeclarationBuilder &b)
{
@@ -38,8 +38,6 @@ static void cmp_node_chroma_matte_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Float>(N_("Matte"));
}
-} // namespace blender::nodes
-
static void node_composit_init_chroma_matte(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeChroma *c = MEM_cnew<NodeChroma>(__func__);
@@ -67,15 +65,19 @@ static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C
// uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
}
+} // namespace blender::nodes::node_composite_chroma_matte_cc
+
void register_node_type_cmp_chroma_matte()
{
+ namespace file_ns = blender::nodes::node_composite_chroma_matte_cc;
+
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_CHROMA_MATTE, "Chroma Key", NODE_CLASS_MATTE);
- ntype.declare = blender::nodes::cmp_node_chroma_matte_declare;
- ntype.draw_buttons = node_composit_buts_chroma_matte;
+ ntype.declare = file_ns::cmp_node_chroma_matte_declare;
+ ntype.draw_buttons = file_ns::node_composit_buts_chroma_matte;
ntype.flag |= NODE_PREVIEW;
- node_type_init(&ntype, node_composit_init_chroma_matte);
+ node_type_init(&ntype, file_ns::node_composit_init_chroma_matte);
node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage);
nodeRegisterType(&ntype);