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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-06-22 12:00:26 +0300
committerSergey Sharybin <sergey@blender.org>2022-06-28 11:55:45 +0300
commitc1ffea157c5be4359a3f265ea4711a8fb5474ad2 (patch)
tree7a306c2726fae31ac52e23ed69d0264c6f7eae3c /source
parentf9076f3869515cd45d69a5a80382e5e3d759c54a (diff)
Mask editor: Always use smooth drawing
The mask is expected to be always be displayed smooth, and the option mainly existed for some legacy drivers. IF smooth drawing causes issues it should be fixed in the drawing code, not as an option in the interface. Differential Revision: https://developer.blender.org/D15266
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/mask/mask_draw.c43
-rw-r--r--source/blender/makesdna/DNA_mask_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_space.c5
3 files changed, 14 insertions, 36 deletions
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index a18419ad422..4662fe9d1a8 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -171,12 +171,10 @@ static void draw_single_handle(const MaskLayer *mask_layer,
static void draw_spline_points(const bContext *C,
MaskLayer *mask_layer,
MaskSpline *spline,
- const char draw_flag,
const char draw_type)
{
const bool is_spline_sel = (spline->flag & SELECT) &&
(mask_layer->visibility_flag & MASK_HIDE_SELECT) == 0;
- const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0;
uchar rgb_spline[4];
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -253,9 +251,7 @@ static void draw_spline_points(const bContext *C,
immUnbindProgram();
- if (is_smooth) {
- GPU_line_smooth(true);
- }
+ GPU_line_smooth(true);
/* control points */
INIT_MINMAX2(min, max);
@@ -323,9 +319,7 @@ static void draw_spline_points(const bContext *C,
minmax_v2v2_v2(min, max, vert);
}
- if (is_smooth) {
- GPU_line_smooth(false);
- }
+ GPU_line_smooth(false);
if (is_spline_sel) {
float x = (min[0] + max[0]) * 0.5f;
@@ -502,7 +496,6 @@ static void mask_draw_curve_type(const bContext *C,
static void draw_spline_curve(const bContext *C,
MaskLayer *mask_layer,
MaskSpline *spline,
- const char draw_flag,
const char draw_type,
const bool is_active,
const int width,
@@ -515,7 +508,6 @@ static void draw_spline_curve(const bContext *C,
const bool is_spline_sel = (spline->flag & SELECT) &&
(mask_layer->visibility_flag & MASK_HIDE_SELECT) == 0;
- const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0;
const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
uint tot_diff_point;
@@ -530,9 +522,7 @@ static void draw_spline_curve(const bContext *C,
return;
}
- if (is_smooth) {
- GPU_line_smooth(true);
- }
+ GPU_line_smooth(true);
feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution(
spline, resol, (is_fill != false), &tot_feather_point);
@@ -567,14 +557,11 @@ static void draw_spline_curve(const bContext *C,
C, spline, diff_points, tot_diff_point, false, is_active, rgb_tmp, draw_type);
MEM_freeN(diff_points);
- if (is_smooth) {
- GPU_line_smooth(false);
- }
+ GPU_line_smooth(false);
}
static void draw_layer_splines(const bContext *C,
MaskLayer *layer,
- const char draw_flag,
const char draw_type,
const int width,
const int height,
@@ -582,11 +569,11 @@ static void draw_layer_splines(const bContext *C,
{
LISTBASE_FOREACH (MaskSpline *, spline, &layer->splines) {
/* draw curve itself first... */
- draw_spline_curve(C, layer, spline, draw_flag, draw_type, is_active, width, height);
+ draw_spline_curve(C, layer, spline, draw_type, is_active, width, height);
if (!(layer->visibility_flag & MASK_HIDE_SELECT)) {
/* ...and then handles over the curve so they're nicely visible */
- draw_spline_points(C, layer, spline, draw_flag, draw_type);
+ draw_spline_points(C, layer, spline, draw_type);
}
/* show undeform for testing */
@@ -594,19 +581,15 @@ static void draw_layer_splines(const bContext *C,
void *back = spline->points_deform;
spline->points_deform = NULL;
- draw_spline_curve(C, layer, spline, draw_flag, draw_type, is_active, width, height);
- draw_spline_points(C, layer, spline, draw_flag, draw_type);
+ draw_spline_curve(C, layer, spline, draw_type, is_active, width, height);
+ draw_spline_points(C, layer, spline, draw_type);
spline->points_deform = back;
}
}
}
-static void draw_mask_layers(const bContext *C,
- Mask *mask,
- const char draw_flag,
- const char draw_type,
- const int width,
- const int height)
+static void draw_mask_layers(
+ const bContext *C, Mask *mask, const char draw_type, const int width, const int height)
{
GPU_blend(GPU_BLEND_ALPHA);
GPU_program_point_size(true);
@@ -628,11 +611,11 @@ static void draw_mask_layers(const bContext *C,
continue;
}
- draw_layer_splines(C, mask_layer, draw_flag, draw_type, width, height, is_active);
+ draw_layer_splines(C, mask_layer, draw_type, width, height, is_active);
}
if (active != NULL) {
- draw_layer_splines(C, active, draw_flag, draw_type, width, height, true);
+ draw_layer_splines(C, active, draw_type, width, height, true);
}
GPU_program_point_size(false);
@@ -777,7 +760,7 @@ void ED_mask_draw_region(
/* draw! */
if (draw_flag & MASK_DRAWFLAG_SPLINE) {
- draw_mask_layers(C, mask_eval, draw_flag, draw_type, width, height);
+ draw_mask_layers(C, mask_eval, draw_type, width, height);
}
if (do_draw_cb) {
diff --git a/source/blender/makesdna/DNA_mask_types.h b/source/blender/makesdna/DNA_mask_types.h
index df4e6f788ff..fbbcd340ae9 100644
--- a/source/blender/makesdna/DNA_mask_types.h
+++ b/source/blender/makesdna/DNA_mask_types.h
@@ -196,7 +196,7 @@ enum {
#define MASK_HIDE_RENDER (1 << 2)
/* SpaceClip->mask_draw_flag */
-#define MASK_DRAWFLAG_SMOOTH (1 << 0)
+/* #define MASK_DRAWFLAG_SMOOTH_DEPRECATED (1 << 0) */ /* Deprecated */
#define MASK_DRAWFLAG_OVERLAY (1 << 1)
#define MASK_DRAWFLAG_SPLINE (1 << 2)
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 0b780a3fcc6..70f111359a5 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3478,11 +3478,6 @@ static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *m
RNA_def_property_ui_text(prop, "Edge Display Type", "Display type for mask splines");
RNA_def_property_update(prop, noteflag, NULL);
- prop = RNA_def_property(srna, "show_mask_smooth", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SMOOTH);
- RNA_def_property_ui_text(prop, "Display Smooth Splines", "");
- RNA_def_property_update(prop, noteflag, NULL);
-
prop = RNA_def_property(srna, "show_mask_spline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SPLINE);
RNA_def_property_ui_text(prop, "Show Mask Spline", "");