diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-10-24 16:14:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-10-24 17:04:11 +0300 |
commit | 72b61763da593fb6a9822f3e37eff9dd2973bf66 (patch) | |
tree | fbcc7169990e75410d5eabd132dedb003e635eff /source/blender/depsgraph | |
parent | 4dbfb130db1afea2ec4f8d5604515e81e5fde687 (diff) |
Depsgraph: Begin bringing API to pass explicit graph
This is a first step towards an updated API where we pass explicit graph rather
than a scene. This is because we can no longer deduct which graph to use since
it will depend on a context.
Will happen in several steps, so bisecting will not be such a pain.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph.h | 6 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 16 |
2 files changed, 9 insertions, 13 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index b76545a2884..34e59966a71 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -134,7 +134,7 @@ void DEG_free_node_types(void); /* Update Tagging -------------------------------- */ /* Update dependency graph when visible scenes/layers changes. */ -void DEG_graph_on_visible_update(struct Main *bmain, struct Scene *scene); +void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph); /* Update all dependency graphs when visible scenes/layers changes. */ void DEG_on_visible_update(struct Main *bmain, const bool do_time); @@ -167,9 +167,7 @@ enum { DEG_TAG_SHADING_UPDATE = (1 << 9), }; void DEG_id_tag_update(struct ID *id, int flag); -void DEG_id_tag_update_ex(struct Main *bmain, - struct ID *id, - int flag); +void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag); /* Tag given ID type for update. * diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 19d3dda1896..cde87ba126c 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -361,7 +361,7 @@ void deg_id_tag_update(Main *bmain, ID *id, int flag) } } -void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph) +void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph) { /* Make sure objects are up to date. */ GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash) @@ -389,7 +389,7 @@ void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph) } GHASH_FOREACH_END(); /* Make sure collection properties are up to date. */ - IDDepsNode *scene_id_node = graph->find_id_node(&scene->id); + IDDepsNode *scene_id_node = graph->find_id_node(&graph->scene->id); BLI_assert(scene_id_node != NULL); scene_id_node->tag_update(graph); } @@ -436,16 +436,14 @@ void DEG_scene_flush_update(Main *bmain, Scene *scene) if (scene->depsgraph_legacy == NULL) { return; } - DEG::deg_graph_flush_updates( - bmain, - reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy)); + DEG::deg_graph_flush_updates(bmain, (DEG::Depsgraph *)scene->depsgraph_legacy); } /* Update dependency graph when visible scenes/layers changes. */ -void DEG_graph_on_visible_update(Main *bmain, Scene *scene) +void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph) { - DEG::Depsgraph *graph = (DEG::Depsgraph *)scene->depsgraph_legacy; - DEG::deg_graph_on_visible_update(bmain, scene, graph); + DEG::Depsgraph *graph = (DEG::Depsgraph *)depsgraph; + DEG::deg_graph_on_visible_update(bmain, graph); } void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) @@ -455,7 +453,7 @@ void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) scene = (Scene *)scene->id.next) { if (scene->depsgraph_legacy != NULL) { - DEG_graph_on_visible_update(bmain, scene); + DEG_graph_on_visible_update(bmain, scene->depsgraph_legacy); } } } |