Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_draw.cc
| Show First 20 Lines • Show All 1,952 Lines • ▼ Show 20 Lines | |||||
| static void outliner_draw_separator(ARegion *region, const int x) | static void outliner_draw_separator(ARegion *region, const int x) | ||||
| { | { | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| GPU_line_width(1.0f); | GPU_line_width(1.0f); | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); | immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2f(pos, x, v2d->cur.ymax); | immVertex2f(pos, x, v2d->cur.ymax); | ||||
| immVertex2f(pos, x, v2d->cur.ymin); | immVertex2f(pos, x, v2d->cur.ymin); | ||||
| immEnd(); | immEnd(); | ||||
| ▲ Show 20 Lines • Show All 1,607 Lines • ▼ Show 20 Lines | static void outliner_draw_struct_marks(ARegion *region, | ||||
| LISTBASE_FOREACH (TreeElement *, te, lb) { | LISTBASE_FOREACH (TreeElement *, te, lb) { | ||||
| TreeStoreElem *tselem = TREESTORE(te); | TreeStoreElem *tselem = TREESTORE(te); | ||||
| /* Selection status. */ | /* Selection status. */ | ||||
| if (TSELEM_OPEN(tselem, space_outliner)) { | if (TSELEM_OPEN(tselem, space_outliner)) { | ||||
| if (tselem->type == TSE_RNA_STRUCT) { | if (tselem->type == TSE_RNA_STRUCT) { | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immThemeColorShadeAlpha(TH_BACK, -15, -200); | immThemeColorShadeAlpha(TH_BACK, -15, -200); | ||||
| immRecti(pos, 0, *starty + 1, (int)region->v2d.cur.xmax, *starty + UI_UNIT_Y - 1); | immRecti(pos, 0, *starty + 1, (int)region->v2d.cur.xmax, *starty + UI_UNIT_Y - 1); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| } | } | ||||
| *starty -= UI_UNIT_Y; | *starty -= UI_UNIT_Y; | ||||
| if (TSELEM_OPEN(tselem, space_outliner)) { | if (TSELEM_OPEN(tselem, space_outliner)) { | ||||
| outliner_draw_struct_marks(region, space_outliner, &te->subtree, starty); | outliner_draw_struct_marks(region, space_outliner, &te->subtree, starty); | ||||
| if (tselem->type == TSE_RNA_STRUCT) { | if (tselem->type == TSE_RNA_STRUCT) { | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immThemeColorShadeAlpha(TH_BACK, -15, -200); | immThemeColorShadeAlpha(TH_BACK, -15, -200); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2f(pos, 0, (float)*starty + UI_UNIT_Y); | immVertex2f(pos, 0, (float)*starty + UI_UNIT_Y); | ||||
| immVertex2f(pos, region->v2d.cur.xmax, (float)*starty + UI_UNIT_Y); | immVertex2f(pos, region->v2d.cur.xmax, (float)*starty + UI_UNIT_Y); | ||||
| immEnd(); | immEnd(); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| ▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | static void outliner_draw_highlights(ARegion *region, | ||||
| UI_GetThemeColor3fv(TH_SELECT_ACTIVE, col_active); | UI_GetThemeColor3fv(TH_SELECT_ACTIVE, col_active); | ||||
| col_active[3] = 1.0f; /* No alpha. */ | col_active[3] = 1.0f; /* No alpha. */ | ||||
| UI_GetThemeColor4fv(TH_MATCH, col_searchmatch); | UI_GetThemeColor4fv(TH_MATCH, col_searchmatch); | ||||
| col_searchmatch[3] = 0.5f; | col_searchmatch[3] = 0.5f; | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| outliner_draw_highlights(pos, | outliner_draw_highlights(pos, | ||||
| region, | region, | ||||
| space_outliner, | space_outliner, | ||||
| col_selection, | col_selection, | ||||
| col_active, | col_active, | ||||
| col_highlight, | col_highlight, | ||||
| col_searchmatch, | col_searchmatch, | ||||
| startx, | startx, | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | static void outliner_back(ARegion *region) | ||||
| int ystart; | int ystart; | ||||
| ystart = (int)region->v2d.tot.ymax; | ystart = (int)region->v2d.tot.ymax; | ||||
| ystart = UI_UNIT_Y * (ystart / (UI_UNIT_Y)) - OL_Y_OFFSET; | ystart = UI_UNIT_Y * (ystart / (UI_UNIT_Y)) - OL_Y_OFFSET; | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| float col_alternating[4]; | float col_alternating[4]; | ||||
| UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating); | UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating); | ||||
| immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]); | immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]); | ||||
| const float x1 = 0.0f, x2 = region->v2d.cur.xmax; | const float x1 = 0.0f, x2 = region->v2d.cur.xmax; | ||||
| float y1 = ystart, y2; | float y1 = ystart, y2; | ||||
| int tot = (int)floor(ystart - region->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y); | int tot = (int)floor(ystart - region->v2d.cur.ymin + 2 * UI_UNIT_Y) / (2 * UI_UNIT_Y); | ||||
| ▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines | |||||