diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-04-25 17:35:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-04-25 17:35:08 +0300 |
commit | acf07e73666a4a3edaeeb36489902b9373a9779d (patch) | |
tree | be9893c779d1fcbda25e688e3dc6da0f4cadc627 /source/blender/draw/modes/edit_text_mode.c | |
parent | 75a759ea5e9a4b4a52900e6383d67c81b7cbdabe (diff) |
Draw Manager: store context vars per draw
Was performing context access per object for scene, region etc.
While not very slow they don't change during drawing so cache in a struct.
This also makes it possible to draw in views besides the current context.
Diffstat (limited to 'source/blender/draw/modes/edit_text_mode.c')
-rw-r--r-- | source/blender/draw/modes/edit_text_mode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/modes/edit_text_mode.c b/source/blender/draw/modes/edit_text_mode.c index e40d6be5ad8..0d4326c2e24 100644 --- a/source/blender/draw/modes/edit_text_mode.c +++ b/source/blender/draw/modes/edit_text_mode.c @@ -189,8 +189,8 @@ static void EDIT_TEXT_cache_populate(void *vedata, Object *ob) { EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; - const struct bContext *C = DRW_get_context(); - Scene *scene = CTX_data_scene(C); + const DRWContextState *draw_ctx = DRW_context_state_get(); + Scene *scene = draw_ctx->scene; Object *obedit = scene->obedit; UNUSED_VARS(psl, stl); |