From 323e86694efe2fe4a2a8b570977d59c735942f90 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 30 Nov 2012 09:12:10 +0000 Subject: Compositor should never add notifiers by himself, notifiers should be added from main thread using job update callback. Added new execution-time callback to bNodeTree which marks job to be updated. The code here could be a bit not so obvious because in some cases job update callback need to merge local tree, but it's only needed for old compositor system which is gonna to be removed soon, so decided not to bother with cleanup now. Removing old compositor system will also allow to drop stats_draw callback from bNodeTree. This should fix following bugs: --- source/blender/compositor/intern/COM_ExecutionGroup.cpp | 2 +- source/blender/compositor/intern/COM_NodeOperation.h | 5 ++++- source/blender/compositor/operations/COM_ViewerBaseOperation.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 0553aebbba6..7095ccd57b7 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -352,7 +352,7 @@ void ExecutionGroup::execute(ExecutionSystem *graph) startEvaluated = true; numberEvaluated++; - WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL); + bTree->update_draw(bTree->udh); } else if (state == COM_ES_SCHEDULED) { finished = false; diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index 42d90eca38f..b0cc24fc487 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -77,7 +77,7 @@ private: ThreadMutex m_mutex; /** - * @brief reference to the editing bNodeTree only used for break callback + * @brief reference to the editing bNodeTree, used for break and update callback */ const bNodeTree *m_btree; @@ -247,6 +247,9 @@ public: return this->m_btree->test_break(this->m_btree->tbh); } + inline void updateDraw() { + this->m_btree->update_draw(this->m_btree->udh); + } protected: NodeOperation(); diff --git a/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp b/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp index cc313512316..d5f2c283c72 100644 --- a/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp @@ -103,7 +103,7 @@ void ViewerBaseOperation:: updateImage(rcti *rect) this->m_viewSettings, this->m_displaySettings, rect->xmin, rect->ymin, rect->xmax, rect->ymax, FALSE); - WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL); + this->updateDraw(); } void ViewerBaseOperation::deinitExecution() -- cgit v1.2.3