DRW: Fix GL state issues due to state not being reset after drawing

Callbacks were drawing with the wrong blend equation and that made some
tools drawing fail.
This commit is contained in:
Clément Foucault 2019-03-05 21:59:36 +01:00
parent dbdd79fabe
commit 6867821c4a
1 changed files with 6 additions and 0 deletions

View File

@ -1099,6 +1099,8 @@ static void drw_engines_draw_scene(void)
PROFILE_END_UPDATE(data->render_time, stime);
}
/* Reset state after drawing */
DRW_state_reset();
}
static void drw_engines_draw_text(void)
@ -1559,7 +1561,11 @@ void DRW_draw_render_loop_ex(
DRW_draw_callbacks_post_scene();
if (DST.draw_ctx.evil_C) {
DRW_state_reset();
ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.ar, REGION_DRAW_POST_VIEW);
/* Callback can be nasty and do whatever they want with the state.
* Don't trust them! */
DRW_state_reset();
}
DRW_state_reset();