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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 54838dcbdbb..e946aec2176 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -525,7 +525,7 @@ void UI_draw_anti_tria(
/* Note: This won't give back the original color. */
draw_color[3] *= 1.0f / WIDGET_AA_JITTER;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -544,7 +544,7 @@ void UI_draw_anti_tria(
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* triangle 'icon' inside rect */
@@ -569,7 +569,7 @@ void UI_draw_anti_fan(float tri_array[][2], uint length, const float color[4])
copy_v4_v4(draw_color, color);
draw_color[3] *= 2.0f / WIDGET_AA_JITTER;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -593,7 +593,7 @@ void UI_draw_anti_fan(float tri_array[][2], uint length, const float color[4])
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
static void widget_init(uiWidgetBase *wtb)
@@ -1197,11 +1197,11 @@ void UI_widgetbase_draw_cache_end(void)
BLI_assert(g_widget_base_batch.enabled == true);
g_widget_base_batch.enabled = false;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* Disable cached/instanced drawing and enforce single widget drawing pipeline.
@@ -1307,9 +1307,9 @@ static void widgetbase_draw_ex(uiWidgetBase *wtb,
widgetbase_set_uniform_colors_ubv(
wtb, inner_col1, inner_col2, outline_col, emboss_col, tria_col, show_alpha_checkers);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
draw_widgetbase_batch(wtb);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
}
@@ -1363,9 +1363,9 @@ static void widget_draw_icon(
float aspect, height;
if (but->flag & UI_BUT_ICON_PREVIEW) {
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
widget_draw_preview(icon, alpha, rect);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
return;
}
@@ -1401,7 +1401,7 @@ static void widget_draw_icon(
}
}
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
if (icon && icon != ICON_BLANK1) {
float ofs = 1.0f / aspect;
@@ -1454,7 +1454,7 @@ static void widget_draw_icon(
}
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
static void widget_draw_submenu_tria(const uiBut *but,
@@ -1475,9 +1475,9 @@ static void widget_draw_submenu_tria(const uiBut *but,
BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height);
BLI_rctf_scale(&tria_rect, 0.4f);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
ui_draw_anti_tria_rect(&tria_rect, 'h', col);
}
@@ -2022,9 +2022,9 @@ static void widget_draw_text(const uiFontStyle *fstyle,
if (drawstr[0] != 0) {
/* We are drawing on top of widget bases. Flush cache. */
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
if (but->selsta >= but->ofs) {
selsta_draw = BLF_width(fstyle->uifont_id, drawstr + but->ofs, but->selsta - but->ofs);
@@ -2069,9 +2069,9 @@ static void widget_draw_text(const uiFontStyle *fstyle,
t = 0;
}
/* We are drawing on top of widget bases. Flush cache. */
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
@@ -2266,9 +2266,9 @@ static void widget_draw_node_link_socket(const uiWidgetColors *wcol,
rgba_uchar_to_float(col, but->col);
col[3] *= alpha;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
ED_node_socket_draw(but->custom_data, rect, col, scale);
}
@@ -2327,9 +2327,9 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle,
/* draw icon in rect above the space reserved for the label */
rect->ymin += text_size;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
widget_draw_preview(icon, alpha, rect);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
/* offset rect to draw label in */
rect->ymin -= text_size;
@@ -2784,15 +2784,15 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir
rect->ymax += 0.1f * U.widget_unit;
}
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
widget_softshadow(rect, roundboxalign, wcol->roundness * U.widget_unit);
round_box_edges(&wtb, roundboxalign, rect, wcol->roundness * U.widget_unit);
wtb.draw_emboss = false;
widgetbase_draw(&wtb, wcol);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
static void ui_hsv_cursor(float x, float y)
@@ -2804,11 +2804,11 @@ static void ui_hsv_cursor(float x, float y)
immUniformColor3f(1.0f, 1.0f, 1.0f);
imm_draw_circle_fill_2d(pos, x, y, 3.0f * U.pixelsize, 8);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
immUniformColor3f(0.0f, 0.0f, 0.0f);
imm_draw_circle_wire_2d(pos, x, y, 3.0f * U.pixelsize, 12);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_line_smooth(false);
immUnbindProgram();
@@ -2936,7 +2936,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, const uiWidgetColors *wcol, const
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
immUniformColor3ubv(wcol->outline);
@@ -2944,7 +2944,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, const uiWidgetColors *wcol, const
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_line_smooth(false);
/* cursor */
@@ -3243,9 +3243,9 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect)
}));
/* We are drawing on top of widget bases. Flush cache. */
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
/* cursor */
x = rect->xmin + 0.5f * BLI_rcti_size_x(rect);
@@ -3269,7 +3269,7 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
immUniformColor4ubv(col);
GPU_line_width(1.0f);
@@ -3278,7 +3278,7 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
immVertex2f(pos, rect->xmax, y);
immEnd();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
immUnbindProgram();
}
@@ -3836,9 +3836,9 @@ static void widget_swatch(
bw += (bw < 0.5f) ? 0.5f : -0.5f;
/* We are drawing on top of widget bases. Flush cache. */
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -4200,9 +4200,9 @@ static void widget_tab(uiWidgetColors *wcol, rcti *rect, int state, int roundbox
widgetbase_draw(&wtb, wcol);
/* We are drawing on top of widget bases. Flush cache. */
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
#ifdef USE_TAB_SHADED_HIGHLIGHT
/* draw outline (3d look) */
@@ -4817,12 +4817,12 @@ void ui_draw_but(const bContext *C, struct ARegion *region, uiStyle *style, uiBu
}
if (disabled) {
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
}
wt->text(fstyle, &wt->wcol, but, rect);
if (disabled) {
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
}
}
@@ -4905,7 +4905,7 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
rect->xmax - unit_size) :
BLI_rcti_cent_x(rect);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
/* Extracted from 'widget_menu_back', keep separate to avoid menu changes breaking popovers */
{
@@ -4929,7 +4929,7 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
const int sign = is_down ? 1 : -1;
float y = is_down ? rect->ymax : rect->ymin;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
immBegin(GPU_PRIM_TRIS, 3);
immUniformColor4ub(UNPACK3(wcol->outline), 166);
immVertex2f(pos, cent_x - unit_half, y);
@@ -4939,7 +4939,7 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
y = y - sign * round(U.pixelsize * 1.41);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
immBegin(GPU_PRIM_TRIS, 3);
immUniformColor4ub(0, 0, 0, 0);
immVertex2f(pos, cent_x - unit_half, y);
@@ -4947,7 +4947,7 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
immVertex2f(pos, cent_x, y + sign * unit_half);
immEnd();
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
immBegin(GPU_PRIM_TRIS, 3);
immUniformColor4ubv(wcol->inner);
immVertex2f(pos, cent_x - unit_half, y);
@@ -4958,7 +4958,7 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
immUnbindProgram();
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
void ui_draw_popover_back(struct ARegion *region,
@@ -5059,7 +5059,7 @@ void ui_draw_pie_center(uiBlock *block)
GPU_matrix_push();
GPU_matrix_translate_2f(cx, cy);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
if (btheme->tui.wcol_pie_menu.shaded) {
uchar col1[4], col2[4];
shadecolors4(col1,
@@ -5142,7 +5142,7 @@ void ui_draw_pie_center(uiBlock *block)
false);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_matrix_pop();
}
@@ -5163,10 +5163,10 @@ static void ui_draw_widget_back_color(uiWidgetTypeEnum type,
uiWidgetType *wt = widget_type(type);
if (use_shadow) {
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
widget_softshadow(rect, UI_CNR_ALL, 0.25f * U.widget_unit);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
rcti rect_copy = *rect;
@@ -5289,10 +5289,10 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
height = ICON_SIZE_FROM_BUTRECT(rect);
aspect = ICON_DEFAULT_HEIGHT / height;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
/* XXX scale weak get from fstyle? */
UI_icon_draw_ex(xs, ys, iconid, aspect, 1.0f, 0.0f, wt->wcol.text, false);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* part text right aligned */
@@ -5328,9 +5328,9 @@ void ui_draw_preview_item(
/* draw icon in rect above the space reserved for the label */
rect->ymin += text_size;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
widget_draw_preview(iconid, 1.0f, rect);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
BLF_width_and_height(
fstyle->uifont_id, name, BLF_DRAW_STR_DUMMY_MAX, &font_dims[0], &font_dims[1]);