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/editors/space_node')
-rw-r--r--source/blender/editors/space_node/SConscript9
-rw-r--r--source/blender/editors/space_node/node_draw.c27
-rw-r--r--source/blender/editors/space_node/node_edit.c11
-rw-r--r--source/blender/editors/space_node/space_node.c2
4 files changed, 32 insertions, 17 deletions
diff --git a/source/blender/editors/space_node/SConscript b/source/blender/editors/space_node/SConscript
index 5453aa7dd44..fd0dfe83852 100644
--- a/source/blender/editors/space_node/SConscript
+++ b/source/blender/editors/space_node/SConscript
@@ -14,5 +14,12 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
if env['CC'] == 'gcc':
#cf.append('-Werror')
pass
-
+
+if env['OURPLATFORM'] == 'linux2':
+ cflags='-pthread'
+ incs += ' ../../../extern/binreloc/include'
+
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs += ' ' + env['BF_PTHREADS_INC']
+
env.BlenderLib ( 'bf_editors_space_node', sources, Split(incs), defs, libtype=['core'], priority=[55], compileflags=cf )
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 1d57f4e0d4c..3fc91fea914 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -48,8 +48,9 @@
#include "DNA_text_types.h"
#include "DNA_userdef_types.h"
-#include "BLI_blenlib.h"
#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BLI_threads.h"
#include "MEM_guardedalloc.h"
#include "BKE_context.h"
@@ -187,6 +188,8 @@ static void node_update(const bContext *C, bNodeTree *ntree, bNode *node)
/* preview rect? */
if(node->flag & NODE_PREVIEW) {
/* only recalculate size when there's a preview actually, otherwise we use stored result */
+ BLI_lock_thread(LOCK_PREVIEW);
+
if(node->preview && node->preview->rect) {
float aspect= 1.0f;
@@ -222,6 +225,8 @@ static void node_update(const bContext *C, bNodeTree *ntree, bNode *node)
node->prvr.ymin= dy - oldh;
dy= node->prvr.ymin - NODE_DYS/2;
}
+
+ BLI_unlock_thread(LOCK_PREVIEW);
}
/* XXX ugly hack, typeinfo for group is generated */
@@ -685,7 +690,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
icon_id= ICON_MATERIAL_DATA;
iconofs-= 18.0f;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, icon_id, snode->aspect, -60);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, icon_id, snode->aspect, 0.5f);
glDisable(GL_BLEND);
}
if(node->type == NODE_GROUP) {
@@ -693,21 +698,18 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
iconofs-= 18.0f;
glEnable(GL_BLEND);
if(node->id->lib) {
- glPixelTransferf(GL_GREEN_SCALE, 0.7f);
- glPixelTransferf(GL_BLUE_SCALE, 0.3f);
- UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect);
- glPixelTransferf(GL_GREEN_SCALE, 1.0f);
- glPixelTransferf(GL_BLUE_SCALE, 1.0f);
+ float rgb[3] = {1.0f, 0.7f, 0.3f};
+ UI_icon_draw_aspect_color(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, rgb);
}
else {
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, -60);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, 0.5f);
}
glDisable(GL_BLEND);
}
if(node->typeinfo->flag & NODE_OPTIONS) {
iconofs-= 18.0f;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_BUTS, snode->aspect, -60);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_BUTS, snode->aspect, 0.5f);
glDisable(GL_BLEND);
}
{ /* always hide/reveal unused sockets */
@@ -720,7 +722,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
else*/
shade= -90;
glEnable(GL_BLEND);
- UI_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_PLUS, snode->aspect, shade);
+ UI_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_PLUS, snode->aspect, 0.5f);
glDisable(GL_BLEND);
}
@@ -839,9 +841,12 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
}
/* preview */
- if(node->flag & NODE_PREVIEW)
+ if(node->flag & NODE_PREVIEW) {
+ BLI_lock_thread(LOCK_PREVIEW);
if(node->preview && node->preview->rect)
node_draw_preview(node->preview, &node->prvr);
+ BLI_unlock_thread(LOCK_PREVIEW);
+ }
uiEndBlock(C, node->block);
uiDrawBlock(C, node->block);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 5fc09408229..50a99650ec0 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -62,7 +62,7 @@
#include "BKE_scene.h"
#include "BKE_utildefines.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "BIF_gl.h"
@@ -152,7 +152,7 @@ static void compo_startjob(void *cjv, short *stop, short *do_update)
{
CompoJob *cj= cjv;
bNodeTree *ntree= cj->localtree;
-
+
if(cj->scene->use_nodes==0)
return;
@@ -176,8 +176,11 @@ static void compo_startjob(void *cjv, short *stop, short *do_update)
void snode_composite_job(const bContext *C, ScrArea *sa)
{
SpaceNode *snode= sa->spacedata.first;
- wmJob *steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa);
- CompoJob *cj= MEM_callocN(sizeof(CompoJob), "compo job");
+ wmJob *steve;
+ CompoJob *cj;
+
+ steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, WM_JOB_EXCL_RENDER);
+ cj= MEM_callocN(sizeof(CompoJob), "compo job");
/* customdata for preview thread */
cj->scene= CTX_data_scene(C);
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 12a5f33e119..2cfd9d99123 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -48,7 +48,7 @@
#include "BKE_screen.h"
#include "BKE_node.h"
-#include "ED_previewrender.h"
+#include "ED_render.h"
#include "ED_space_api.h"
#include "ED_screen.h"