diff options
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_draw.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 28c55813a3b..df8d3cfb8db 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -86,16 +86,12 @@ static int draw_uvs_face_check(const ToolSettings *ts) if (ts->selectmode == SCE_SELECT_FACE) { return 2; } - else if (ts->selectmode & SCE_SELECT_FACE) { + if (ts->selectmode & SCE_SELECT_FACE) { return 1; } - else { - return 0; - } - } - else { - return (ts->uv_selectmode == UV_SELECT_FACE); + return 0; } + return (ts->uv_selectmode == UV_SELECT_FACE); } /* ------------------------- */ @@ -412,21 +408,16 @@ static void draw_uvs(SpaceImage *sima, { /* We could modify the vbo's data filling * instead of modifying the provoking vert. */ - glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); + GPU_provoking_vertex(GPU_VERTEX_FIRST); UI_GetThemeColor3fv(TH_EDGE_SELECT, col2); col2[3] = overlay_alpha; - float dash_width = (sima->dt_uv & SI_UVDT_DASH) ? (4.0f * UI_DPI_FAC) : 9999.0f; + const float dash_width = (sima->dt_uv == SI_UVDT_DASH) ? (4.0f * UI_DPI_FAC) : 9999.0f; eGPUBuiltinShader shader = (interpedges) ? GPU_SHADER_2D_UV_EDGES_SMOOTH : GPU_SHADER_2D_UV_EDGES; - -#ifndef __APPLE__ - GPU_batch_program_set_builtin(batch->edges, shader); -#endif - - if (sima->dt_uv == SI_UVDT_OUTLINE) { #ifdef __APPLE__ + if (sima->dt_uv == SI_UVDT_OUTLINE) { /* Apple drivers do not support wide line. This is a workaround awaiting the 2D view * refactor. Limiting to OSX since this will slow down the drawing. (see T76806) */ GPU_batch_program_set_builtin(batch->edges, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); @@ -440,7 +431,13 @@ static void draw_uvs(SpaceImage *sima, GPU_batch_uniform_2fv(batch->edges, "viewportSize", &viewport[2]); GPU_batch_draw(batch->edges); -#else + } +#endif + + GPU_batch_program_set_builtin(batch->edges, shader); + + if (sima->dt_uv == SI_UVDT_OUTLINE) { +#ifndef __APPLE__ /* Black Outline. */ GPU_line_width(3.0f); GPU_batch_uniform_4f(batch->edges, "edgeColor", 0.0f, 0.0f, 0.0f, overlay_alpha); @@ -467,7 +464,7 @@ static void draw_uvs(SpaceImage *sima, GPU_batch_draw(batch->edges); GPU_depth_test(false); - glProvokingVertex(GL_LAST_VERTEX_CONVENTION); + GPU_provoking_vertex(GPU_VERTEX_LAST); } if (sima->flag & SI_SMOOTH_UV) { |