|
Blender
V2.93
|
#include "ED_screen.h"#include "GPU_batch_presets.h"#include "GPU_framebuffer.h"#include "GPU_immediate.h"#include "GPU_matrix.h"#include "GPU_platform.h"#include "GPU_state.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_rect.h"#include "WM_api.h"#include "UI_resources.h"#include "screen_intern.h"Go to the source code of this file.
Macros | |
| #define | CORNER_RESOLUTION 3 |
Functions | |
| static void | draw_horizontal_join_shape (ScrArea *area, char dir, uint pos) |
| static void | draw_vertical_join_shape (ScrArea *area, char dir, uint pos) |
| static void | draw_join_shape (ScrArea *area, char dir, uint pos) |
| static void | do_vert_pair (GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i) |
| static GPUBatch * | batch_screen_edges_get (int *corner_len) |
| static void | scrarea_draw_shape_dark (ScrArea *area, char dir, uint pos) |
| static void | scrarea_draw_shape_light (ScrArea *area, char UNUSED(dir), uint pos) |
| static void | drawscredge_area_draw (int sizex, int sizey, short x1, short y1, short x2, short y2, float edge_thickness) |
| static void | drawscredge_area (ScrArea *area, int sizex, int sizey, float edge_thickness) |
| Screen edges drawing. More... | |
| void | ED_screen_draw_edges (wmWindow *win) |
| void | ED_screen_draw_join_shape (ScrArea *sa1, ScrArea *sa2) |
| void | ED_screen_draw_split_preview (ScrArea *area, const int dir, const float fac) |
| static void | screen_preview_scale_get (const bScreen *screen, float size_x, float size_y, const float asp[2], float r_scale[2]) |
| static void | screen_preview_draw_areas (const bScreen *screen, const float scale[2], const float col[4], const float ofs_between_areas) |
| static void | screen_preview_draw (const bScreen *screen, int size_x, int size_y) |
| void | ED_screen_preview_render (const bScreen *screen, int size_x, int size_y, uint *r_rect) |
| #define CORNER_RESOLUTION 3 |
Definition at line 214 of file screen_draw.c.
|
static |
Definition at line 261 of file screen_draw.c.
References Freestyle::c, CORNER_RESOLUTION, do_vert_pair(), GPU_batch_create_ex(), GPU_BATCH_OWNS_VBO, gpu_batch_presets_register(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_TRI_STRIP, GPU_vertbuf_create_with_format, GPU_vertbuf_data_alloc(), GPU_vertformat_attr_add(), GPUBatch, NULL, and pos.
Referenced by drawscredge_area_draw(), and ED_screen_draw_edges().
|
static |
Definition at line 216 of file screen_draw.c.
References add_v2_v2(), copy_v2_v2(), CORNER_RESOLUTION, cosf, fabsf, GPU_vertbuf_attr_set(), M_PI_2, max_ff(), mul_v2_fl(), mul_v2_v2fl(), pos, and sinf.
Referenced by batch_screen_edges_get().
Draw horizontal shape visualizing future joining (left as well right direction of future joining).
Definition at line 44 of file screen_draw.c.
References blender::compositor::area(), GPU_PRIM_TRI_FAN, height, immBegin(), immEnd(), immRectf(), immVertex2f(), pos, screen_geom_area_height(), screen_geom_area_width(), w(), width, x, vec2f::x, y, and vec2f::y.
Referenced by draw_join_shape().
Draw join shape due to direction of joining.
Definition at line 204 of file screen_draw.c.
References blender::compositor::area(), draw_horizontal_join_shape(), draw_vertical_join_shape(), ELEM, and pos.
Referenced by scrarea_draw_shape_dark().
Draw vertical shape visualizing future joining (up/down direction).
Definition at line 124 of file screen_draw.c.
References blender::compositor::area(), GPU_PRIM_TRI_FAN, height, immBegin(), immEnd(), immRectf(), immVertex2f(), pos, screen_geom_area_height(), screen_geom_area_width(), w(), width, x, vec2f::x, y, and vec2f::y.
Referenced by draw_join_shape().
Screen edges drawing.
Definition at line 350 of file screen_draw.c.
References blender::compositor::area(), drawscredge_area_draw(), x2, and y1.
Referenced by ED_screen_draw_edges().
|
static |
Definition at line 315 of file screen_draw.c.
References batch, batch_screen_edges_get(), BLI_rctf_init(), GPU_batch_draw(), GPU_batch_program_set_builtin(), GPU_batch_uniform_4fv, GPU_SHADER_2D_AREA_EDGES, GPUBatch, NULL, x2, rctf::xmax, rctf::xmin, y1, rctf::ymax, and rctf::ymin.
Referenced by drawscredge_area().
| void ED_screen_draw_edges | ( | wmWindow * | win | ) |
Only for edge lines between areas.
Definition at line 363 of file screen_draw.c.
References blender::compositor::area(), bScreen::areabase, batch, batch_screen_edges_get(), BLI_listbase_is_single(), BLI_rcti_do_minmax_v(), BLI_rcti_init_minmax(), BLI_rcti_size_x(), BLI_rcti_size_y(), col, bScreen::do_draw, drawscredge_area(), GPU_batch_program_set_builtin(), GPU_batch_uniform_1f, GPU_batch_uniform_1i, GPU_batch_uniform_4fv, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_DEVICE_INTEL_UHD, GPU_DRIVER_ANY, GPU_flush(), GPU_OS_UNIX, GPU_scissor(), GPU_scissor_test(), GPU_SHADER_2D_AREA_EDGES, GPU_type_matches(), GPUBatch, LISTBASE_FOREACH, SCREENFULL, bScreen::state, bScreen::temp, TH_EDITOR_OUTLINE, UI_GetThemeColor4fv(), WM_window_get_active_screen(), WM_window_pixels_x(), WM_window_pixels_y(), rcti::xmin, and rcti::ymin.
Referenced by wm_draw_window_onscreen().
The blended join arrows.
| sa1 | Area from which the resultant originates. |
| sa2 | Target area that will be replaced. |
Definition at line 435 of file screen_draw.c.
References area_getorientation(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immUnbindProgram(), immVertexFormat(), pos, scrarea_draw_shape_dark(), and scrarea_draw_shape_light().
Referenced by area_join_draw_cb().
Definition at line 476 of file screen_draw.c.
References blender::compositor::area(), BLI_assert, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformColor4ub(), immVertex2f(), immVertexFormat(), pos, x, and y.
Referenced by area_split_draw_cb().
Render the preview for a screen layout in screen.
Definition at line 602 of file screen_draw.c.
References GPU_clear_color(), GPU_clear_depth(), GPU_DATA_UBYTE, GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_read_pixels(), GPU_offscreen_unbind(), and screen_preview_draw().
Draw screen area darker with arrow (visualization of future joining).
Definition at line 296 of file screen_draw.c.
References blender::compositor::area(), draw_join_shape(), GPU_blend(), GPU_BLEND_ALPHA, immUniformColor4ub(), and pos.
Referenced by ED_screen_draw_join_shape().
Draw screen area lighter with arrow shape ("eraser" of previous dark shape).
Definition at line 307 of file screen_draw.c.
References blender::compositor::area(), GPU_blend(), GPU_BLEND_ALPHA, immRectf(), immUniformColor4ub(), and pos.
Referenced by ED_screen_draw_join_shape().
|
static |
Definition at line 579 of file screen_draw.c.
References col, GPU_matrix_identity_set(), GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_translate_2f(), screen_preview_draw_areas(), screen_preview_scale_get(), and wmOrtho2().
Referenced by ED_screen_preview_render().
|
static |
Definition at line 549 of file screen_draw.c.
References blender::compositor::area(), bScreen::areabase, col, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_TRI_FAN, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformColor4fv(), immVertex2f(), immVertexFormat(), LISTBASE_FOREACH, pos, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by screen_preview_draw().
|
static |
Calculates a scale factor to squash the preview for screen into a rectangle of given size and aspect.
Definition at line 536 of file screen_draw.c.
References blender::compositor::area(), bScreen::areabase, LISTBASE_FOREACH, and MAX2.
Referenced by screen_preview_draw().