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/include/UI_view2d.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index ffc06e94a90..0ddc45f4878 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -180,9 +180,10 @@ void UI_view2d_draw_scale_x__frames_or_seconds(const struct ARegion *region, int colorid); /* scrollbar drawing */ -View2DScrollers *UI_view2d_scrollers_calc(struct View2D *v2d, const struct rcti *mask_custom); -void UI_view2d_scrollers_draw(struct View2D *v2d, View2DScrollers *scrollers); -void UI_view2d_scrollers_free(View2DScrollers *scrollers); +void UI_view2d_scrollers_calc(struct View2D *v2d, + const struct rcti *mask_custom, + struct View2DScrollers *r_scrollers); +void UI_view2d_scrollers_draw(struct View2D *v2d, const struct rcti *mask_custom); /* list view tools */ void UI_view2d_listview_view_to_cell(float columnwidth, -- cgit v1.2.3