From 142541124976af41f08fb5479886350c2d803710 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Tue, 30 Mar 2021 16:23:58 -0300 Subject: Cleanup/Refactor: Unify functions that redraw the depth buffer Now `ED_view3d_backbuf_depth_validate`, `ED_view3d_draw_depth` and `ED_view3d_draw_depth_gpencil` are unified in `ED_view3d_depth_override`. This new function replaces `ED_view3d_autodist_init`. Also, since `ED_view3d_depth_update` depends on the render context, and changing the context is a slow operation, that function also was removed, and the depth buffer cached is now updated inside the new unified drawing function when the "bool update_cache" parameter is true. Finally `V3D_INVALID_BACKBUF` flag has been renamed and moved to `runtime.flag`. Differential revision: https://developer.blender.org/D10678 --- source/blender/editors/curve/editcurve_paint.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/curve') diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 48a36ff276d..0d071f2e595 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -1083,13 +1083,8 @@ static int curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) /* needed or else the draw matrix can be incorrect */ view3d_operator_needs_opengl(C); - ED_view3d_autodist_init(cdd->vc.depsgraph, cdd->vc.region, cdd->vc.v3d, 0); - - if (cdd->vc.rv3d->depths) { - cdd->vc.rv3d->depths->damaged = true; - } - - ED_view3d_depth_update(cdd->vc.region); + ED_view3d_depth_override( + cdd->vc.depsgraph, cdd->vc.region, cdd->vc.v3d, NULL, V3D_DEPTH_NO_GPENCIL, true); if (cdd->vc.rv3d->depths != NULL) { cdd->project.use_depth = true; -- cgit v1.2.3