From 36427a8d03673a8604d3ec4b30be709e86fe6312 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 2 Apr 2021 16:13:27 +0200 Subject: Cleanup: remove loading blender namespace from Vector. --- .../blender/compositor/intern/COM_ExecutionGroup.h | 6 +++--- .../compositor/intern/COM_ExecutionSystem.cc | 14 +++++++------- .../compositor/intern/COM_ExecutionSystem.h | 8 ++++---- source/blender/compositor/intern/COM_Node.h | 8 ++++---- source/blender/compositor/intern/COM_NodeGraph.cc | 4 ++-- source/blender/compositor/intern/COM_NodeGraph.h | 11 +++++------ .../blender/compositor/intern/COM_NodeOperation.h | 4 ++-- .../compositor/intern/COM_NodeOperationBuilder.cc | 22 +++++++++++----------- .../compositor/intern/COM_NodeOperationBuilder.h | 8 ++++---- .../blender/compositor/intern/COM_WorkScheduler.cc | 4 ++-- 10 files changed, 44 insertions(+), 45 deletions(-) (limited to 'source/blender/compositor/intern') diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index f9cbceffd3e..cb593feabb0 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -92,7 +92,7 @@ class ExecutionGroup { /** * \brief list of operations in this ExecutionGroup */ - blender::Vector m_operations; + Vector m_operations; ExecutionGroupFlags m_flags; @@ -136,7 +136,7 @@ class ExecutionGroup { /** * \brief All read operations of this execution group. */ - blender::Vector m_read_operations; + Vector m_read_operations; /** * \brief reference to the original bNodeTree, @@ -153,7 +153,7 @@ class ExecutionGroup { /** * \brief m_work_packages holds all unit of work. */ - blender::Vector m_work_packages; + Vector m_work_packages; /** * \brief denotes boundary for border compositing diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cc b/source/blender/compositor/intern/COM_ExecutionSystem.cc index cb8c1b9326d..e22dc17837b 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cc +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cc @@ -119,14 +119,14 @@ ExecutionSystem::~ExecutionSystem() this->m_groups.clear(); } -void ExecutionSystem::set_operations(const blender::Vector &operations, - const blender::Vector &groups) +void ExecutionSystem::set_operations(const Vector &operations, + const Vector &groups) { m_operations = operations; m_groups = groups; } -static void update_read_buffer_offset(blender::Vector &operations) +static void update_read_buffer_offset(Vector &operations) { unsigned int order = 0; for (NodeOperation *operation : operations) { @@ -138,7 +138,7 @@ static void update_read_buffer_offset(blender::Vector &operatio } } -static void init_write_operations_for_execution(blender::Vector &operations, +static void init_write_operations_for_execution(Vector &operations, const bNodeTree *bTree) { for (NodeOperation *operation : operations) { @@ -149,7 +149,7 @@ static void init_write_operations_for_execution(blender::Vector } } -static void link_write_buffers(blender::Vector &operations) +static void link_write_buffers(Vector &operations) { for (NodeOperation *operation : operations) { if (operation->get_flags().is_read_buffer_operation) { @@ -159,7 +159,7 @@ static void link_write_buffers(blender::Vector &operations) } } -static void init_non_write_operations_for_execution(blender::Vector &operations, +static void init_non_write_operations_for_execution(Vector &operations, const bNodeTree *bTree) { for (NodeOperation *operation : operations) { @@ -170,7 +170,7 @@ static void init_non_write_operations_for_execution(blender::Vector &groups, +static void init_execution_groups_for_execution(Vector &groups, const int chunk_size) { for (ExecutionGroup *execution_group : groups) { diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h index 672bda68668..e6170c48778 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.h +++ b/source/blender/compositor/intern/COM_ExecutionSystem.h @@ -129,12 +129,12 @@ class ExecutionSystem { /** * \brief vector of operations */ - blender::Vector m_operations; + Vector m_operations; /** * \brief vector of groups */ - blender::Vector m_groups; + Vector m_groups; private: // methods public: @@ -159,8 +159,8 @@ class ExecutionSystem { */ ~ExecutionSystem(); - void set_operations(const blender::Vector &operations, - const blender::Vector &groups); + void set_operations(const Vector &operations, + const Vector &groups); /** * \brief execute this system diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h index a16e71a9b27..28b59397af9 100644 --- a/source/blender/compositor/intern/COM_Node.h +++ b/source/blender/compositor/intern/COM_Node.h @@ -65,12 +65,12 @@ class Node { /** * \brief the list of actual input-sockets \see NodeInput */ - blender::Vector inputs; + Vector inputs; /** * \brief the list of actual output-sockets \see NodeOutput */ - blender::Vector outputs; + Vector outputs; public: Node(bNode *editorNode, bool create_sockets = true); @@ -115,7 +115,7 @@ class Node { /** * \brief get access to the vector of input sockets */ - const blender::Vector &getInputSockets() const + const Vector &getInputSockets() const { return this->inputs; } @@ -123,7 +123,7 @@ class Node { /** * \brief get access to the vector of input sockets */ - const blender::Vector &getOutputSockets() const + const Vector &getOutputSockets() const { return this->outputs; } diff --git a/source/blender/compositor/intern/COM_NodeGraph.cc b/source/blender/compositor/intern/COM_NodeGraph.cc index 7e05bf637b7..1907022e0ec 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.cc +++ b/source/blender/compositor/intern/COM_NodeGraph.cc @@ -156,7 +156,7 @@ void NodeGraph::add_bNode(const CompositorContext &context, NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_socket) { - for (blender::Vector::iterator it = node_range.first; it != node_range.second; ++it) { + for (Vector::iterator it = node_range.first; it != node_range.second; ++it) { Node *node = *it; for (NodeOutput *output : node->getOutputSockets()) { if (output->getbNodeSocket() == b_socket) { @@ -187,7 +187,7 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink return; } - for (blender::Vector::iterator it = node_range.first; it != node_range.second; ++it) { + for (Vector::iterator it = node_range.first; it != node_range.second; ++it) { Node *node = *it; for (NodeInput *input : node->getInputSockets()) { if (input->getbNodeSocket() == b_nodelink->tosock && !input->isLinked()) { diff --git a/source/blender/compositor/intern/COM_NodeGraph.h b/source/blender/compositor/intern/COM_NodeGraph.h index 9347df5d9e2..68bba7b1007 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.h +++ b/source/blender/compositor/intern/COM_NodeGraph.h @@ -52,18 +52,18 @@ class NodeGraph { }; private: - blender::Vector m_nodes; - blender::Vector m_links; + Vector m_nodes; + Vector m_links; public: NodeGraph(); ~NodeGraph(); - const blender::Vector &nodes() const + const Vector &nodes() const { return m_nodes; } - const blender::Vector &links() const + const Vector &links() const { return m_links; } @@ -71,8 +71,7 @@ class NodeGraph { void from_bNodeTree(const CompositorContext &context, bNodeTree *tree); protected: - typedef std::pair::iterator, blender::Vector::iterator> - NodeRange; + typedef std::pair::iterator, Vector::iterator> NodeRange; static bNodeSocket *find_b_node_input(bNode *b_node, const char *identifier); static bNodeSocket *find_b_node_output(bNode *b_node, const char *identifier); diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index a613955d21a..783c1fd63c8 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -252,8 +252,8 @@ struct NodeOperationFlags { class NodeOperation { private: std::string m_name; - blender::Vector m_inputs; - blender::Vector m_outputs; + Vector m_inputs; + Vector m_outputs; /** * \brief the index of the input socket that will be used to determine the resolution diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc index b1e1424f14e..717602d04ab 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc @@ -254,7 +254,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer) void NodeOperationBuilder::add_datatype_conversions() { - blender::Vector convert_links; + Vector convert_links; for (const Link &link : m_links) { /* proxy operations can skip data type conversion */ NodeOperation *from_op = &link.from()->getOperation(); @@ -285,7 +285,7 @@ void NodeOperationBuilder::add_operation_input_constants() /* Note: unconnected inputs cached first to avoid modifying * m_operations while iterating over it */ - blender::Vector pending_inputs; + Vector pending_inputs; for (NodeOperation *op : m_operations) { for (int k = 0; k < op->getNumberOfInputSockets(); ++k) { NodeOperationInput *input = op->getInputSocket(k); @@ -353,7 +353,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input, void NodeOperationBuilder::resolve_proxies() { - blender::Vector proxy_links; + Vector proxy_links; for (const Link &link : m_links) { /* don't replace links from proxy to proxy, since we may need them for replacing others! */ if (link.from()->getOperation().get_flags().is_proxy_operation && @@ -403,7 +403,7 @@ void NodeOperationBuilder::determineResolutions() /* add convert resolution operations when needed */ { - blender::Vector convert_links; + Vector convert_links; for (const Link &link : m_links) { if (link.to()->getResizeMode() != ResizeMode::None) { NodeOperation &from_op = link.from()->getOperation(); @@ -419,10 +419,10 @@ void NodeOperationBuilder::determineResolutions() } } -blender::Vector NodeOperationBuilder::cache_output_links( +Vector NodeOperationBuilder::cache_output_links( NodeOperationOutput *output) const { - blender::Vector inputs; + Vector inputs; for (const Link &link : m_links) { if (link.from() == output) { inputs.append(link.to()); @@ -487,7 +487,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation, NodeOperationOutput *output) { /* cache connected sockets, so we can safely remove links first before replacing them */ - blender::Vector targets = cache_output_links(output); + Vector targets = cache_output_links(output); if (targets.is_empty()) { return; } @@ -538,7 +538,7 @@ void NodeOperationBuilder::add_complex_operation_buffers() /* note: complex ops and get cached here first, since adding operations * will invalidate iterators over the main m_operations */ - blender::Vector complex_ops; + Vector complex_ops; for (NodeOperation *operation : m_operations) { if (operation->get_flags().complex) { complex_ops.append(operation); @@ -593,7 +593,7 @@ void NodeOperationBuilder::prune_operations() } /* delete unreachable operations */ - blender::Vector reachable_ops; + Vector reachable_ops; for (NodeOperation *op : m_operations) { if (reachable.find(op) != reachable.end()) { reachable_ops.append(op); @@ -607,7 +607,7 @@ void NodeOperationBuilder::prune_operations() } /* topological (depth-first) sorting of operations */ -static void sort_operations_recursive(blender::Vector &sorted, +static void sort_operations_recursive(Vector &sorted, Tags &visited, NodeOperation *op) { @@ -628,7 +628,7 @@ static void sort_operations_recursive(blender::Vector &sorted, void NodeOperationBuilder::sort_operations() { - blender::Vector sorted; + Vector sorted; sorted.reserve(m_operations.size()); Tags visited; diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.h b/source/blender/compositor/intern/COM_NodeOperationBuilder.h index 8e5ec58c3be..6eaeded0fbe 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.h +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.h @@ -68,9 +68,9 @@ class NodeOperationBuilder { const CompositorContext *m_context; NodeGraph m_graph; - blender::Vector m_operations; - blender::Vector m_links; - blender::Vector m_groups; + Vector m_operations; + Vector m_links; + Vector m_groups; /** Maps operation inputs to node inputs */ blender::Map m_input_map; @@ -134,7 +134,7 @@ class NodeOperationBuilder { void determineResolutions(); /** Helper function to store connected inputs for replacement */ - blender::Vector cache_output_links(NodeOperationOutput *output) const; + Vector cache_output_links(NodeOperationOutput *output) const; /** Find a connected write buffer operation to an OpOutput */ WriteBufferOperation *find_attached_write_buffer_operation(NodeOperationOutput *output) const; /** Add read/write buffer operations around complex operations */ diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cc b/source/blender/compositor/intern/COM_WorkScheduler.cc index 55114e6b72a..c940fe897b4 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cc +++ b/source/blender/compositor/intern/COM_WorkScheduler.cc @@ -72,7 +72,7 @@ static struct { /** \brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is * created */ - blender::Vector devices; + Vector devices; /** \brief list of all thread for every CPUDevice in cpudevices a thread exists. */ ListBase threads; @@ -91,7 +91,7 @@ static struct { cl_program program; /** \brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice * is created. */ - blender::Vector devices; + Vector devices; /** \brief list of all thread for every GPUDevice in cpudevices a thread exists. */ ListBase threads; /** \brief all scheduled work for the GPU. */ -- cgit v1.2.3