Sculpt: Remove partial viewport updates from sculpt stroke code

Partial updates are not currently supported in the Workbench engine, so
we can skip the rect calculation during the stroke.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6444
This commit is contained in:
Pablo Dobarro 2019-12-18 17:35:03 +01:00
parent 6a54969cf1
commit 394b48029c
Notes: blender-bot 2023-02-14 10:21:15 +01:00
Referenced by commit 51b67218ae, Revert "Sculpt: Remove partial viewport updates from sculpt stroke code"
1 changed files with 2 additions and 18 deletions

View File

@ -7212,9 +7212,7 @@ static void sculpt_flush_update_step(bContext *C, SculptUpdateType update_flags)
ED_region_tag_redraw(ar);
}
else {
/* Fast path where we just update the BVH nodes that changed, and redraw
* only the part of the 3D viewport where changes happened. */
rcti r;
/* Fast path where we just update the BVH nodes that changed. */
if (update_flags & SCULPT_UPDATE_COORDS) {
BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB);
@ -7224,21 +7222,7 @@ static void sculpt_flush_update_step(bContext *C, SculptUpdateType update_flags)
sculpt_update_object_bounding_box(ob);
}
if (sculpt_get_redraw_rect(ar, CTX_wm_region_view3d(C), ob, &r)) {
if (ss->cache) {
ss->cache->current_r = r;
}
/* previous is not set in the current cache else
* the partial rect will always grow */
sculpt_extend_redraw_rect_previous(ob, &r);
r.xmin += ar->winrct.xmin - 2;
r.xmax += ar->winrct.xmin + 2;
r.ymin += ar->winrct.ymin - 2;
r.ymax += ar->winrct.ymin + 2;
ED_region_tag_redraw_partial(ar, &r, true);
}
ED_region_tag_redraw(ar);
}
}