Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_edit_text.cc
| Show All 31 Lines | void OVERLAY_edit_text_cache_init(OVERLAY_Data *vedata) | ||||
| /* Run Twice for in-front passes. */ | /* Run Twice for in-front passes. */ | ||||
| for (int i = 0; i < 2; i++) { | for (int i = 0; i < 2; i++) { | ||||
| state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH; | state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH; | ||||
| state |= ((i == 0) ? DRW_STATE_DEPTH_LESS_EQUAL : DRW_STATE_DEPTH_ALWAYS); | state |= ((i == 0) ? DRW_STATE_DEPTH_LESS_EQUAL : DRW_STATE_DEPTH_ALWAYS); | ||||
| DRW_PASS_CREATE(psl->edit_text_wire_ps[i], state | pd->clipping_state); | DRW_PASS_CREATE(psl->edit_text_wire_ps[i], state | pd->clipping_state); | ||||
| sh = OVERLAY_shader_uniform_color(); | sh = OVERLAY_shader_uniform_color(); | ||||
| pd->edit_text_wire_grp[i] = grp = DRW_shgroup_create(sh, psl->edit_text_wire_ps[i]); | pd->edit_text_wire_grp[i] = grp = DRW_shgroup_create(sh, psl->edit_text_wire_ps[i]); | ||||
| DRW_shgroup_uniform_vec4_copy(grp, "color", G_draw.block.color_wire); | DRW_shgroup_uniform_vec4_copy(grp, "ucolor", G_draw.block.color_wire); | ||||
| } | } | ||||
| { | { | ||||
| /* Cursor (text caret). */ | /* Cursor (text caret). */ | ||||
| state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA; | state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA; | ||||
| DRW_PASS_CREATE(psl->edit_text_cursor_ps, state | pd->clipping_state); | DRW_PASS_CREATE(psl->edit_text_cursor_ps, state | pd->clipping_state); | ||||
| sh = OVERLAY_shader_uniform_color(); | sh = OVERLAY_shader_uniform_color(); | ||||
| pd->edit_text_cursor_grp = grp = DRW_shgroup_create(sh, psl->edit_text_cursor_ps); | pd->edit_text_cursor_grp = grp = DRW_shgroup_create(sh, psl->edit_text_cursor_ps); | ||||
| DRW_shgroup_uniform_vec4(grp, "color", pd->edit_text.cursor_color, 1); | DRW_shgroup_uniform_vec4(grp, "ucolor", pd->edit_text.cursor_color, 1); | ||||
| /* Selection boxes. */ | /* Selection boxes. */ | ||||
| state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA; | state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA; | ||||
| DRW_PASS_CREATE(psl->edit_text_selection_ps, state | pd->clipping_state); | DRW_PASS_CREATE(psl->edit_text_selection_ps, state | pd->clipping_state); | ||||
| sh = OVERLAY_shader_uniform_color(); | sh = OVERLAY_shader_uniform_color(); | ||||
| pd->edit_text_selection_grp = grp = DRW_shgroup_create(sh, psl->edit_text_selection_ps); | pd->edit_text_selection_grp = grp = DRW_shgroup_create(sh, psl->edit_text_selection_ps); | ||||
| DRW_shgroup_uniform_vec4(grp, "color", pd->edit_text.selection_color, 1); | DRW_shgroup_uniform_vec4(grp, "ucolor", pd->edit_text.selection_color, 1); | ||||
| /* Highlight text within selection boxes. */ | /* Highlight text within selection boxes. */ | ||||
| state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA | DRW_STATE_DEPTH_GREATER_EQUAL | | state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA | DRW_STATE_DEPTH_GREATER_EQUAL | | ||||
| pd->clipping_state; | pd->clipping_state; | ||||
| DRW_PASS_INSTANCE_CREATE(psl->edit_text_highlight_ps, psl->edit_text_selection_ps, state); | DRW_PASS_INSTANCE_CREATE(psl->edit_text_highlight_ps, psl->edit_text_selection_ps, state); | ||||
| } | } | ||||
| { | { | ||||
| /* Create view which will render everything (hopefully) behind the text geometry. */ | /* Create view which will render everything (hopefully) behind the text geometry. */ | ||||
| ▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines | |||||