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:
authorCyrax <cyrax.iiit@gmail.com>2017-02-07 20:50:04 +0300
committerMike Erwin <significant.bit@gmail.com>2017-02-08 22:37:37 +0300
commit525937cc397efa078478ae926fe30d5d87be3806 (patch)
treec7e66135bd62af2638e5858caba744ad3c0fefc3 /source/blender
parent61df9fdb2f74cf035013a62f1b0d01246040fae5 (diff)
OpenGL: outliner_draw_highlights uses new imm mode
Patch D2433 by @cyrax, part of T49043 reviewed by @merwin
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index d7229729e26..d5921624e85 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1435,7 +1435,7 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase *
}
static void outliner_draw_highlights_recursive(
- const ARegion *ar, const SpaceOops *soops, const ListBase *lb,
+ unsigned pos, const ARegion *ar, const SpaceOops *soops, const ListBase *lb,
const float col_selection[4], const float col_highlight[4], const float col_searchmatch[4],
int start_x, int *io_start_y)
{
@@ -1448,29 +1448,29 @@ static void outliner_draw_highlights_recursive(
/* selection status */
if (tselem->flag & TSE_SELECTED) {
- glColor4fv(col_selection);
- glRecti(0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1);
+ immUniformColor4fv(col_selection);
+ immRecti(pos, 0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1);
}
/* search match highlights
* we don't expand items when searching in the datablocks but we
* still want to highlight any filter matches. */
if (is_searching && (tselem->flag & TSE_SEARCHMATCH)) {
- glColor4fv(col_searchmatch);
- glRecti(start_x, start_y + 1, ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1);
+ immUniformColor4fv(col_searchmatch);
+ immRecti(pos, start_x, start_y + 1, ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1);
}
/* mouse hover highlights */
if (tselem->flag & TSE_HIGHLIGHTED) {
- glColor4fv(col_highlight);
- glRecti(0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1);
+ immUniformColor4fv(col_highlight);
+ immRecti(pos, 0, start_y + 1, (int)ar->v2d.cur.xmax, start_y + UI_UNIT_Y - 1);
}
*io_start_y -= UI_UNIT_Y;
if (TSELEM_OPEN(tselem, soops)) {
outliner_draw_highlights_recursive(
- ar, soops, &te->subtree, col_selection, col_highlight, col_searchmatch,
- start_x + UI_UNIT_X, io_start_y);
+ pos, ar, soops, &te->subtree, col_selection, col_highlight, col_searchmatch,
+ start_x + UI_UNIT_X, io_start_y);
}
}
}
@@ -1486,8 +1486,12 @@ static void outliner_draw_highlights(ARegion *ar, SpaceOops *soops, int startx,
col_searchmatch[3] = 0.5f;
glEnable(GL_BLEND);
- outliner_draw_highlights_recursive(ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch,
- startx, starty);
+ VertexFormat *format = immVertexFormat();
+ unsigned pos = add_attrib(format, "pos", GL_INT, 2, CONVERT_INT_TO_FLOAT);
+ immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+ outliner_draw_highlights_recursive(pos, ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch,
+ startx, starty);
+ immUnbindProgram();
glDisable(GL_BLEND);
}