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:
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.cpp1
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.h8
-rw-r--r--source/blender/compositor/intern/COM_Converter.cpp28
-rw-r--r--source/blender/compositor/intern/COM_Converter.h4
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.cpp20
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystem.cpp9
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystem.h2
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp6
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystemHelper.h2
-rw-r--r--source/blender/compositor/intern/COM_MemoryProxy.h4
-rw-r--r--source/blender/compositor/intern/COM_Node.cpp13
-rw-r--r--source/blender/compositor/intern/COM_Node.h14
-rw-r--r--source/blender/compositor/intern/COM_NodeBase.cpp2
-rw-r--r--source/blender/compositor/intern/COM_NodeBase.h17
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cpp2
-rw-r--r--source/blender/compositor/intern/COM_OpenCLDevice.cpp2
-rw-r--r--source/blender/compositor/intern/COM_compositor.cpp17
17 files changed, 99 insertions, 52 deletions
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp
index 56335630b80..fbdb4cd6b28 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.cpp
+++ b/source/blender/compositor/intern/COM_CompositorContext.cpp
@@ -30,6 +30,7 @@ CompositorContext::CompositorContext()
this->m_quality = COM_QUALITY_HIGH;
this->m_hasActiveOpenCLDevices = false;
this->m_activegNode = NULL;
+ this->m_fastCalculation = false;
}
const int CompositorContext::getFramenumber() const
diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h
index 49acda811f1..2f6abf39985 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.h
+++ b/source/blender/compositor/intern/COM_CompositorContext.h
@@ -73,6 +73,11 @@ private:
* @brief does this system have active opencl devices?
*/
bool m_hasActiveOpenCLDevices;
+
+ /**
+ * @brief Skip slow nodes
+ */
+ bool m_fastCalculation;
public:
/**
@@ -148,6 +153,9 @@ public:
int getChunksize() { return this->getbNodeTree()->chunksize; }
const int isColorManaged() const;
+
+ void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;}
+ bool isFastCalculation() {return this->m_fastCalculation;}
};
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp
index 38c514d8e99..4ed7ae7ca8a 100644
--- a/source/blender/compositor/intern/COM_Converter.cpp
+++ b/source/blender/compositor/intern/COM_Converter.cpp
@@ -48,8 +48,8 @@
#include "COM_CompositorNode.h"
#include "COM_ConvertAlphaNode.h"
#include "COM_ConvertColorToVectorOperation.h"
-#include "COM_ConvertColourToValueProg.h"
-#include "COM_ConvertValueToColourProg.h"
+#include "COM_ConvertColorToValueProg.h"
+#include "COM_ConvertValueToColorProg.h"
#include "COM_ConvertValueToVectorOperation.h"
#include "COM_ConvertVectorToColorOperation.h"
#include "COM_ConvertVectorToValueOperation.h"
@@ -117,7 +117,7 @@
#include "COM_ViewerNode.h"
#include "COM_ZCombineNode.h"
-Node *Converter::convert(bNode *b_node)
+Node *Converter::convert(bNode *b_node, bool fast)
{
Node *node;
@@ -125,6 +125,22 @@ Node *Converter::convert(bNode *b_node)
node = new MuteNode(b_node);
return node;
}
+ if (fast) {
+ if (b_node->type == CMP_NODE_BLUR ||
+ b_node->type == CMP_NODE_VECBLUR ||
+ b_node->type == CMP_NODE_BILATERALBLUR ||
+ b_node->type == CMP_NODE_DEFOCUS ||
+ b_node->type == CMP_NODE_BOKEHBLUR ||
+ b_node->type == CMP_NODE_GLARE ||
+ b_node->type == CMP_NODE_DBLUR ||
+ b_node->type == CMP_NODE_MOVIEDISTORTION ||
+ b_node->type == CMP_NODE_LENSDIST ||
+ b_node->type == CMP_NODE_DOUBLEEDGEMASK ||
+ b_node->type == CMP_NODE_DILATEERODE)
+ {
+ return new MuteNode(b_node);
+ }
+ }
switch (b_node->type) {
case CMP_NODE_COMPOSITE:
@@ -137,7 +153,7 @@ Node *Converter::convert(bNode *b_node)
node = new TextureNode(b_node);
break;
case CMP_NODE_RGBTOBW:
- node = new ColourToBWNode(b_node);
+ node = new ColorToBWNode(b_node);
break;
case CMP_NODE_MIX_RGB:
node = new MixNode(b_node);
@@ -376,13 +392,13 @@ void Converter::convertDataType(SocketConnection *connection, ExecutionSystem *s
DataType toDatatype = inputSocket->getDataType();
NodeOperation *converter = NULL;
if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
- converter = new ConvertValueToColourProg();
+ converter = new ConvertValueToColorProg();
}
else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
converter = new ConvertValueToVectorOperation();
}
else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
- converter = new ConvertColourToValueProg();
+ converter = new ConvertColorToValueProg();
}
else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
converter = new ConvertColorToVectorOperation();
diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h
index 6cf22a1e2a4..15bda0839fa 100644
--- a/source/blender/compositor/intern/COM_Converter.h
+++ b/source/blender/compositor/intern/COM_Converter.h
@@ -42,7 +42,7 @@ public:
* @see Node
* @see MuteNode
*/
- static Node *convert(bNode *b_node);
+ static Node *convert(bNode *b_node, bool fast);
/**
* @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
@@ -60,7 +60,7 @@ public:
*
* @note Conversion logic is implemented in this method
* @see InputSocketResizeMode for the possible conversions.
-
+ *
* @param connection the SocketConnection what needs conversion
* @param system the ExecutionSystem to add the conversion to.
* @see SocketConnection - a link between two sockets
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
index 1a0bd95b7d6..e437b069e33 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
@@ -27,6 +27,8 @@
#include "BLI_math.h"
#include "PIL_time.h"
+#include "WM_api.h"
+#include "WM_types.h"
#include "COM_ExecutionGroup.h"
#include "COM_InputSocket.h"
@@ -347,6 +349,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
finished = false;
startEvaluated = true;
numberEvaluated++;
+
+ WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL);
}
else if (state == COM_ES_SCHEDULED) {
finished = false;
@@ -485,14 +489,18 @@ bool ExecutionGroup::scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *area
float chunkSizef = this->m_chunkSize;
int indexx, indexy;
- const int minxchunk = floor(area->xmin / chunkSizef);
- const int maxxchunk = ceil((area->xmax - 1) / chunkSizef);
- const int minychunk = floor(area->ymin / chunkSizef);
- const int maxychunk = ceil((area->ymax - 1) / chunkSizef);
+ int minxchunk = floor(area->xmin / chunkSizef);
+ int maxxchunk = ceil((area->xmax - 1) / chunkSizef);
+ int minychunk = floor(area->ymin / chunkSizef);
+ int maxychunk = ceil((area->ymax - 1) / chunkSizef);
+ minxchunk = MAX2(minxchunk, 0);
+ minychunk = MAX2(minychunk, 0);
+ maxxchunk = MIN2(maxxchunk, this->m_numberOfXChunks);
+ maxychunk = MIN2(maxychunk, this->m_numberOfYChunks);
bool result = true;
- for (indexx = max(minxchunk, 0); indexx < maxxchunk; indexx++) {
- for (indexy = max(minychunk, 0); indexy < maxychunk; indexy++) {
+ for (indexx = minxchunk; indexx < maxxchunk; indexx++) {
+ for (indexy = minychunk; indexy < maxychunk; indexy++) {
if (!scheduleChunkWhenPossible(graph, indexx, indexy)) {
result = false;
}
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp
index 23e243187d5..ff841092848 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp
@@ -44,9 +44,10 @@
#include "MEM_guardedalloc.h"
#endif
-ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering)
+ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering, bool fastcalculation)
{
this->m_context.setbNodeTree(editingtree);
+ this->m_context.setFastCalculation(fastcalculation);
bNode *gnode;
for (gnode = (bNode *)editingtree->nodes.first; gnode; gnode = (bNode *)gnode->next) {
if (gnode->type == NODE_GROUP && gnode->typeinfo->group_edit_get(gnode)) {
@@ -137,8 +138,10 @@ void ExecutionSystem::execute()
WorkScheduler::start(this->m_context);
executeGroups(COM_PRIORITY_HIGH);
- executeGroups(COM_PRIORITY_MEDIUM);
- executeGroups(COM_PRIORITY_LOW);
+ if (!this->getContext().isFastCalculation()) {
+ executeGroups(COM_PRIORITY_MEDIUM);
+ executeGroups(COM_PRIORITY_LOW);
+ }
WorkScheduler::finish();
WorkScheduler::stop();
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h
index e51bd7f3026..209358ec786 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.h
@@ -156,7 +156,7 @@ public:
* @param editingtree [bNodeTree*]
* @param rendering [true false]
*/
- ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering);
+ ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering, bool fastcalculation);
/**
* Destructor
diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
index 0f6ba1f4ac9..0abf7efdcfa 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
@@ -49,7 +49,7 @@ void ExecutionSystemHelper::addbNodeTree(ExecutionSystem &system, int nodes_star
/* add all nodes of the tree to the node list */
bNode *node = (bNode *)tree->nodes.first;
while (node != NULL) {
- addNode(nodes, node, isActiveGroup);
+ addNode(nodes, node, isActiveGroup, system.getContext().isFastCalculation());
node = (bNode *)node->next;
}
@@ -77,11 +77,11 @@ void ExecutionSystemHelper::addNode(vector<Node *>& nodes, Node *node)
nodes.push_back(node);
}
-Node *ExecutionSystemHelper::addNode(vector<Node *>& nodes, bNode *b_node, bool inActiveGroup)
+Node *ExecutionSystemHelper::addNode(vector<Node *>& nodes, bNode *b_node, bool inActiveGroup, bool fast)
{
Converter converter;
Node *node;
- node = converter.convert(b_node);
+ node = converter.convert(b_node, fast);
node->setIsInActiveGroup(inActiveGroup);
if (node != NULL) {
addNode(nodes, node);
diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
index 4b65ed15577..bd34fe8ab02 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
@@ -58,7 +58,7 @@ public:
* @param bNode node to add
* @return Node that represents the bNode or null when not able to convert.
*/
- static Node *addNode(vector<Node *>& nodes, bNode *b_node, bool isInActiveGroup);
+ static Node *addNode(vector<Node *>& nodes, bNode *b_node, bool isInActiveGroup, bool fast);
/**
* @brief Add a Node to a list
diff --git a/source/blender/compositor/intern/COM_MemoryProxy.h b/source/blender/compositor/intern/COM_MemoryProxy.h
index f02da215b5f..130c5f5057a 100644
--- a/source/blender/compositor/intern/COM_MemoryProxy.h
+++ b/source/blender/compositor/intern/COM_MemoryProxy.h
@@ -50,12 +50,12 @@ private:
/**
* @brief datatype of this MemoryProxy
*/
- DataType m_datatype;
+ /* DataType m_datatype; */ /* UNUSED */
/**
* @brief channel information of this buffer
*/
- ChannelInfo m_channelInfo[COM_NUMBER_OF_CHANNELS];
+ /* ChannelInfo m_channelInfo[COM_NUMBER_OF_CHANNELS]; */ /* UNUSED */
/**
* @brief the allocated memory
diff --git a/source/blender/compositor/intern/COM_Node.cpp b/source/blender/compositor/intern/COM_Node.cpp
index 15b8a3933a7..320baacb669 100644
--- a/source/blender/compositor/intern/COM_Node.cpp
+++ b/source/blender/compositor/intern/COM_Node.cpp
@@ -39,9 +39,9 @@
//#include <stdio.h>
#include "COM_defines.h"
-Node::Node(bNode *editorNode, bool create_sockets)
+Node::Node(bNode *editorNode, bool create_sockets): NodeBase()
{
- this->m_editorNode = editorNode;
+ setbNode(editorNode);
if (create_sockets) {
bNodeSocket *input = (bNodeSocket *)editorNode->inputs.first;
@@ -64,15 +64,6 @@ Node::Node(bNode *editorNode, bool create_sockets)
}
}
}
-Node::Node()
-{
- this->m_editorNode = NULL;
-}
-
-bNode *Node::getbNode()
-{
- return this->m_editorNode;
-}
void Node::addSetValueOperation(ExecutionSystem *graph, InputSocket *inputsocket, int editorNodeInputSocketIndex)
{
diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h
index 5d6d232f37a..bc4a25db605 100644
--- a/source/blender/compositor/intern/COM_Node.h
+++ b/source/blender/compositor/intern/COM_Node.h
@@ -48,10 +48,6 @@ typedef pair<NodeIterator, NodeIterator> NodeRange;
*/
class Node : public NodeBase {
private:
- /**
- * @brief stores the reference to the SDNA bNode struct
- */
- bNode *m_editorNode;
/**
* @brief Is this node part of the active group
@@ -60,12 +56,7 @@ private:
public:
Node(bNode *editorNode, bool create_sockets = true);
-
- /**
- * @brief get the reference to the SDNA bNode struct
- */
- bNode *getbNode();
-
+
/**
* @brief Is this node in the active group (the group that is being edited)
* @param isInActiveGroup
@@ -137,9 +128,6 @@ public:
*/
OutputSocket *findOutputSocketBybNodeSocket(bNodeSocket *socket);
protected:
-
- Node();
-
void addPreviewOperation(ExecutionSystem *system, InputSocket *inputSocket);
void addPreviewOperation(ExecutionSystem *system, OutputSocket *outputSocket);
diff --git a/source/blender/compositor/intern/COM_NodeBase.cpp b/source/blender/compositor/intern/COM_NodeBase.cpp
index 8dbda5f649c..5c2ce37bdea 100644
--- a/source/blender/compositor/intern/COM_NodeBase.cpp
+++ b/source/blender/compositor/intern/COM_NodeBase.cpp
@@ -33,7 +33,7 @@
NodeBase::NodeBase()
{
- /* pass */
+ this->m_editorNode = NULL;
}
diff --git a/source/blender/compositor/intern/COM_NodeBase.h b/source/blender/compositor/intern/COM_NodeBase.h
index 7095cda39e3..3c390f6bcdb 100644
--- a/source/blender/compositor/intern/COM_NodeBase.h
+++ b/source/blender/compositor/intern/COM_NodeBase.h
@@ -54,6 +54,11 @@ private:
*/
vector<OutputSocket *> m_outputsockets;
+ /**
+ * @brief stores the reference to the SDNA bNode struct
+ */
+ bNode *m_editorNode;
+
protected:
/**
* @brief get access to the vector of input sockets
@@ -74,6 +79,18 @@ public:
virtual ~NodeBase();
/**
+ * @brief get the reference to the SDNA bNode struct
+ */
+ bNode *getbNode() {return m_editorNode;}
+
+ /**
+ * @brief set the reference to the bNode
+ * @note used in Node instances to receive the storage/settings and complex node for highlight during execution
+ * @param bNode
+ */
+ void setbNode(bNode *bNode) {this->m_editorNode = bNode;}
+
+ /**
* @brief is this node an operation?
* This is true when the instance is of the subclass NodeOperation.
* @return [true:false]
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp
index 6ef8a5ff078..c3fa308971c 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperation.cpp
@@ -28,7 +28,7 @@
#include "COM_SocketConnection.h"
#include "COM_defines.h"
-NodeOperation::NodeOperation()
+NodeOperation::NodeOperation() : NodeBase()
{
this->m_resolutionInputSocketIndex = 0;
this->m_complex = false;
diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp
index 2dd44f8140f..eae1ffeb08a 100644
--- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp
+++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp
@@ -23,7 +23,7 @@
#include "COM_OpenCLDevice.h"
#include "COM_WorkScheduler.h"
-typedef enum COM_VendorID {NVIDIA=0x10DE, AMD=0x1002} COM_VendorID;
+typedef enum COM_VendorID {NVIDIA = 0x10DE, AMD = 0x1002} COM_VendorID;
OpenCLDevice::OpenCLDevice(cl_context context, cl_device_id device, cl_program program, cl_int vendorId)
{
diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp
index 7282cf65bc3..9e48334bcca 100644
--- a/source/blender/compositor/intern/COM_compositor.cpp
+++ b/source/blender/compositor/intern/COM_compositor.cpp
@@ -57,8 +57,23 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering)
/* set progress bar to 0% and status to init compositing*/
editingtree->progress(editingtree->prh, 0.0);
+ bool twopass = (editingtree->flag&NTREE_TWO_PASS) > 0 || rendering;
/* initialize execution system */
- ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering);
+ if (twopass) {
+ ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering, twopass);
+ system->execute();
+ delete system;
+
+ if (editingtree->test_break(editingtree->tbh)) {
+ // during editing multiple calls to this method can be triggered.
+ // make sure one the last one will be doing the work.
+ BLI_mutex_unlock(&compositorMutex);
+ return;
+ }
+ }
+
+
+ ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering, false);
system->execute();
delete system;