diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-03 17:38:22 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-03 17:38:22 +0300 |
commit | d98ec04341260d1f2e5967105013472d85f7af5d (patch) | |
tree | 52b8544b30d0d7521f0c79e8a4459dd5e15043d0 /source/blender/editors/interface | |
parent | 481a75a08ab601891d82cf8b113331dd205054bc (diff) |
Fix incorrect drawing of material list outline, after recent changes.
For draw cache flushing the default blend mode needs to be set.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index a077a91a4b9..b9202f26a05 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1307,9 +1307,6 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), rect = ima->rect; } - /* We need to flush widget base first to ensure correct ordering. */ - UI_widgetbase_draw_cache_flush(); - /* draw */ GPUBuiltinShader shader; if (desaturate != 0.0f) { @@ -1513,17 +1510,15 @@ static void icon_draw_size( DrawInfo *di = icon_ensure_drawinfo(icon); + /* We need to flush widget base first to ensure correct ordering. */ + UI_widgetbase_draw_cache_flush(); + if (di->type == ICON_TYPE_VECTOR) { - /* We need to flush widget base first to ensure correct ordering. */ - UI_widgetbase_draw_cache_flush(); /* vector icons use the uiBlock transformation, they are not drawn * with untransformed coordinates like the other icons */ di->data.vector.func((int)x, (int)y, w, h, 1.0f); } else if (di->type == ICON_TYPE_GEOM) { - /* We need to flush widget base first to ensure correct ordering. */ - UI_widgetbase_draw_cache_flush(); - #ifdef USE_UI_TOOLBAR_HACK /* TODO(campbell): scale icons up for toolbar, we need a way to detect larger buttons and do this automatic. */ { @@ -1547,7 +1542,8 @@ static void icon_draw_size( ibuf = BKE_icon_geom_rasterize(icon->obj, w, h); di->data.geom.image_cache = ibuf; } - glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + + GPU_blend_set_func_separate(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); icon_draw_rect(x, y, w, h, aspect, w, h, ibuf->rect, alpha, rgb, desaturate); GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); } @@ -1591,9 +1587,7 @@ static void icon_draw_size( #endif if (!iimg->rect) return; /* something has gone wrong! */ - GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); icon_draw_rect(x, y, w, h, aspect, iimg->w, iimg->h, iimg->rect, alpha, rgb, desaturate); - GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); } else if (di->type == ICON_TYPE_PREVIEW) { PreviewImage *pi = (icon->id_type != 0) ? BKE_previewimg_id_ensure((ID *)icon->obj) : icon->obj; @@ -1611,9 +1605,6 @@ static void icon_draw_size( else if (di->type == ICON_TYPE_GPLAYER) { BLI_assert(icon->obj != NULL); - /* We need to flush widget base first to ensure correct ordering. */ - UI_widgetbase_draw_cache_flush(); - /* Just draw a colored rect - Like for vicon_colorset_draw() */ #ifndef WITH_HEADLESS vicon_gplayer_color_draw(icon, (int)x, (int)y, w, h); |