Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-01-28 03:22:30 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-02-10 21:41:35 +0300
commit51b67218ae797dc77b20c467aea3c4918af4cb4d (patch)
tree0d41f5a97b329f07b938893159e6cbd3c9db1088
parent78cf61cc6292eb66c5835cf337ad8fb3e1c259b2 (diff)
Revert "Sculpt: Remove partial viewport updates from sculpt stroke code"
This reverts commit 394b48029c5335381f774f83524ad6ee5cb986da. Leaving this here does not affect performance in any significant way and it may be useful in the future. Reviewed By: brecht Differential Revision: https://developer.blender.org/D6688
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 00fb8abc06d..23521b8496c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -7537,7 +7537,9 @@ 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. */
+ /* 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;
if (update_flags & SCULPT_UPDATE_COORDS) {
BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB);
@@ -7547,7 +7549,21 @@ static void sculpt_flush_update_step(bContext *C, SculptUpdateType update_flags)
sculpt_update_object_bounding_box(ob);
}
- ED_region_tag_redraw(ar);
+ 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);
+ }
}
}