Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/ed_util_imbuf.c
| Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Lines | if (area && area->spacetype == SPACE_IMAGE) { | ||||
| const wmWindow *win = CTX_wm_window(C); | const wmWindow *win = CTX_wm_window(C); | ||||
| const wmEvent *event = win->eventstate; | const wmEvent *event = win->eventstate; | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| 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); | ||||
| const float color[3] = {1, 1, 1}; | const float color[3] = {1, 1, 1}; | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor3fv(color); | immUniformColor3fv(color); | ||||
| /* TODO(@campbellbarton): lock to pixels. */ | /* TODO(@campbellbarton): lock to pixels. */ | ||||
| rctf sample_rect_fl; | rctf sample_rect_fl; | ||||
| BLI_rctf_init_pt_radius( | BLI_rctf_init_pt_radius( | ||||
| &sample_rect_fl, | &sample_rect_fl, | ||||
| (float[2]){event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin}, | (float[2]){event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin}, | ||||
| (float)(info->sample_size / 2.0f) * sima->zoom); | (float)(info->sample_size / 2.0f) * sima->zoom); | ||||
| ▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines | |||||