disable feather collapse during drawing, its very slow.
This commit is contained in:
parent
32cf7fcdb1
commit
f4cff34392
|
@ -72,9 +72,11 @@ int BKE_mask_spline_differentiate_calc_total(const struct MaskSpline *spline, co
|
|||
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];
|
||||
|
|
|
@ -331,8 +331,10 @@ int BKE_mask_spline_differentiate_calc_total(const MaskSpline *spline, const int
|
|||
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_ex(MaskSpline *spline, con
|
|||
}
|
||||
|
||||
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 @@ static void spline_feather_collapse_inner_loops(float (*feather_points)[2], int
|
|||
* 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 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
|
|||
|
||||
*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 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline
|
|||
{
|
||||
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]
|
||||
|
|
|
@ -525,11 +525,11 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue