diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-29 23:12:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-29 23:12:12 +0400 |
commit | 15d07720e515a2e9caada6ee9900c388c5e06490 (patch) | |
tree | 8154e70a86e3b9b0cf42a581db95f0a7d4029238 /source/blender/blenkernel | |
parent | 7f5dc4644f72ffb56d23db79cc3208dbca2d5eab (diff) |
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_depsgraph.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 18 |
3 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index 17a4749f704..44f8238d4d9 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -115,5 +115,8 @@ void DAG_ids_flush_update(int time); /* (re)-create dependency graph for armature pose */ void DAG_pose_sort(struct Object *ob); + + /* callback for editors module to do updates */ +void DAG_editors_update_cb(void (*func)(struct Main *bmain, struct ID *id)); #endif diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index ea1707c19bf..b1e7dcaff02 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -426,7 +426,7 @@ extern struct ListBase node_all_textures; /* API */ int ntreeTexTagAnimated(struct bNodeTree *ntree); void ntreeTexSetPreviewFlag(int); -void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra); +void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra, int preview); void ntreeTexCheckCyclics(struct bNodeTree *ntree); char* ntreeTexOutputMenu(struct bNodeTree *ntree); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 4c2b2f3ec12..608cfe03b72 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1607,6 +1607,21 @@ void graph_print_adj_list(void) /* ************************ API *********************** */ +/* mechanism to allow editors to be informed of depsgraph updates, + to do their own updates based on changes... */ +static void (*EditorsUpdateCb)(Main *bmain, ID *id)= NULL; + +void DAG_editors_update_cb(void (*func)(Main *bmain, ID *id)) +{ + EditorsUpdateCb= func; +} + +static void dag_editors_update(Main *bmain, ID *id) +{ + if(EditorsUpdateCb) + EditorsUpdateCb(bmain, id); +} + /* groups with objects in this scene need to be put in the right order as well */ static void scene_sort_groups(Scene *sce) { @@ -2239,6 +2254,9 @@ void DAG_id_flush_update(ID *id, short flag) } } } + + /* update editors */ + dag_editors_update(bmain, id); } /* flush to other objects that depend on this one */ |