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/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c27
1 files changed, 16 insertions, 11 deletions
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);