From 2fdca5bd1981cddad16715598b4892a2c6099e2f Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 22 Jun 2020 21:44:18 +0200 Subject: Refactoring: View2DScrollers memory allocation View2DScrollers used the memory manager to allocate memory. This isn't a problem but in a upcoming change the scrollers will be drawn more often than it used to (See {D8066}). To limit the number of allocations and frees this patch will use the stack for allocation. Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D8076 --- source/blender/editors/space_clip/space_clip.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_clip') diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 6ec99730e09..54da00a132d 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1045,7 +1045,6 @@ static void clip_preview_region_init(wmWindowManager *wm, ARegion *region) static void graph_region_draw(const bContext *C, ARegion *region) { View2D *v2d = ®ion->v2d; - View2DScrollers *scrollers; SpaceClip *sc = CTX_wm_space_clip(C); Scene *scene = CTX_data_scene(C); short cfra_flag = 0; @@ -1076,9 +1075,7 @@ static void graph_region_draw(const bContext *C, ARegion *region) ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true); /* scrollers */ - scrollers = UI_view2d_scrollers_calc(v2d, NULL); - UI_view2d_scrollers_draw(v2d, scrollers); - UI_view2d_scrollers_free(scrollers); + UI_view2d_scrollers_draw(v2d, NULL); /* scale indicators */ { @@ -1095,7 +1092,6 @@ static void dopesheet_region_draw(const bContext *C, ARegion *region) SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); View2D *v2d = ®ion->v2d; - View2DScrollers *scrollers; short cfra_flag = 0; if (clip) { @@ -1127,9 +1123,7 @@ static void dopesheet_region_draw(const bContext *C, ARegion *region) ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true); /* scrollers */ - scrollers = UI_view2d_scrollers_calc(v2d, NULL); - UI_view2d_scrollers_draw(v2d, scrollers); - UI_view2d_scrollers_free(scrollers); + UI_view2d_scrollers_draw(v2d, NULL); } static void clip_preview_region_draw(const bContext *C, ARegion *region) -- cgit v1.2.3