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:
authorJacques Lucke <jacques@blender.org>2020-08-18 18:40:45 +0300
committerJacques Lucke <jacques@blender.org>2020-08-18 18:40:56 +0300
commit80face1be57ed38b812dbd9a245de36b3e160013 (patch)
tree83a6805236b62e7773526c8c0f4a9c40cac3526c /source/blender/depsgraph/intern
parentc2f0522760b24b746b1f1686f91198c643b6b4c2 (diff)
Depsgraph: simplify DEG_evaluate_* API
This mainly removes the bmain argument, which can be retrieved from the graph itself. Also, I removed some outdated/unnecessary comments. Reviewers: sergey, sybren Differential Revision: https://developer.blender.org/D8614
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc8
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_flush.cc5
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_flush.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index b4c93fb12af..0c116f5863c 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -48,7 +48,7 @@
namespace deg = blender::deg;
/* Evaluate all nodes tagged for updating. */
-void DEG_evaluate_on_refresh(Main *bmain, Depsgraph *graph)
+void DEG_evaluate_on_refresh(Depsgraph *graph)
{
deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph);
deg_graph->ctime = BKE_scene_frame_get(deg_graph->scene);
@@ -56,18 +56,18 @@ void DEG_evaluate_on_refresh(Main *bmain, Depsgraph *graph)
if (deg_graph->scene_cow) {
BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime);
}
- deg::deg_graph_flush_updates(bmain, deg_graph);
+ deg::deg_graph_flush_updates(deg_graph);
deg::deg_evaluate_on_refresh(deg_graph);
deg_graph->need_update_time = false;
}
/* Frame-change happened for root scene that graph belongs to. */
-void DEG_evaluate_on_framechange(Main *bmain, Depsgraph *graph, float ctime)
+void DEG_evaluate_on_framechange(Depsgraph *graph, float ctime)
{
deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph);
deg_graph->ctime = ctime;
deg_graph->need_update_time = true;
- deg::deg_graph_flush_updates(bmain, deg_graph);
+ deg::deg_graph_flush_updates(deg_graph);
/* Update time in scene. */
if (deg_graph->scene_cow) {
BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index a74ec485d88..dea23c9f96d 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -351,11 +351,12 @@ void invalidate_tagged_evaluated_data(Depsgraph *graph)
/* Flush updates from tagged nodes outwards until all affected nodes
* are tagged.
*/
-void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
+void deg_graph_flush_updates(Depsgraph *graph)
{
/* Sanity checks. */
- BLI_assert(bmain != nullptr);
BLI_assert(graph != nullptr);
+ Main *bmain = graph->bmain;
+
/* Nothing to update, early out. */
if (graph->need_update_time) {
const Scene *scene_orig = graph->scene;
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.h b/source/blender/depsgraph/intern/eval/deg_eval_flush.h
index c76dc9fe01d..1f58c54dbf4 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.h
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.h
@@ -35,7 +35,7 @@ struct Depsgraph;
/* Flush updates from tagged nodes outwards until all affected nodes
* are tagged.
*/
-void deg_graph_flush_updates(struct Main *bmain, struct Depsgraph *graph);
+void deg_graph_flush_updates(struct Depsgraph *graph);
/* Clear tags from all operation nodes. */
void deg_graph_clear_tags(struct Depsgraph *graph);