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:
authorMatt Ebb <matt@mke3.net>2010-06-14 11:02:11 +0400
committerMatt Ebb <matt@mke3.net>2010-06-14 11:02:11 +0400
commitff561973622975f4000f7f1b5bdf3787009e58d5 (patch)
tree4a16ff52229a9aae25d094f7c02991e06ab8299f /source/blender/editors/space_node/node_draw.c
parentc2f36a4d6abf829f28079c80e7e9dae6b80251cc (diff)
Don't draw nodes that are out of the view
speeds up node editor fairly considerably on a complex comp
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 63c1d9e486c..5eb6d9cf94a 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -626,13 +626,7 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
}
}
-// if(GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) { XXX
-// float zoomx= curarea->winx/(float)(G.v2d->cur.xmax-G.v2d->cur.xmin);
-// float zoomy= curarea->winy/(float)(G.v2d->cur.ymax-G.v2d->cur.ymin);
-// glPixelZoom(zoomx*xscale, zoomy*yscale);
-// }
-// else
- glPixelZoom(xscale, yscale);
+ glPixelZoom(xscale, yscale);
glEnable(GL_BLEND);
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */
@@ -661,6 +655,19 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
bNodeTree *ntree = snode->nodetree;
PointerRNA ptr;
+ /* hurmf... another candidate for callback, have to see how this works first */
+ if(node->id && node->block && snode->treetype==NTREE_SHADER)
+ nodeShaderSynchronizeID(node, 0);
+
+ /* skip if out of view */
+ if (node->totr.xmax < ar->v2d.cur.xmin || node->totr.xmin > ar->v2d.cur.xmax ||
+ node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax) {
+
+ uiEndBlock(C, node->block);
+ node->block= NULL;
+ return;
+ }
+
uiSetRoundBox(15-4);
ui_dropshadow(rct, BASIS_RAD, snode->aspect, node->flag & SELECT);
@@ -761,10 +768,6 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
node_draw_mute_line(v2d, snode, node);
- /* hurmf... another candidate for callback, have to see how this works first */
- if(node->id && node->block && snode->treetype==NTREE_SHADER)
- nodeShaderSynchronizeID(node, 0);
-
/* socket inputs, buttons */
for(sock= node->inputs.first; sock; sock= sock->next) {
if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {