Blender
V3.3
|
#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_interface.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 | do_vert_pair (GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i) |
static GPUBatch * | batch_screen_edges_get (int *corner_len) |
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 | screen_draw_join_highlight (ScrArea *sa1, ScrArea *sa2) |
void | screen_draw_split_preview (ScrArea *area, const eScreenAxis dir_axis, 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 27 of file screen_draw.c.
|
static |
Definition at line 74 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 29 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().
Screen edges drawing.
Definition at line 141 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 106 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_BORDERS, GPUBatch, NULL, x2, rctf::xmax, rctf::xmin, y1, rctf::ymax, and rctf::ymin.
Referenced by drawscredge_area().
Only for edge lines between areas.
Definition at line 151 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_BACKEND_OPENGL, 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_BORDERS, GPU_type_matches_ex(), 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().
Definition at line 425 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(), GPU_RGBA8, and screen_preview_draw().
Visual indication of the two areas involved in a proposed join.
sa1 | Area from which the resultant originates. |
sa2 | Target area that will be replaced. |
Definition at line 217 of file screen_draw.c.
References area_getoffsets(), area_getorientation(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformColor4fv(), immVertexFormat(), MAX2, MIN2, SCREEN_DIR_IS_VERTICAL, SCREEN_DIR_NONE, ScrArea::totrct, UI_CNR_ALL, UI_draw_roundbox_4fv(), UI_draw_roundbox_corner_set(), rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by area_join_draw_cb().
void screen_draw_split_preview | ( | ScrArea * | area, |
const eScreenAxis | dir_axis, | ||
const float | fac | ||
) |
Definition at line 302 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, SCREEN_AXIS_H, SCREEN_AXIS_V, x, and y.
Referenced by area_split_draw_cb().
Definition at line 405 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 375 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 362 of file screen_draw.c.
References blender::compositor::area(), bScreen::areabase, LISTBASE_FOREACH, and MAX2.
Referenced by screen_preview_draw().