diff options
Diffstat (limited to 'source/blender/compositor/intern')
16 files changed, 115 insertions, 74 deletions
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp index dbb05d4f493..abab4edfc3f 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.cpp +++ b/source/blender/compositor/intern/COM_CompositorContext.cpp @@ -33,7 +33,8 @@ CompositorContext::CompositorContext() { const int CompositorContext::getFramenumber() const { if (this->scene) { return this->scene->r.cfra; - } else { + } + else { return -1; /* this should never happen */ } } @@ -41,7 +42,8 @@ const int CompositorContext::getFramenumber() const { const int CompositorContext::isColorManaged() const { if (this->scene) { return this->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; - } else { + } + else { return 0; /* this should never happen */ } } diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index 56b1da97df8..ac57bf1cadc 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -361,15 +361,20 @@ void Converter::convertDataType(SocketConnection* connection, ExecutionSystem *s NodeOperation * converter = NULL; if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) { converter = new ConvertValueToColourProg(); - } else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) { + } + else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) { converter = new ConvertValueToVectorOperation(); - } else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) { + } + else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) { converter = new ConvertColourToValueProg(); - } else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) { + } + else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) { converter = new ConvertColorToVectorOperation(); - } else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) { + } + else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) { converter = new ConvertVectorToValueOperation(); - } else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) { + } + else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) { converter = new ConvertVectorToColorOperation(); } if (converter != NULL) { @@ -418,7 +423,8 @@ void Converter::convertResolution(SocketConnection *connection, ExecutionSystem scaleY = toHeight/fromHeight; if (scaleX < scaleY) { scaleX = scaleY; - } else { + } + else { scaleY = scaleX; } break; @@ -435,7 +441,7 @@ void Converter::convertResolution(SocketConnection *connection, ExecutionSystem NodeOperation *first = NULL; SocketConnection *c; ScaleOperation * scaleOperation = NULL; - if(doScale) { + if (doScale) { scaleOperation = new ScaleOperation(); first = scaleOperation; SetValueOperation * sxop = new SetValueOperation(); diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 22d4366a1a8..bce31658a8d 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -83,7 +83,8 @@ bool ExecutionGroup::canContainOperation(NodeOperation* operation) { if (!this->isComplex()) { return (!operation->isComplex()); - } else { + } + else { return false; } } @@ -101,7 +102,8 @@ void ExecutionGroup::addOperation(ExecutionSystem *system, NodeOperation *operat ReadBufferOperation* readOperation = (ReadBufferOperation*)operation; WriteBufferOperation* writeOperation = readOperation->getMemoryProxy()->getWriteBufferOperation(); this->addOperation(system, writeOperation); - } else { + } + else { unsigned int index; for (index = 0 ; index < operation->getNumberOfInputSockets(); index ++) { InputSocket * inputSocket = operation->getInputSocket(index); @@ -111,7 +113,8 @@ void ExecutionGroup::addOperation(ExecutionSystem *system, NodeOperation *operat } } } - } else { + } + else { if (operation->isWriteBufferOperation()) { WriteBufferOperation * writeoperation = (WriteBufferOperation*)operation; if (writeoperation->getMemoryProxy()->getExecutor() == NULL) { @@ -124,7 +127,7 @@ void ExecutionGroup::addOperation(ExecutionSystem *system, NodeOperation *operat } } -NodeOperation* ExecutionGroup::getOutputNodeOperation() const{ +NodeOperation* ExecutionGroup::getOutputNodeOperation() const { return this->operations[0]; // the first operation of the group is always the output operation. } @@ -328,11 +331,13 @@ void ExecutionGroup::execute(ExecutionSystem* graph) { finished=false; startEvaluated = true; numberEvaluated++; - } else if (state == COM_ES_SCHEDULED) { + } + else if (state == COM_ES_SCHEDULED) { finished=false; startEvaluated = true; numberEvaluated++; - } else if (state == COM_ES_EXECUTED && !startEvaluated) { + } + else if (state == COM_ES_EXECUTED && !startEvaluated) { startIndex = index+1; } } @@ -533,7 +538,8 @@ bool ExecutionGroup::scheduleChunkWhenPossible(ExecutionSystem * graph, int xChu if (!group->scheduleAreaWhenPossible(graph, &area)) { canBeExecuted = false; } - } else { + } + else { throw "ERROR"; } } diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index d82d725d234..b66a6a036b5 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -46,7 +46,8 @@ ExecutionSystem::ExecutionSystem(bNodeTree* editingtree, bool rendering) { /* initialize the CompositorContext */ if (rendering) { context.setQuality((CompositorQuality)editingtree->render_quality); - } else { + } + else { context.setQuality((CompositorQuality)editingtree->edit_quality); } context.setRendering(rendering); @@ -77,22 +78,22 @@ ExecutionSystem::ExecutionSystem(bNodeTree* editingtree, bool rendering) { ExecutionSystem::~ExecutionSystem() { unsigned int index; - for(index = 0; index < this->connections.size(); index++) { + for (index = 0; index < this->connections.size(); index++) { SocketConnection* connection = this->connections[index]; delete connection; } this->connections.clear(); - for(index = 0; index < this->nodes.size(); index++) { + for (index = 0; index < this->nodes.size(); index++) { Node* node = this->nodes[index]; delete node; } this->nodes.clear(); - for(index = 0; index < this->operations.size(); index++) { + for (index = 0; index < this->operations.size(); index++) { NodeOperation* operation = this->operations[index]; delete operation; } this->operations.clear(); - for(index = 0; index < this->groups.size(); index++) { + for (index = 0; index < this->groups.size(); index++) { ExecutionGroup* group = this->groups[index]; delete group; } @@ -101,7 +102,7 @@ ExecutionSystem::~ExecutionSystem() { void ExecutionSystem::execute() { unsigned int order = 0; - for( vector<NodeOperation*>::iterator iter = this->operations.begin(); iter != operations.end(); ++iter ) { + for ( vector<NodeOperation*>::iterator iter = this->operations.begin(); iter != operations.end(); ++iter ) { NodeBase* node = *iter; NodeOperation *operation = (NodeOperation*) node; if (operation->isReadBufferOperation()) { @@ -214,7 +215,7 @@ void ExecutionSystem::convertToOperations() { unsigned int index; // first determine data types of the nodes, this can be used by the node to convert to a different operation system this->determineActualSocketDataTypes((vector<NodeBase*>&)this->nodes); - for(index = 0; index < this->nodes.size(); index++) { + for (index = 0; index < this->nodes.size(); index++) { Node* node = (Node*)this->nodes[index]; node->convertToOperations(this, &this->context); } @@ -258,14 +259,14 @@ void ExecutionSystem::groupOperations() { NodeOperation * operation; unsigned int index; // surround complex operations with ReadBufferOperation and WriteBufferOperation - for(index = 0; index < this->operations.size(); index++) { + for (index = 0; index < this->operations.size(); index++) { operation = this->operations[index]; if (operation->isComplex()) { this->addReadWriteBufferOperations(operation); } } ExecutionSystemHelper::findOutputNodeOperations(&outputOperations, this->getOperations(), this->context.isRendering()); - for( vector<NodeOperation*>::iterator iter = outputOperations.begin(); iter != outputOperations.end(); ++iter ) { + for ( vector<NodeOperation*>::iterator iter = outputOperations.begin(); iter != outputOperations.end(); ++iter ) { operation = *iter; ExecutionGroup *group = new ExecutionGroup(); group->addOperation(this, operation); @@ -283,7 +284,7 @@ void ExecutionSystem::addSocketConnection(SocketConnection *connection) void ExecutionSystem::determineActualSocketDataTypes(vector<NodeBase*> &nodes) { unsigned int index; /* first do all input nodes */ - for(index = 0; index < nodes.size(); index++) { + for (index = 0; index < nodes.size(); index++) { NodeBase* node = nodes[index]; if (node->isInputNode()) { node->determineActualSocketDataTypes(); @@ -291,7 +292,7 @@ void ExecutionSystem::determineActualSocketDataTypes(vector<NodeBase*> &nodes) { } /* then all other nodes */ - for(index = 0; index < nodes.size(); index++) { + for (index = 0; index < nodes.size(); index++) { NodeBase* node = nodes[index]; if (!node->isInputNode()) { node->determineActualSocketDataTypes(); diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp index d6b03b41105..4a739ba6a9d 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp @@ -107,13 +107,14 @@ void ExecutionSystemHelper::findOutputNodeOperations(vector<NodeOperation*>* res static InputSocket* find_input(NodeRange &node_range, bNode *bnode, bNodeSocket* bsocket) { if (bnode != NULL) { - for(NodeIterator it=node_range.first; it!=node_range.second; ++it) { + for (NodeIterator it=node_range.first; it!=node_range.second; ++it) { Node* node = *it; if (node->getbNode() == bnode) return node->findInputSocketBybNodeSocket(bsocket); } - } else { - for(NodeIterator it=node_range.first; it!=node_range.second; ++it) { + } + else { + for (NodeIterator it=node_range.first; it!=node_range.second; ++it) { Node* node = *it; if (node->isProxyNode()) { InputSocket *proxySocket = node->getInputSocket(0); @@ -126,13 +127,14 @@ static InputSocket* find_input(NodeRange &node_range, bNode *bnode, bNodeSocket* } static OutputSocket* find_output(NodeRange &node_range, bNode *bnode, bNodeSocket* bsocket) { if (bnode != NULL) { - for(NodeIterator it=node_range.first; it!=node_range.second; ++it) { + for (NodeIterator it=node_range.first; it!=node_range.second; ++it) { Node* node = *it; if (node->getbNode() == bnode) return node->findOutputSocketBybNodeSocket(bsocket); } - } else { - for(NodeIterator it=node_range.first; it!=node_range.second; ++it) { + } + else { + for (NodeIterator it=node_range.first; it!=node_range.second; ++it) { Node* node = *it; if (node->isProxyNode()) { OutputSocket *proxySocket = node->getOutputSocket(0); @@ -146,7 +148,7 @@ static OutputSocket* find_output(NodeRange &node_range, bNode *bnode, bNodeSocke SocketConnection* ExecutionSystemHelper::addNodeLink(NodeRange &node_range, vector<SocketConnection*>& links, bNodeLink *bNodeLink) { /// @note: cyclic lines will be ignored. This has been copied from node.c if (bNodeLink->tonode != 0 && bNodeLink->fromnode != 0) { - if(!(bNodeLink->fromnode->level >= bNodeLink->tonode->level && bNodeLink->tonode->level!=0xFFF)) { // only add non cyclic lines! so execution will procede + if (!(bNodeLink->fromnode->level >= bNodeLink->tonode->level && bNodeLink->tonode->level!=0xFFF)) { // only add non cyclic lines! so execution will procede return NULL; } } @@ -221,15 +223,20 @@ void ExecutionSystemHelper::debugDump(ExecutionSystem* system) { } if (operation->isViewerOperation()) { printf("Viewer"); - } else if (operation->isOutputOperation(system->getContext().isRendering())) { + } + else if (operation->isOutputOperation(system->getContext().isRendering())) { printf("Output"); - } else if (operation->isSetOperation()) { + } + else if (operation->isSetOperation()) { printf("Set"); - } else if (operation->isReadBufferOperation()) { + } + else if (operation->isReadBufferOperation()) { printf("ReadBuffer"); - } else if (operation->isWriteBufferOperation()) { + } + else if (operation->isWriteBufferOperation()) { printf("WriteBuffer"); - } else { + } + else { printf("O_%p", operation); } tot2 = operation->getNumberOfOutputSockets(); @@ -287,7 +294,8 @@ void ExecutionSystemHelper::debugDump(ExecutionSystem* system) { printf("\t\"O_%p\":\"OUT_%p\" -> \"O_%p\":\"IN_%p\"", connection->getFromNode(), connection->getFromSocket(), connection->getToNode(), connection->getToSocket()); if (!connection->isValid()) { printf(" [color=red]"); - } else { + } + else { switch (connection->getFromSocket()->getActualDataType()) { case COM_DT_VALUE: printf(" [color=grey]"); diff --git a/source/blender/compositor/intern/COM_InputSocket.cpp b/source/blender/compositor/intern/COM_InputSocket.cpp index 9596d5b73b0..8428544cbc2 100644 --- a/source/blender/compositor/intern/COM_InputSocket.cpp +++ b/source/blender/compositor/intern/COM_InputSocket.cpp @@ -48,9 +48,10 @@ void InputSocket::setConnection(SocketConnection *connection) { SocketConnection* InputSocket::getConnection() {return this->connection;} void InputSocket::determineResolution(unsigned int resolution[],unsigned int preferredResolution[]) { - if (this->isConnected()){ + if (this->isConnected()) { this->connection->getFromSocket()->determineResolution(resolution, preferredResolution); - } else { + } + else { return; } } @@ -67,19 +68,24 @@ DataType InputSocket::convertToSupportedDataType(DataType datatype) { if (datatype == COM_DT_VALUE) { if (candoColor) { return COM_DT_COLOR; - } else if (candoVector) { + } + else if (candoVector) { return COM_DT_VECTOR; } - } else if (datatype == COM_DT_VECTOR) { + } + else if (datatype == COM_DT_VECTOR) { if (candoColor) { return COM_DT_COLOR; - } else if (candoValue) { + } + else if (candoValue) { return COM_DT_VALUE; } - } else if (datatype == COM_DT_COLOR) { + } + else if (datatype == COM_DT_COLOR) { if (candoVector) { return COM_DT_VECTOR; - } else if (candoValue) { + } + else if (candoValue) { return COM_DT_VALUE; } } @@ -115,7 +121,8 @@ void InputSocket::relinkConnections(InputSocket *relinkToSocket) { void InputSocket::relinkConnections(InputSocket *relinkToSocket, bool autoconnect, int editorNodeInputSocketIndex, bool duplicate, ExecutionSystem* graph) { if (!duplicate) { this->relinkConnections(relinkToSocket, autoconnect, editorNodeInputSocketIndex, graph); - } else { + } + else { if (!this->isConnected() && autoconnect) { Node* node = (Node*)this->getNode(); switch (this->getActualDataType()) { @@ -170,7 +177,8 @@ void InputSocket::relinkConnections(InputSocket *relinkToSocket, bool autoconnec const ChannelInfo* InputSocket::getChannelInfo(const int channelnumber) { if (this->isConnected() && this->connection->getFromSocket()) { return this->connection->getFromSocket()->getChannelInfo(channelnumber); - } else { + } + else { return NULL; } } @@ -191,7 +199,8 @@ SocketReader* InputSocket::getReader() { NodeOperation* InputSocket::getOperation() const { if (isConnected()) { return (NodeOperation*)this->connection->getFromSocket()->getNode(); - } else { + } + else { return NULL; } } diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 53357b8ec50..bfa20656277 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -247,7 +247,7 @@ static void imp2radangle(float A, float B, float C, float F, float* a, float* b, } } -float clipuv(float x, float limit){ +float clipuv(float x, float limit) { x = (x < 0) ? 0 : ((x >= limit) ? (limit - 1) : x); return x; } diff --git a/source/blender/compositor/intern/COM_MemoryManager.cpp b/source/blender/compositor/intern/COM_MemoryManager.cpp index fa587e8c7d6..661afb20d53 100644 --- a/source/blender/compositor/intern/COM_MemoryManager.cpp +++ b/source/blender/compositor/intern/COM_MemoryManager.cpp @@ -46,7 +46,7 @@ void MemoryManager::addMemoryProxy(MemoryProxy *memoryProxy) { memoryProxy->setState(state); } } -MemoryBuffer* MemoryManager::getMemoryBuffer(MemoryProxy *id, unsigned int chunkNumber){ +MemoryBuffer* MemoryManager::getMemoryBuffer(MemoryProxy *id, unsigned int chunkNumber) { MemoryManagerState * state = MemoryManager::getState(id); if (!state) { return NULL; diff --git a/source/blender/compositor/intern/COM_MemoryManagerState.cpp b/source/blender/compositor/intern/COM_MemoryManagerState.cpp index 56946c3f0f2..620092b2825 100644 --- a/source/blender/compositor/intern/COM_MemoryManagerState.cpp +++ b/source/blender/compositor/intern/COM_MemoryManagerState.cpp @@ -36,7 +36,7 @@ MemoryProxy * MemoryManagerState::getMemoryProxy() { MemoryManagerState::~MemoryManagerState() { this->memoryProxy = NULL; unsigned int index; - for (index = 0 ; index < this->currentSize; index ++){ + for (index = 0 ; index < this->currentSize; index ++) { MemoryBuffer* buffer = this->chunkBuffers[index]; if (buffer) { delete buffer; @@ -69,7 +69,8 @@ void MemoryManagerState::addMemoryBuffer(MemoryBuffer *buffer) { if (this->chunkBuffers[chunkNumber] == NULL) { this->chunkBuffers[chunkNumber] = buffer; - } else { + } + else { throw "ALREADY ALLOCATED!"; } BLI_mutex_unlock(&this->mutex); @@ -77,7 +78,7 @@ void MemoryManagerState::addMemoryBuffer(MemoryBuffer *buffer) { MemoryBuffer* MemoryManagerState::getMemoryBuffer(unsigned int chunkNumber) { MemoryBuffer* result = NULL; - if (chunkNumber< this->currentSize){ + if (chunkNumber< this->currentSize) { result = this->chunkBuffers[chunkNumber]; if (result) { return result; @@ -85,7 +86,7 @@ MemoryBuffer* MemoryManagerState::getMemoryBuffer(unsigned int chunkNumber) { } BLI_mutex_lock(&this->mutex); - if (chunkNumber< this->currentSize){ + if (chunkNumber< this->currentSize) { result = this->chunkBuffers[chunkNumber]; } diff --git a/source/blender/compositor/intern/COM_Node.cpp b/source/blender/compositor/intern/COM_Node.cpp index 2587eaa5195..4e127c61d4e 100644 --- a/source/blender/compositor/intern/COM_Node.cpp +++ b/source/blender/compositor/intern/COM_Node.cpp @@ -52,7 +52,7 @@ Node::Node(bNode* editorNode, bool create_sockets) { input = (bNodeSocket*)input->next; } bNodeSocket *output = (bNodeSocket*)editorNode->outputs.first; - while(output != NULL) { + while (output != NULL) { DataType dt = COM_DT_VALUE; if (output->type == SOCK_RGBA) dt = COM_DT_COLOR; if (output->type == SOCK_VECTOR) dt = COM_DT_VECTOR; diff --git a/source/blender/compositor/intern/COM_NodeBase.cpp b/source/blender/compositor/intern/COM_NodeBase.cpp index 6e6be889572..b6990ec0d79 100644 --- a/source/blender/compositor/intern/COM_NodeBase.cpp +++ b/source/blender/compositor/intern/COM_NodeBase.cpp @@ -33,7 +33,7 @@ NodeBase::NodeBase() { } -NodeBase::~NodeBase(){ +NodeBase::~NodeBase() { while (!this->outputsockets.empty()) { delete (this->outputsockets.back()); this->outputsockets.pop_back(); @@ -101,7 +101,8 @@ DataType NodeBase::determineActualDataType(OutputSocket *outputsocket) { const int inputIndex = outputsocket->getInputSocketDataTypeDeterminatorIndex(); if (inputIndex != -1) { return this->getInputSocket(inputIndex)->getActualDataType(); - } else { + } + else { return outputsocket->getDataType(); } } diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp index b02bcb6676e..71aaceb1b48 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cpp +++ b/source/blender/compositor/intern/COM_NodeOperation.cpp @@ -95,7 +95,8 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti * input, ReadBufferOpe if (this->isInputNode()) { BLI_init_rcti(output, input->xmin, input->xmax, input->ymin, input->ymax); return false; - } else { + } + else { unsigned int index; vector<InputSocket*> &inputsockets = this->getInputSockets(); diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp index acf3bf3789d..b986865ecf3 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp +++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp @@ -24,21 +24,21 @@ #include "COM_WorkScheduler.h" -OpenCLDevice::OpenCLDevice(cl_context context, cl_device_id device, cl_program program){ +OpenCLDevice::OpenCLDevice(cl_context context, cl_device_id device, cl_program program) { this->device = device; this->context = context; this->program = program; this->queue = NULL; } -bool OpenCLDevice::initialize(){ +bool OpenCLDevice::initialize() { cl_int error; queue = clCreateCommandQueue(context, device, 0, &error); return false; } -void OpenCLDevice::deinitialize(){ - if(queue){ +void OpenCLDevice::deinitialize() { + if (queue) { clReleaseCommandQueue(queue); } } diff --git a/source/blender/compositor/intern/COM_OutputSocket.cpp b/source/blender/compositor/intern/COM_OutputSocket.cpp index a262ad5f6ea..5380a7ec492 100644 --- a/source/blender/compositor/intern/COM_OutputSocket.cpp +++ b/source/blender/compositor/intern/COM_OutputSocket.cpp @@ -98,7 +98,8 @@ void OutputSocket::relinkConnections(OutputSocket *relinkToSocket, bool single) relinkToSocket->addConnection(connection); // relinkToSocket->setActualDataType(this->getActualDataType()); this->connections.erase(this->connections.begin()); - } else { + } + else { unsigned int index; for (index = 0 ; index < this->connections.size();index ++) { SocketConnection *connection = this->connections[index]; diff --git a/source/blender/compositor/intern/COM_SocketConnection.cpp b/source/blender/compositor/intern/COM_SocketConnection.cpp index 6c6c673501a..e3e52005add 100644 --- a/source/blender/compositor/intern/COM_SocketConnection.cpp +++ b/source/blender/compositor/intern/COM_SocketConnection.cpp @@ -29,7 +29,7 @@ SocketConnection::SocketConnection() { this->setIgnoreResizeCheck(false); } -void SocketConnection::setFromSocket(OutputSocket* fromsocket){ +void SocketConnection::setFromSocket(OutputSocket* fromsocket) { if (fromsocket == NULL) { throw "ERROR"; } @@ -49,14 +49,16 @@ InputSocket* SocketConnection::getToSocket() const {return this->toSocket;} NodeBase* SocketConnection::getFromNode() const { if (this->getFromSocket() == NULL) { return NULL; - } else { + } + else { return this->getFromSocket()->getNode(); } } NodeBase* SocketConnection::getToNode() const { if (this->getToSocket() == NULL) { return NULL; - } else { + } + else { return this->getToSocket()->getNode(); } } diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index e7c1e00dd96..5130525853b 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -114,9 +114,10 @@ void WorkScheduler::schedule(ExecutionGroup *group, int chunkNumber) { delete package; #elif COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE #ifdef COM_OPENCL_ENABLED - if (group->isOpenCL() && openclActive){ + if (group->isOpenCL() && openclActive) { BLI_thread_queue_push(gpuqueue, package); - } else{ + } + else { BLI_thread_queue_push(cpuqueue, package); } #else @@ -145,7 +146,8 @@ void WorkScheduler::start(CompositorContext &context) { BLI_insert_thread(&gputhreads, device); } openclActive = true; - } else { + } + else { openclActive = false; } #endif @@ -159,7 +161,8 @@ void WorkScheduler::finish() { while (BLI_thread_queue_size(gpuqueue) + BLI_thread_queue_size(cpuqueue) > 0) { PIL_sleep_ms(10); } - } else { + } + else { while (BLI_thread_queue_size(cpuqueue) > 0) { PIL_sleep_ms(10); } @@ -286,14 +289,14 @@ void WorkScheduler::initialize() { void WorkScheduler::deinitialize() { #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE Device* device; - while(cpudevices.size()>0) { + while (cpudevices.size()>0) { device = cpudevices.back(); cpudevices.pop_back(); device->deinitialize(); delete device; } #ifdef COM_OPENCL_ENABLED - while(gpudevices.size()>0) { + while (gpudevices.size()>0) { device = gpudevices.back(); gpudevices.pop_back(); device->deinitialize(); |