60 points[0].
x =
area->v1->vec.x;
63 points[1].
x =
area->v1->vec.x;
64 points[1].
y =
area->v1->vec.y;
66 points[2].
x =
area->v4->vec.x -
w;
67 points[2].
y =
area->v4->vec.y;
69 points[3].
x =
area->v4->vec.x -
w;
72 points[4].
x =
area->v4->vec.x - 2 *
w;
75 points[5].
x =
area->v4->vec.x -
w;
78 points[6].
x =
area->v3->vec.x -
w;
79 points[6].
y =
area->v3->vec.y;
81 points[7].
x =
area->v2->vec.x;
82 points[7].
y =
area->v2->vec.y;
84 points[8].
x =
area->v4->vec.x;
87 points[9].
x =
area->v4->vec.x;
93 for (
int i = 0; i < 10; i++) {
95 points[i].
x = -points[i].
x;
96 points[i].
x +=
area->v1->vec.x;
102 for (
int i = 0; i < 5; i++) {
110 for (
int i = 4; i < 8; i++) {
141 points[0].
y =
area->v3->vec.y;
143 points[1].
x =
area->v2->vec.x;
144 points[1].
y =
area->v2->vec.y;
146 points[2].
x =
area->v1->vec.x;
147 points[2].
y =
area->v1->vec.y + h;
150 points[3].
y =
area->v1->vec.y + h;
153 points[4].
y =
area->v1->vec.y + 2 * h;
156 points[5].
y =
area->v1->vec.y + h;
158 points[6].
x =
area->v4->vec.x;
159 points[6].
y =
area->v4->vec.y + h;
161 points[7].
x =
area->v3->vec.x;
162 points[7].
y =
area->v3->vec.y;
165 points[8].
y =
area->v1->vec.y;
168 points[9].
y =
area->v1->vec.y;
173 for (
int i = 0; i < 10; i++) {
175 points[i].
y = -points[i].
y;
176 points[i].
y +=
area->v1->vec.y;
182 for (
int i = 0; i < 5; i++) {
190 for (
int i = 4; i < 8; i++) {
206 if (
ELEM(dir,
'u',
'd')) {
214 #define CORNER_RESOLUTION 3
226 exter[0] = roundf(exter[0]);
227 exter[1] = roundf(exter[1]);
234 const float line_width = 0.2f;
240 add_v2_v2(inter, (
float[2]){-1.0f, -1.0f});
241 add_v2_v2(exter, (
float[2]){-1.0f, -1.0f});
244 add_v2_v2(inter, (
float[2]){1.0f, -1.0f});
245 add_v2_v2(exter, (
float[2]){1.0f, -1.0f});
248 add_v2_v2(inter, (
float[2]){1.0f, 1.0f});
249 add_v2_v2(exter, (
float[2]){1.0f, 1.0f});
252 add_v2_v2(inter, (
float[2]){-1.0f, 1.0f});
253 add_v2_v2(exter, (
float[2]){-1.0f, 1.0f});
265 if (screen_edges_batch ==
NULL) {
288 return screen_edges_batch;
291 #undef CORNER_RESOLUTION
316 int sizex,
int sizey,
short x1,
short y1,
short x2,
short y2,
float edge_thickness)
322 if (
x2 >= sizex - 1) {
323 rect.
xmax += edge_thickness * 0.5f;
328 rect.
xmin -= edge_thickness * 0.5f;
332 if (y2 >= sizey - 1) {
333 rect.
ymax += edge_thickness * 0.5f;
338 rect.
ymin -= edge_thickness * 0.5f;
352 short x1 =
area->v1->vec.x;
353 short y1 =
area->v1->vec.y;
354 short x2 =
area->v3->vec.x;
355 short y2 =
area->v3->vec.y;
378 float col[4], corner_scale, edge_thickness;
379 int verts_per_corner = 0;
401 if (
U.pixelsize <= 1.0f) {
407 corner_scale =
U.pixelsize * 8.0f;
408 edge_thickness = corner_scale * 0.21f;
424 if (
U.pixelsize <= 1.0f) {
489 const float y = (1 - fac) *
area->totrct.ymin + fac *
area->totrct.ymax;
507 const float x = (1 - fac) *
area->totrct.xmin + fac *
area->totrct.xmax;
537 const bScreen *screen,
float size_x,
float size_y,
const float asp[2],
float r_scale[2])
539 float max_x = 0, max_y = 0;
542 max_x =
MAX2(max_x,
area->totrct.xmax);
543 max_y =
MAX2(max_y,
area->totrct.ymax);
545 r_scale[0] = (size_x * asp[0]) / max_x;
546 r_scale[1] = (size_y * asp[1]) / max_y;
550 const float scale[2],
552 const float ofs_between_areas)
554 const float ofs_h = ofs_between_areas * 0.5f;
562 .
xmin =
area->totrct.xmin * scale[0] + ofs_h,
563 .xmax =
area->totrct.xmax * scale[0] - ofs_h,
564 .ymin =
area->totrct.ymin * scale[1] + ofs_h,
565 .ymax =
area->totrct.ymax * scale[1] - ofs_h,
581 const float asp[2] = {1.0f, 0.8f};
584 const float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
587 wmOrtho2(0.0f, size_x, 0.0f, size_y);
604 char err_out[256] =
"unknown";
#define LISTBASE_FOREACH(type, var, list)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
MINLINE float max_ff(float a, float b)
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_init_minmax(struct rcti *rect)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2])
#define GPU_batch_uniform_1f(batch, name, x)
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
void GPU_batch_draw(GPUBatch *batch)
#define GPU_batch_uniform_4fv(batch, name, val)
#define GPU_batch_uniform_1i(batch, name, x)
void gpu_batch_presets_register(struct GPUBatch *preset_batch)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
void GPU_matrix_pop(void)
void GPU_matrix_push(void)
void GPU_matrix_identity_set(void)
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_2D_AREA_EDGES
@ GPU_SHADER_2D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_scissor_test(bool enable)
void GPU_line_width(float width)
void GPU_scissor(int x, int y, int width, int height)
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
void GPU_vertbuf_attr_set(GPUVertBuf *, uint a_idx, uint v_idx, const void *data)
void UI_GetThemeColor4fv(int colorid, float col[4])
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void GPU_offscreen_free(GPUOffScreen *ofs)
void GPU_offscreen_unbind(GPUOffScreen *UNUSED(ofs), bool restore)
void GPU_offscreen_read_pixels(GPUOffScreen *ofs, eGPUDataFormat format, void *pixels)
void GPU_clear_color(float red, float green, float blue, float alpha)
GPUOffScreen * GPU_offscreen_create(int width, int height, bool depth, bool high_bitdepth, char err_out[256])
void GPU_clear_depth(float depth)
void GPU_offscreen_bind(GPUOffScreen *ofs, bool save)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void scrarea_draw_shape_dark(ScrArea *area, char dir, uint pos)
static void screen_preview_scale_get(const bScreen *screen, float size_x, float size_y, const float asp[2], float r_scale[2])
void ED_screen_draw_split_preview(ScrArea *area, const int dir, const float fac)
static void screen_preview_draw(const bScreen *screen, int size_x, int size_y)
static void drawscredge_area(ScrArea *area, int sizex, int sizey, float edge_thickness)
Screen edges drawing.
void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uint *r_rect)
static void draw_vertical_join_shape(ScrArea *area, char dir, uint pos)
static void do_vert_pair(GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i)
void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2)
static void drawscredge_area_draw(int sizex, int sizey, short x1, short y1, short x2, short y2, float edge_thickness)
void ED_screen_draw_edges(wmWindow *win)
#define CORNER_RESOLUTION
static void scrarea_draw_shape_light(ScrArea *area, char UNUSED(dir), uint pos)
static void screen_preview_draw_areas(const bScreen *screen, const float scale[2], const float col[4], const float ofs_between_areas)
static void draw_join_shape(ScrArea *area, char dir, uint pos)
static void draw_horizontal_join_shape(ScrArea *area, char dir, uint pos)
static GPUBatch * batch_screen_edges_get(int *corner_len)
int area_getorientation(ScrArea *area, ScrArea *sb)
int screen_geom_area_width(const ScrArea *area)
int screen_geom_area_height(const ScrArea *area)
void wmOrtho2(float x1, float x2, float y1, float y2)
int WM_window_pixels_y(const wmWindow *win)
bScreen * WM_window_get_active_screen(const wmWindow *win)
int WM_window_pixels_x(const wmWindow *win)