Blender  V3.3
screen_draw.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "ED_screen.h"
8 
9 #include "GPU_batch_presets.h"
10 #include "GPU_framebuffer.h"
11 #include "GPU_immediate.h"
12 #include "GPU_matrix.h"
13 #include "GPU_platform.h"
14 #include "GPU_state.h"
15 
16 #include "BLI_listbase.h"
17 #include "BLI_math.h"
18 #include "BLI_rect.h"
19 
20 #include "WM_api.h"
21 
22 #include "UI_interface.h"
23 #include "UI_resources.h"
24 
25 #include "screen_intern.h"
26 
27 #define CORNER_RESOLUTION 3
28 
29 static void do_vert_pair(GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i)
30 {
31  float inter[2];
32  inter[0] = cosf(corner * M_PI_2 + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
33  inter[1] = sinf(corner * M_PI_2 + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
34 
35  /* Snap point to edge */
36  float div = 1.0f / max_ff(fabsf(inter[0]), fabsf(inter[1]));
37  float exter[2];
38  mul_v2_v2fl(exter, inter, div);
39  exter[0] = roundf(exter[0]);
40  exter[1] = roundf(exter[1]);
41 
42  if (i == 0 || i == (CORNER_RESOLUTION - 1)) {
43  copy_v2_v2(inter, exter);
44  }
45 
46  /* Line width is 20% of the entire corner size. */
47  const float line_width = 0.2f; /* Keep in sync with shader */
48  mul_v2_fl(inter, 1.0f - line_width);
49  mul_v2_fl(exter, 1.0f + line_width);
50 
51  switch (corner) {
52  case 0:
53  add_v2_v2(inter, (float[2]){-1.0f, -1.0f});
54  add_v2_v2(exter, (float[2]){-1.0f, -1.0f});
55  break;
56  case 1:
57  add_v2_v2(inter, (float[2]){1.0f, -1.0f});
58  add_v2_v2(exter, (float[2]){1.0f, -1.0f});
59  break;
60  case 2:
61  add_v2_v2(inter, (float[2]){1.0f, 1.0f});
62  add_v2_v2(exter, (float[2]){1.0f, 1.0f});
63  break;
64  case 3:
65  add_v2_v2(inter, (float[2]){-1.0f, 1.0f});
66  add_v2_v2(exter, (float[2]){-1.0f, 1.0f});
67  break;
68  }
69 
70  GPU_vertbuf_attr_set(vbo, pos, (*vidx)++, inter);
71  GPU_vertbuf_attr_set(vbo, pos, (*vidx)++, exter);
72 }
73 
74 static GPUBatch *batch_screen_edges_get(int *corner_len)
75 {
76  static GPUBatch *screen_edges_batch = NULL;
77 
78  if (screen_edges_batch == NULL) {
79  GPUVertFormat format = {0};
81 
83  GPU_vertbuf_data_alloc(vbo, CORNER_RESOLUTION * 2 * 4 + 2);
84 
85  uint vidx = 0;
86  for (int corner = 0; corner < 4; corner++) {
87  for (int c = 0; c < CORNER_RESOLUTION; c++) {
88  do_vert_pair(vbo, pos, &vidx, corner, c);
89  }
90  }
91  /* close the loop */
92  do_vert_pair(vbo, pos, &vidx, 0, 0);
93 
95  gpu_batch_presets_register(screen_edges_batch);
96  }
97 
98  if (corner_len) {
99  *corner_len = CORNER_RESOLUTION * 2;
100  }
101  return screen_edges_batch;
102 }
103 
104 #undef CORNER_RESOLUTION
105 
107  int sizex, int sizey, short x1, short y1, short x2, short y2, float edge_thickness)
108 {
109  rctf rect;
110  BLI_rctf_init(&rect, (float)x1, (float)x2, (float)y1, (float)y2);
111 
112  /* right border area */
113  if (x2 >= sizex - 1) {
114  rect.xmax += edge_thickness * 0.5f;
115  }
116 
117  /* left border area */
118  if (x1 <= 0) { /* otherwise it draws the emboss of window over */
119  rect.xmin -= edge_thickness * 0.5f;
120  }
121 
122  /* top border area */
123  if (y2 >= sizey - 1) {
124  rect.ymax += edge_thickness * 0.5f;
125  }
126 
127  /* bottom border area */
128  if (y1 <= 0) {
129  rect.ymin -= edge_thickness * 0.5f;
130  }
131 
134  GPU_batch_uniform_4fv(batch, "rect", (float *)&rect);
136 }
137 
141 static void drawscredge_area(ScrArea *area, int sizex, int sizey, float edge_thickness)
142 {
143  short x1 = area->v1->vec.x;
144  short y1 = area->v1->vec.y;
145  short x2 = area->v3->vec.x;
146  short y2 = area->v3->vec.y;
147 
148  drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2, edge_thickness);
149 }
150 
152 {
153  bScreen *screen = WM_window_get_active_screen(win);
154  screen->do_draw = false;
155 
156  if (screen->state == SCREENFULL) {
157  return;
158  }
159 
160  if (screen->temp && BLI_listbase_is_single(&screen->areabase)) {
161  return;
162  }
163 
164  const int winsize_x = WM_window_pixels_x(win);
165  const int winsize_y = WM_window_pixels_y(win);
166  float col[4], corner_scale, edge_thickness;
167  int verts_per_corner = 0;
168 
169  rcti scissor_rect;
170  BLI_rcti_init_minmax(&scissor_rect);
171  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
172  BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v1->vec.x, area->v1->vec.y});
173  BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v3->vec.x, area->v3->vec.y});
174  }
175 
177  /* For some reason, on linux + Intel UHD Graphics 620 the driver
178  * hangs if we don't flush before this. (See T57455) */
179  GPU_flush();
180  }
181 
182  GPU_scissor(scissor_rect.xmin,
183  scissor_rect.ymin,
184  BLI_rcti_size_x(&scissor_rect) + 1,
185  BLI_rcti_size_y(&scissor_rect) + 1);
186 
187  /* It seems that all areas gets smaller when pixelsize is > 1.
188  * So in order to avoid missing pixels we just disable de scissors. */
189  if (U.pixelsize <= 1.0f) {
190  GPU_scissor_test(true);
191  }
192 
194  col[3] = 1.0f;
195  corner_scale = U.pixelsize * 8.0f;
196  edge_thickness = corner_scale * 0.21f;
197 
199 
200  GPUBatch *batch = batch_screen_edges_get(&verts_per_corner);
202  GPU_batch_uniform_1i(batch, "cornerLen", verts_per_corner);
203  GPU_batch_uniform_1f(batch, "scale", corner_scale);
204  GPU_batch_uniform_4fv(batch, "color", col);
205 
206  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
207  drawscredge_area(area, winsize_x, winsize_y, edge_thickness);
208  }
209 
211 
212  if (U.pixelsize <= 1.0f) {
213  GPU_scissor_test(false);
214  }
215 }
216 
218 {
219  const eScreenDir dir = area_getorientation(sa1, sa2);
220  if (dir == SCREEN_DIR_NONE) {
221  return;
222  }
223 
224  /* Rect of the combined areas. */
225  const bool vertical = SCREEN_DIR_IS_VERTICAL(dir);
226  const rctf combined = {
227  .xmin = vertical ? MAX2(sa1->totrct.xmin, sa2->totrct.xmin) :
228  MIN2(sa1->totrct.xmin, sa2->totrct.xmin),
229  .xmax = vertical ? MIN2(sa1->totrct.xmax, sa2->totrct.xmax) :
230  MAX2(sa1->totrct.xmax, sa2->totrct.xmax),
231  .ymin = vertical ? MIN2(sa1->totrct.ymin, sa2->totrct.ymin) :
232  MAX2(sa1->totrct.ymin, sa2->totrct.ymin),
233  .ymax = vertical ? MAX2(sa1->totrct.ymax, sa2->totrct.ymax) :
234  MIN2(sa1->totrct.ymax, sa2->totrct.ymax),
235  };
236 
237  uint pos_id = GPU_vertformat_attr_add(
241 
242  /* Highlight source (sa1) within combined area. */
243  immUniformColor4fv((const float[4]){1.0f, 1.0f, 1.0f, 0.10f});
244  immRectf(pos_id,
245  MAX2(sa1->totrct.xmin, combined.xmin),
246  MAX2(sa1->totrct.ymin, combined.ymin),
247  MIN2(sa1->totrct.xmax, combined.xmax),
248  MIN2(sa1->totrct.ymax, combined.ymax));
249 
250  /* Highlight destination (sa2) within combined area. */
251  immUniformColor4fv((const float[4]){0.0f, 0.0f, 0.0f, 0.25f});
252  immRectf(pos_id,
253  MAX2(sa2->totrct.xmin, combined.xmin),
254  MAX2(sa2->totrct.ymin, combined.ymin),
255  MIN2(sa2->totrct.xmax, combined.xmax),
256  MIN2(sa2->totrct.ymax, combined.ymax));
257 
258  int offset1;
259  int offset2;
260  area_getoffsets(sa1, sa2, dir, &offset1, &offset2);
261  if (offset1 < 0 || offset2 > 0) {
262  /* Show partial areas that will be closed. */
263  immUniformColor4fv((const float[4]){0.0f, 0.0f, 0.0f, 0.8f});
264  if (vertical) {
265  if (sa1->totrct.xmin < combined.xmin) {
266  immRectf(pos_id, sa1->totrct.xmin, sa1->totrct.ymin, combined.xmin, sa1->totrct.ymax);
267  }
268  if (sa2->totrct.xmin < combined.xmin) {
269  immRectf(pos_id, sa2->totrct.xmin, sa2->totrct.ymin, combined.xmin, sa2->totrct.ymax);
270  }
271  if (sa1->totrct.xmax > combined.xmax) {
272  immRectf(pos_id, combined.xmax, sa1->totrct.ymin, sa1->totrct.xmax, sa1->totrct.ymax);
273  }
274  if (sa2->totrct.xmax > combined.xmax) {
275  immRectf(pos_id, combined.xmax, sa2->totrct.ymin, sa2->totrct.xmax, sa2->totrct.ymax);
276  }
277  }
278  else {
279  if (sa1->totrct.ymin < combined.ymin) {
280  immRectf(pos_id, sa1->totrct.xmin, combined.ymin, sa1->totrct.xmax, sa1->totrct.ymin);
281  }
282  if (sa2->totrct.ymin < combined.ymin) {
283  immRectf(pos_id, sa2->totrct.xmin, combined.ymin, sa2->totrct.xmax, sa2->totrct.ymin);
284  }
285  if (sa1->totrct.ymax > combined.ymax) {
286  immRectf(pos_id, sa1->totrct.xmin, sa1->totrct.ymax, sa1->totrct.xmax, combined.ymax);
287  }
288  if (sa2->totrct.ymax > combined.ymax) {
289  immRectf(pos_id, sa2->totrct.xmin, sa2->totrct.ymax, sa2->totrct.xmax, combined.ymax);
290  }
291  }
292  }
293 
296 
297  /* Outline the combined area. */
299  UI_draw_roundbox_4fv(&combined, false, 7 * U.pixelsize, (float[4]){1.0f, 1.0f, 1.0f, 0.8f});
300 }
301 
302 void screen_draw_split_preview(ScrArea *area, const eScreenAxis dir_axis, const float fac)
303 {
306 
307  /* Split-point. */
309 
310  immUniformColor4ub(255, 255, 255, 100);
311 
313 
314  if (dir_axis == SCREEN_AXIS_H) {
315  const float y = (1 - fac) * area->totrct.ymin + fac * area->totrct.ymax;
316 
317  immVertex2f(pos, area->totrct.xmin, y);
318  immVertex2f(pos, area->totrct.xmax, y);
319 
320  immEnd();
321 
322  immUniformColor4ub(0, 0, 0, 100);
323 
325 
326  immVertex2f(pos, area->totrct.xmin, y + 1);
327  immVertex2f(pos, area->totrct.xmax, y + 1);
328 
329  immEnd();
330  }
331  else {
332  BLI_assert(dir_axis == SCREEN_AXIS_V);
333  const float x = (1 - fac) * area->totrct.xmin + fac * area->totrct.xmax;
334 
335  immVertex2f(pos, x, area->totrct.ymin);
336  immVertex2f(pos, x, area->totrct.ymax);
337 
338  immEnd();
339 
340  immUniformColor4ub(0, 0, 0, 100);
341 
343 
344  immVertex2f(pos, x + 1, area->totrct.ymin);
345  immVertex2f(pos, x + 1, area->totrct.ymax);
346 
347  immEnd();
348  }
349 
351 
353 }
354 
355 /* -------------------------------------------------------------------- */
356 /* Screen Thumbnail Preview */
357 
363  const bScreen *screen, float size_x, float size_y, const float asp[2], float r_scale[2])
364 {
365  float max_x = 0, max_y = 0;
366 
367  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
368  max_x = MAX2(max_x, area->totrct.xmax);
369  max_y = MAX2(max_y, area->totrct.ymax);
370  }
371  r_scale[0] = (size_x * asp[0]) / max_x;
372  r_scale[1] = (size_y * asp[1]) / max_y;
373 }
374 
375 static void screen_preview_draw_areas(const bScreen *screen,
376  const float scale[2],
377  const float col[4],
378  const float ofs_between_areas)
379 {
380  const float ofs_h = ofs_between_areas * 0.5f;
382 
385 
386  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
387  rctf rect = {
388  .xmin = area->totrct.xmin * scale[0] + ofs_h,
389  .xmax = area->totrct.xmax * scale[0] - ofs_h,
390  .ymin = area->totrct.ymin * scale[1] + ofs_h,
391  .ymax = area->totrct.ymax * scale[1] - ofs_h,
392  };
393 
395  immVertex2f(pos, rect.xmin, rect.ymin);
396  immVertex2f(pos, rect.xmax, rect.ymin);
397  immVertex2f(pos, rect.xmax, rect.ymax);
398  immVertex2f(pos, rect.xmin, rect.ymax);
399  immEnd();
400  }
401 
403 }
404 
405 static void screen_preview_draw(const bScreen *screen, int size_x, int size_y)
406 {
407  const float asp[2] = {1.0f, 0.8f}; /* square previews look a bit ugly */
408  /* could use theme color (tui.wcol_menu_item.text),
409  * but then we'd need to regenerate all previews when changing. */
410  const float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
411  float scale[2];
412 
413  wmOrtho2(0.0f, size_x, 0.0f, size_y);
414  /* center */
415  GPU_matrix_push();
417  GPU_matrix_translate_2f(size_x * (1.0f - asp[0]) * 0.5f, size_y * (1.0f - asp[1]) * 0.5f);
418 
419  screen_preview_scale_get(screen, size_x, size_y, asp, scale);
420  screen_preview_draw_areas(screen, scale, col, 1.5f);
421 
422  GPU_matrix_pop();
423 }
424 
425 void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uint *r_rect)
426 {
427  char err_out[256] = "unknown";
428  GPUOffScreen *offscreen = GPU_offscreen_create(size_x, size_y, true, GPU_RGBA8, err_out);
429 
430  GPU_offscreen_bind(offscreen, true);
431  GPU_clear_color(0.0f, 0.0f, 0.0f, 0.0f);
432  GPU_clear_depth(1.0f);
433 
434  screen_preview_draw(screen, size_x, size_y);
435 
436  GPU_offscreen_read_pixels(offscreen, GPU_DATA_UBYTE, r_rect);
437  GPU_offscreen_unbind(offscreen, true);
438 
439  GPU_offscreen_free(offscreen);
440 }
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
Definition: BLI_listbase.h:265
MINLINE float max_ff(float a, float b)
#define M_PI_2
Definition: BLI_math_base.h:23
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)
Definition: BLI_rect.h:190
void BLI_rcti_init_minmax(struct rcti *rect)
Definition: rct.c:477
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition: rct.c:407
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2])
Definition: rct.c:489
unsigned int uint
Definition: BLI_sys_types.h:67
#define MAX2(a, b)
#define MIN2(a, b)
@ SCREENFULL
GPUBatch
Definition: GPU_batch.h:78
#define GPU_batch_uniform_1f(batch, name, x)
Definition: GPU_batch.h:144
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
Definition: gpu_batch.cc:287
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
Definition: gpu_batch.cc:43
void GPU_batch_draw(GPUBatch *batch)
Definition: gpu_batch.cc:223
#define GPU_batch_uniform_4fv(batch, name, val)
Definition: GPU_batch.h:152
@ GPU_BATCH_OWNS_VBO
Definition: GPU_batch.h:30
#define GPU_batch_uniform_1i(batch, name, x)
Definition: GPU_batch.h:142
void gpu_batch_presets_register(struct GPUBatch *preset_batch)
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immUniformColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
void immUniformColor4fv(const float rgba[4])
GPUVertFormat * immVertexFormat(void)
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
_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 y
_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
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:126
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:119
void GPU_matrix_identity_set(void)
Definition: gpu_matrix.cc:168
void GPU_matrix_translate_2f(float x, float y)
Definition: gpu_matrix.cc:174
@ GPU_BACKEND_OPENGL
Definition: GPU_platform.h:17
@ GPU_DRIVER_ANY
Definition: GPU_platform.h:47
bool GPU_type_matches_ex(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver, eGPUBackendType backend)
@ GPU_OS_UNIX
Definition: GPU_platform.h:39
@ GPU_DEVICE_INTEL_UHD
Definition: GPU_platform.h:27
@ GPU_PRIM_TRI_FAN
Definition: GPU_primitive.h:25
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
@ GPU_PRIM_TRI_STRIP
Definition: GPU_primitive.h:24
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_SHADER_2D_AREA_BORDERS
Definition: GPU_shader.h:354
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:62
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_scissor_test(bool enable)
Definition: gpu_state.cc:180
void GPU_flush(void)
Definition: gpu_state.cc:291
void GPU_scissor(int x, int y, int width, int height)
Definition: gpu_state.cc:185
@ GPU_DATA_UBYTE
Definition: GPU_texture.h:174
@ GPU_RGBA8
Definition: GPU_texture.h:87
#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)
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
void UI_draw_roundbox_4fv(const struct rctf *rect, bool filled, float rad, const float col[4])
void UI_draw_roundbox_corner_set(int type)
@ UI_CNR_ALL
@ TH_EDITOR_OUTLINE
Definition: UI_resources.h:294
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1173
unsigned int U
Definition: btGjkEpa3.h:78
#define sinf(x)
Definition: cuda/compat.h:102
#define cosf(x)
Definition: cuda/compat.h:101
uint pos
uint col
struct @653::@655 batch
void GPU_offscreen_free(GPUOffScreen *ofs)
void GPU_offscreen_unbind(GPUOffScreen *UNUSED(ofs), bool restore)
GPUOffScreen * GPU_offscreen_create(int width, int height, bool depth, eGPUTextureFormat format, char err_out[256])
void GPU_offscreen_read_pixels(GPUOffScreen *ofs, eGPUDataFormat format, void *pixels)
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_clear_depth(float depth)
void GPU_offscreen_bind(GPUOffScreen *ofs, bool save)
format
Definition: logImageCore.h:38
#define fabsf(x)
Definition: metal/compat.h:219
static unsigned c
Definition: RandGen.cpp:83
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void screen_preview_scale_get(const bScreen *screen, float size_x, float size_y, const float asp[2], float r_scale[2])
Definition: screen_draw.c:362
static void screen_preview_draw(const bScreen *screen, int size_x, int size_y)
Definition: screen_draw.c:405
static void drawscredge_area(ScrArea *area, int sizex, int sizey, float edge_thickness)
Screen edges drawing.
Definition: screen_draw.c:141
void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uint *r_rect)
Definition: screen_draw.c:425
static void do_vert_pair(GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i)
Definition: screen_draw.c:29
void screen_draw_split_preview(ScrArea *area, const eScreenAxis dir_axis, const float fac)
Definition: screen_draw.c:302
static void drawscredge_area_draw(int sizex, int sizey, short x1, short y1, short x2, short y2, float edge_thickness)
Definition: screen_draw.c:106
void ED_screen_draw_edges(wmWindow *win)
Definition: screen_draw.c:151
#define CORNER_RESOLUTION
Definition: screen_draw.c:27
static void screen_preview_draw_areas(const bScreen *screen, const float scale[2], const float col[4], const float ofs_between_areas)
Definition: screen_draw.c:375
void screen_draw_join_highlight(ScrArea *sa1, ScrArea *sa2)
Definition: screen_draw.c:217
static GPUBatch * batch_screen_edges_get(int *corner_len)
Definition: screen_draw.c:74
void area_getoffsets(ScrArea *sa_a, ScrArea *sa_b, const eScreenDir dir, int *r_offset1, int *r_offset2)
Definition: screen_edit.c:305
eScreenDir area_getorientation(ScrArea *sa_a, ScrArea *sa_b)
Definition: screen_edit.c:265
eScreenAxis
Definition: screen_intern.h:32
@ SCREEN_AXIS_V
Definition: screen_intern.h:36
@ SCREEN_AXIS_H
Definition: screen_intern.h:34
#define SCREEN_DIR_IS_VERTICAL(dir)
Definition: screen_intern.h:29
eScreenDir
Definition: screen_intern.h:16
@ SCREEN_DIR_NONE
Definition: screen_intern.h:18
ListBase areabase
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
void wmOrtho2(float x1, float x2, float y1, float y2)
Definition: wm_subwindow.c:84
int WM_window_pixels_y(const wmWindow *win)
Definition: wm_window.c:2082
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2300
int WM_window_pixels_x(const wmWindow *win)
Definition: wm_window.c:2076