[Bf-blender-cvs] [51b67218ae7] master: Revert "Sculpt: Remove partial viewport updates from sculpt stroke code"

Pablo Dobarro noreply at git.blender.org
Mon Feb 10 19:36:20 CET 2020


Commit: 51b67218ae797dc77b20c467aea3c4918af4cb4d
Author: Pablo Dobarro
Date:   Tue Jan 28 01:22:30 2020 +0100
Branches: master
https://developer.blender.org/rB51b67218ae797dc77b20c467aea3c4918af4cb4d

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

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

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);
+    }
   }
 }



More information about the Bf-blender-cvs mailing list