diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-06 12:21:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-13 15:17:37 +0300 |
commit | a1e2415ed51e2da97e3b182f18f462345a02ce14 (patch) | |
tree | 59d54c64e1e19bde4aab0d79aa2a51a66dabc877 /source/blender/depsgraph/intern/eval | |
parent | eec5d3a8a8a26256fbae39d4f1fb01de6a648eea (diff) |
Depsgraph: don't pass evaluation context to update functions.
The depsgraph now contains all the state needed to evaluate it.
Differential Revision: https://developer.blender.org/D3147
Diffstat (limited to 'source/blender/depsgraph/intern/eval')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval.cc | 14 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval.h | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 1355e68097b..d40e3e85979 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -227,23 +227,23 @@ static void schedule_children(TaskPool *pool, * * \note Time sources should be all valid! */ -void deg_evaluate_on_refresh(EvaluationContext *eval_ctx, - Depsgraph *graph) +void deg_evaluate_on_refresh(Depsgraph *graph) { /* Set time for the current graph evaluation context. */ TimeSourceDepsNode *time_src = graph->find_time_source(); - eval_ctx->ctime = time_src->cfra; - eval_ctx->depsgraph = (::Depsgraph *)graph; - eval_ctx->view_layer = DEG_get_evaluated_view_layer((::Depsgraph *)graph); /* Nothing to update, early out. */ if (BLI_gset_len(graph->entry_tags) == 0) { return; } const bool do_time_debug = ((G.debug & G_DEBUG_DEPSGRAPH_TIME) != 0); const double start_time = do_time_debug ? PIL_check_seconds_timer() : 0; - /* Set up evaluation context for depsgraph itself. */ + /* Set up evaluation context. */ + EvaluationContext eval_ctx; + DEG_evaluation_context_init_from_depsgraph(&eval_ctx, (::Depsgraph*)graph, graph->mode); + eval_ctx.ctime = time_src->cfra; + /* Set up evaluation state. */ DepsgraphEvalState state; - state.eval_ctx = eval_ctx; + state.eval_ctx = &eval_ctx; state.graph = graph; state.do_stats = do_time_debug; /* Set up task scheduler and pull for threaded evaluation. */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval.h b/source/blender/depsgraph/intern/eval/deg_eval.h index 576ab89dec1..0fb60e8f779 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.h +++ b/source/blender/depsgraph/intern/eval/deg_eval.h @@ -45,7 +45,6 @@ struct Depsgraph; * * \note Time sources should be all valid! */ -void deg_evaluate_on_refresh(EvaluationContext *eval_ctx, - Depsgraph *graph); +void deg_evaluate_on_refresh(Depsgraph *graph); } // namespace DEG |