Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.cc
| Show First 20 Lines • Show All 621 Lines • ▼ Show 20 Lines | if (node->custom1 == 0) { | ||||
| const float backdropHeight = backdrop->y; | const float backdropHeight = backdrop->y; | ||||
| const float cx = x + snode->zoom * backdropWidth * node->custom3; | const float cx = x + snode->zoom * backdropWidth * node->custom3; | ||||
| const float cy = y + snode->zoom * backdropHeight * node->custom4; | const float cy = y + snode->zoom * backdropHeight * node->custom4; | ||||
| const float cross_size = 12 * U.pixelsize; | const float cross_size = 12 * U.pixelsize; | ||||
| 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); | ||||
| immUniformColor3f(1.0f, 1.0f, 1.0f); | immUniformColor3f(1.0f, 1.0f, 1.0f); | ||||
| immBegin(GPU_PRIM_LINES, 4); | immBegin(GPU_PRIM_LINES, 4); | ||||
| immVertex2f(pos, cx - cross_size, cy - cross_size); | immVertex2f(pos, cx - cross_size, cy - cross_size); | ||||
| immVertex2f(pos, cx + cross_size, cy + cross_size); | immVertex2f(pos, cx + cross_size, cy + cross_size); | ||||
| immVertex2f(pos, cx + cross_size, cy - cross_size); | immVertex2f(pos, cx + cross_size, cy - cross_size); | ||||
| immVertex2f(pos, cx - cross_size, cy + cross_size); | immVertex2f(pos, cx - cross_size, cy + cross_size); | ||||
| Show All 29 Lines | static void node_composit_backdrop_boxmask( | ||||
| y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | ||||
| y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | ||||
| y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | ||||
| y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | ||||
| 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); | ||||
| immUniformColor3f(1.0f, 1.0f, 1.0f); | immUniformColor3f(1.0f, 1.0f, 1.0f); | ||||
| immBegin(GPU_PRIM_LINE_LOOP, 4); | immBegin(GPU_PRIM_LINE_LOOP, 4); | ||||
| immVertex2f(pos, x1, y1); | immVertex2f(pos, x1, y1); | ||||
| immVertex2f(pos, x2, y2); | immVertex2f(pos, x2, y2); | ||||
| immVertex2f(pos, x3, y3); | immVertex2f(pos, x3, y3); | ||||
| immVertex2f(pos, x4, y4); | immVertex2f(pos, x4, y4); | ||||
| Show All 28 Lines | static void node_composit_backdrop_ellipsemask( | ||||
| y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | ||||
| y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom; | ||||
| y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | ||||
| y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; | ||||
| 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); | ||||
| immUniformColor3f(1.0f, 1.0f, 1.0f); | immUniformColor3f(1.0f, 1.0f, 1.0f); | ||||
| immBegin(GPU_PRIM_LINE_LOOP, 4); | immBegin(GPU_PRIM_LINE_LOOP, 4); | ||||
| immVertex2f(pos, x1, y1); | immVertex2f(pos, x1, y1); | ||||
| immVertex2f(pos, x2, y2); | immVertex2f(pos, x2, y2); | ||||
| immVertex2f(pos, x3, y3); | immVertex2f(pos, x3, y3); | ||||
| immVertex2f(pos, x4, y4); | immVertex2f(pos, x4, y4); | ||||
| ▲ Show 20 Lines • Show All 835 Lines • ▼ Show 20 Lines | if (snode.edittree) { | ||||
| BLI_rcti_init(&pixel_border, | BLI_rcti_init(&pixel_border, | ||||
| x + snode.zoom * viewer_border->xmin * ibuf->x, | x + snode.zoom * viewer_border->xmin * ibuf->x, | ||||
| x + snode.zoom * viewer_border->xmax * ibuf->x, | x + snode.zoom * viewer_border->xmax * ibuf->x, | ||||
| y + snode.zoom * viewer_border->ymin * ibuf->y, | y + snode.zoom * viewer_border->ymin * ibuf->y, | ||||
| y + snode.zoom * viewer_border->ymax * ibuf->y); | y + snode.zoom * viewer_border->ymax * ibuf->y); | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformThemeColor(TH_ACTIVE); | immUniformThemeColor(TH_ACTIVE); | ||||
| immDrawBorderCorners(pos, &pixel_border, 1.0f, 1.0f); | immDrawBorderCorners(pos, &pixel_border, 1.0f, 1.0f); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 683 Lines • Show Last 20 Lines | |||||