[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48991] trunk/blender/source/blender/ blenkernel: disable feather collapse during drawing, its very slow.

Campbell Barton ideasman42 at gmail.com
Tue Jul 17 11:56:11 CEST 2012


Revision: 48991
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48991
Author:   campbellbarton
Date:     2012-07-17 09:56:10 +0000 (Tue, 17 Jul 2012)
Log Message:
-----------
disable feather collapse during drawing, its very slow.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_mask.h
    trunk/blender/source/blender/blenkernel/intern/mask.c
    trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c

Modified: trunk/blender/source/blender/blenkernel/BKE_mask.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_mask.h	2012-07-17 03:05:42 UTC (rev 48990)
+++ trunk/blender/source/blender/blenkernel/BKE_mask.h	2012-07-17 09:56:10 UTC (rev 48991)
@@ -72,9 +72,11 @@
 float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int *tot_diff_point))[2];
 float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, int *tot_feather_point))[2];
 
-float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, const int resol, int *tot_diff_point))[2];
+float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, int *tot_diff_point,
+                                                         const int resol))[2];
 float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_diff_point))[2];
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, const int resol, int *tot_feather_point))[2];
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, int *tot_feather_point,
+                                                                         const int resol, const int do_collapse))[2];
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_feather_point))[2];
 
 float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];

Modified: trunk/blender/source/blender/blenkernel/intern/mask.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask.c	2012-07-17 03:05:42 UTC (rev 48990)
+++ trunk/blender/source/blender/blenkernel/intern/mask.c	2012-07-17 09:56:10 UTC (rev 48991)
@@ -331,8 +331,10 @@
 	return len;
 }
 
-float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline, const int resol,
-                                                         int *tot_diff_point))[2]
+float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
+                                                         int *tot_diff_point,
+                                                         const int resol
+                                                         ))[2]
 {
 	MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
 
@@ -389,11 +391,12 @@
 }
 
 float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline, int width, int height,
-                                                      int *tot_diff_point))[2]
+                                                      int *tot_diff_point
+                                                      ))[2]
 {
 	int resol = BKE_mask_spline_resolution(spline, width, height);
 
-	return BKE_mask_spline_differentiate_with_resolution_ex(spline, resol, tot_diff_point);
+	return BKE_mask_spline_differentiate_with_resolution_ex(spline, tot_diff_point, resol);
 }
 
 float (*BKE_mask_spline_differentiate(MaskSpline *spline, int *tot_diff_point))[2]
@@ -562,8 +565,11 @@
  * values align with #BKE_mask_spline_differentiate_with_resolution_ex
  * when \a resol arguments match.
  */
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpline *spline, const int resol,
-                                                                         int *tot_feather_point))[2]
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpline *spline,
+                                                                         int *tot_feather_point,
+                                                                         const int resol,
+                                                                         const int do_collapse
+                                                                         ))[2]
 {
 	MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
 	MaskSplinePoint *point, *prev;
@@ -624,7 +630,10 @@
 
 	*tot_feather_point = tot;
 
-	spline_feather_collapse_inner_loops(feather, tot);
+	/* this is slow! - don't do on draw */
+	if (do_collapse) {
+		spline_feather_collapse_inner_loops(feather, tot);
+	}
 
 	return feather;
 }
@@ -634,7 +643,7 @@
 {
 	int resol = BKE_mask_spline_feather_resolution(spline, width, height);
 
-	return BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, resol, tot_feather_point);
+	return BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, tot_feather_point, resol, FALSE);
 }
 
 float (*BKE_mask_spline_feather_differentiated_points(MaskSpline *spline, int *tot_feather_point))[2]

Modified: trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2012-07-17 03:05:42 UTC (rev 48990)
+++ trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2012-07-17 09:56:10 UTC (rev 48991)
@@ -525,11 +525,11 @@
 			const int resol = CLAMPIS(MAX2(resol_a, resol_b), 4, 512);
 
 			diff_points = BKE_mask_spline_differentiate_with_resolution_ex(
-			                  spline, resol, &tot_diff_point);
+			                  spline, &tot_diff_point, resol);
 
 			if (do_feather) {
 				diff_feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution_ex(
-				                          spline, resol, &tot_diff_feather_points);
+				                          spline, &tot_diff_feather_points, resol, TRUE);
 			}
 			else {
 				tot_diff_feather_points = 0;




More information about the Bf-blender-cvs mailing list