Blender  V2.93
screen_draw.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "ED_screen.h"
22 
23 #include "GPU_batch_presets.h"
24 #include "GPU_framebuffer.h"
25 #include "GPU_immediate.h"
26 #include "GPU_matrix.h"
27 #include "GPU_platform.h"
28 #include "GPU_state.h"
29 
30 #include "BLI_listbase.h"
31 #include "BLI_math.h"
32 #include "BLI_rect.h"
33 
34 #include "WM_api.h"
35 
36 #include "UI_resources.h"
37 
38 #include "screen_intern.h"
39 
45 {
46  const float width = screen_geom_area_width(area) - 1;
47  const float height = screen_geom_area_height(area) - 1;
48 
49  float w, h;
50  if (height < width) {
51  h = height / 8;
52  w = height / 4;
53  }
54  else {
55  h = width / 8;
56  w = width / 4;
57  }
58 
59  vec2f points[10];
60  points[0].x = area->v1->vec.x;
61  points[0].y = area->v1->vec.y + height / 2;
62 
63  points[1].x = area->v1->vec.x;
64  points[1].y = area->v1->vec.y;
65 
66  points[2].x = area->v4->vec.x - w;
67  points[2].y = area->v4->vec.y;
68 
69  points[3].x = area->v4->vec.x - w;
70  points[3].y = area->v4->vec.y + height / 2 - 2 * h;
71 
72  points[4].x = area->v4->vec.x - 2 * w;
73  points[4].y = area->v4->vec.y + height / 2;
74 
75  points[5].x = area->v4->vec.x - w;
76  points[5].y = area->v4->vec.y + height / 2 + 2 * h;
77 
78  points[6].x = area->v3->vec.x - w;
79  points[6].y = area->v3->vec.y;
80 
81  points[7].x = area->v2->vec.x;
82  points[7].y = area->v2->vec.y;
83 
84  points[8].x = area->v4->vec.x;
85  points[8].y = area->v4->vec.y + height / 2 - h;
86 
87  points[9].x = area->v4->vec.x;
88  points[9].y = area->v4->vec.y + height / 2 + h;
89 
90  if (dir == 'l') {
91  /* when direction is left, then we flip direction of arrow */
92  float cx = area->v1->vec.x + width;
93  for (int i = 0; i < 10; i++) {
94  points[i].x -= cx;
95  points[i].x = -points[i].x;
96  points[i].x += area->v1->vec.x;
97  }
98  }
99 
101 
102  for (int i = 0; i < 5; i++) {
103  immVertex2f(pos, points[i].x, points[i].y);
104  }
105 
106  immEnd();
107 
109 
110  for (int i = 4; i < 8; i++) {
111  immVertex2f(pos, points[i].x, points[i].y);
112  }
113 
114  immVertex2f(pos, points[0].x, points[0].y);
115  immEnd();
116 
117  immRectf(pos, points[2].x, points[2].y, points[8].x, points[8].y);
118  immRectf(pos, points[6].x, points[6].y, points[9].x, points[9].y);
119 }
120 
124 static void draw_vertical_join_shape(ScrArea *area, char dir, uint pos)
125 {
126  const float width = screen_geom_area_width(area) - 1;
127  const float height = screen_geom_area_height(area) - 1;
128 
129  float w, h;
130  if (height < width) {
131  h = height / 4;
132  w = height / 8;
133  }
134  else {
135  h = width / 4;
136  w = width / 8;
137  }
138 
139  vec2f points[10];
140  points[0].x = area->v1->vec.x + width / 2;
141  points[0].y = area->v3->vec.y;
142 
143  points[1].x = area->v2->vec.x;
144  points[1].y = area->v2->vec.y;
145 
146  points[2].x = area->v1->vec.x;
147  points[2].y = area->v1->vec.y + h;
148 
149  points[3].x = area->v1->vec.x + width / 2 - 2 * w;
150  points[3].y = area->v1->vec.y + h;
151 
152  points[4].x = area->v1->vec.x + width / 2;
153  points[4].y = area->v1->vec.y + 2 * h;
154 
155  points[5].x = area->v1->vec.x + width / 2 + 2 * w;
156  points[5].y = area->v1->vec.y + h;
157 
158  points[6].x = area->v4->vec.x;
159  points[6].y = area->v4->vec.y + h;
160 
161  points[7].x = area->v3->vec.x;
162  points[7].y = area->v3->vec.y;
163 
164  points[8].x = area->v1->vec.x + width / 2 - w;
165  points[8].y = area->v1->vec.y;
166 
167  points[9].x = area->v1->vec.x + width / 2 + w;
168  points[9].y = area->v1->vec.y;
169 
170  if (dir == 'u') {
171  /* when direction is up, then we flip direction of arrow */
172  float cy = area->v1->vec.y + height;
173  for (int i = 0; i < 10; i++) {
174  points[i].y -= cy;
175  points[i].y = -points[i].y;
176  points[i].y += area->v1->vec.y;
177  }
178  }
179 
181 
182  for (int i = 0; i < 5; i++) {
183  immVertex2f(pos, points[i].x, points[i].y);
184  }
185 
186  immEnd();
187 
189 
190  for (int i = 4; i < 8; i++) {
191  immVertex2f(pos, points[i].x, points[i].y);
192  }
193 
194  immVertex2f(pos, points[0].x, points[0].y);
195  immEnd();
196 
197  immRectf(pos, points[2].x, points[2].y, points[8].x, points[8].y);
198  immRectf(pos, points[6].x, points[6].y, points[9].x, points[9].y);
199 }
200 
204 static void draw_join_shape(ScrArea *area, char dir, uint pos)
205 {
206  if (ELEM(dir, 'u', 'd')) {
208  }
209  else {
211  }
212 }
213 
214 #define CORNER_RESOLUTION 3
215 
216 static void do_vert_pair(GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i)
217 {
218  float inter[2];
219  inter[0] = cosf(corner * M_PI_2 + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
220  inter[1] = sinf(corner * M_PI_2 + (i * M_PI_2 / (CORNER_RESOLUTION - 1.0f)));
221 
222  /* Snap point to edge */
223  float div = 1.0f / max_ff(fabsf(inter[0]), fabsf(inter[1]));
224  float exter[2];
225  mul_v2_v2fl(exter, inter, div);
226  exter[0] = roundf(exter[0]);
227  exter[1] = roundf(exter[1]);
228 
229  if (i == 0 || i == (CORNER_RESOLUTION - 1)) {
230  copy_v2_v2(inter, exter);
231  }
232 
233  /* Line width is 20% of the entire corner size. */
234  const float line_width = 0.2f; /* Keep in sync with shader */
235  mul_v2_fl(inter, 1.0f - line_width);
236  mul_v2_fl(exter, 1.0f + line_width);
237 
238  switch (corner) {
239  case 0:
240  add_v2_v2(inter, (float[2]){-1.0f, -1.0f});
241  add_v2_v2(exter, (float[2]){-1.0f, -1.0f});
242  break;
243  case 1:
244  add_v2_v2(inter, (float[2]){1.0f, -1.0f});
245  add_v2_v2(exter, (float[2]){1.0f, -1.0f});
246  break;
247  case 2:
248  add_v2_v2(inter, (float[2]){1.0f, 1.0f});
249  add_v2_v2(exter, (float[2]){1.0f, 1.0f});
250  break;
251  case 3:
252  add_v2_v2(inter, (float[2]){-1.0f, 1.0f});
253  add_v2_v2(exter, (float[2]){-1.0f, 1.0f});
254  break;
255  }
256 
257  GPU_vertbuf_attr_set(vbo, pos, (*vidx)++, inter);
258  GPU_vertbuf_attr_set(vbo, pos, (*vidx)++, exter);
259 }
260 
261 static GPUBatch *batch_screen_edges_get(int *corner_len)
262 {
263  static GPUBatch *screen_edges_batch = NULL;
264 
265  if (screen_edges_batch == NULL) {
266  GPUVertFormat format = {0};
268 
270  GPU_vertbuf_data_alloc(vbo, CORNER_RESOLUTION * 2 * 4 + 2);
271 
272  uint vidx = 0;
273  for (int corner = 0; corner < 4; corner++) {
274  for (int c = 0; c < CORNER_RESOLUTION; c++) {
275  do_vert_pair(vbo, pos, &vidx, corner, c);
276  }
277  }
278  /* close the loop */
279  do_vert_pair(vbo, pos, &vidx, 0, 0);
280 
281  screen_edges_batch = GPU_batch_create_ex(GPU_PRIM_TRI_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO);
282  gpu_batch_presets_register(screen_edges_batch);
283  }
284 
285  if (corner_len) {
286  *corner_len = CORNER_RESOLUTION * 2;
287  }
288  return screen_edges_batch;
289 }
290 
291 #undef CORNER_RESOLUTION
292 
296 static void scrarea_draw_shape_dark(ScrArea *area, char dir, uint pos)
297 {
299  immUniformColor4ub(0, 0, 0, 50);
300 
301  draw_join_shape(area, dir, pos);
302 }
303 
308 {
310  immUniformColor4ub(255, 255, 255, 25);
311 
312  immRectf(pos, area->v1->vec.x, area->v1->vec.y, area->v3->vec.x, area->v3->vec.y);
313 }
314 
316  int sizex, int sizey, short x1, short y1, short x2, short y2, float edge_thickness)
317 {
318  rctf rect;
319  BLI_rctf_init(&rect, (float)x1, (float)x2, (float)y1, (float)y2);
320 
321  /* right border area */
322  if (x2 >= sizex - 1) {
323  rect.xmax += edge_thickness * 0.5f;
324  }
325 
326  /* left border area */
327  if (x1 <= 0) { /* otherwise it draws the emboss of window over */
328  rect.xmin -= edge_thickness * 0.5f;
329  }
330 
331  /* top border area */
332  if (y2 >= sizey - 1) {
333  rect.ymax += edge_thickness * 0.5f;
334  }
335 
336  /* bottom border area */
337  if (y1 <= 0) {
338  rect.ymin -= edge_thickness * 0.5f;
339  }
340 
343  GPU_batch_uniform_4fv(batch, "rect", (float *)&rect);
345 }
346 
350 static void drawscredge_area(ScrArea *area, int sizex, int sizey, float edge_thickness)
351 {
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;
356 
357  drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2, edge_thickness);
358 }
359 
364 {
365  bScreen *screen = WM_window_get_active_screen(win);
366  screen->do_draw = false;
367 
368  if (screen->state == SCREENFULL) {
369  return;
370  }
371 
372  if (screen->temp && BLI_listbase_is_single(&screen->areabase)) {
373  return;
374  }
375 
376  const int winsize_x = WM_window_pixels_x(win);
377  const int winsize_y = WM_window_pixels_y(win);
378  float col[4], corner_scale, edge_thickness;
379  int verts_per_corner = 0;
380 
381  rcti scissor_rect;
382  BLI_rcti_init_minmax(&scissor_rect);
383  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
384  BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v1->vec.x, area->v1->vec.y});
385  BLI_rcti_do_minmax_v(&scissor_rect, (int[2]){area->v3->vec.x, area->v3->vec.y});
386  }
387 
389  /* For some reason, on linux + Intel UHD Graphics 620 the driver
390  * hangs if we don't flush before this. (See T57455) */
391  GPU_flush();
392  }
393 
394  GPU_scissor(scissor_rect.xmin,
395  scissor_rect.ymin,
396  BLI_rcti_size_x(&scissor_rect) + 1,
397  BLI_rcti_size_y(&scissor_rect) + 1);
398 
399  /* It seems that all areas gets smaller when pixelsize is > 1.
400  * So in order to avoid missing pixels we just disable de scissors. */
401  if (U.pixelsize <= 1.0f) {
402  GPU_scissor_test(true);
403  }
404 
406  col[3] = 1.0f;
407  corner_scale = U.pixelsize * 8.0f;
408  edge_thickness = corner_scale * 0.21f;
409 
411 
412  GPUBatch *batch = batch_screen_edges_get(&verts_per_corner);
414  GPU_batch_uniform_1i(batch, "cornerLen", verts_per_corner);
415  GPU_batch_uniform_1f(batch, "scale", corner_scale);
416  GPU_batch_uniform_4fv(batch, "color", col);
417 
418  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
419  drawscredge_area(area, winsize_x, winsize_y, edge_thickness);
420  }
421 
423 
424  if (U.pixelsize <= 1.0f) {
425  GPU_scissor_test(false);
426  }
427 }
428 
436 {
439 
440  GPU_line_width(1);
441 
442  /* blended join arrow */
443  int dir = area_getorientation(sa1, sa2);
444  int dira = -1;
445  if (dir != -1) {
446  switch (dir) {
447  case 0: /* W */
448  dir = 'r';
449  dira = 'l';
450  break;
451  case 1: /* N */
452  dir = 'd';
453  dira = 'u';
454  break;
455  case 2: /* E */
456  dir = 'l';
457  dira = 'r';
458  break;
459  case 3: /* S */
460  dir = 'u';
461  dira = 'd';
462  break;
463  }
464 
466 
467  scrarea_draw_shape_dark(sa2, dir, pos);
468  scrarea_draw_shape_light(sa1, dira, pos);
469 
471  }
472 
474 }
475 
476 void ED_screen_draw_split_preview(ScrArea *area, const int dir, const float fac)
477 {
480 
481  /* Split-point. */
483 
484  immUniformColor4ub(255, 255, 255, 100);
485 
487 
488  if (dir == 'h') {
489  const float y = (1 - fac) * area->totrct.ymin + fac * area->totrct.ymax;
490 
491  immVertex2f(pos, area->totrct.xmin, y);
492  immVertex2f(pos, area->totrct.xmax, y);
493 
494  immEnd();
495 
496  immUniformColor4ub(0, 0, 0, 100);
497 
499 
500  immVertex2f(pos, area->totrct.xmin, y + 1);
501  immVertex2f(pos, area->totrct.xmax, y + 1);
502 
503  immEnd();
504  }
505  else {
506  BLI_assert(dir == 'v');
507  const float x = (1 - fac) * area->totrct.xmin + fac * area->totrct.xmax;
508 
509  immVertex2f(pos, x, area->totrct.ymin);
510  immVertex2f(pos, x, area->totrct.ymax);
511 
512  immEnd();
513 
514  immUniformColor4ub(0, 0, 0, 100);
515 
517 
518  immVertex2f(pos, x + 1, area->totrct.ymin);
519  immVertex2f(pos, x + 1, area->totrct.ymax);
520 
521  immEnd();
522  }
523 
525 
527 }
528 
529 /* -------------------------------------------------------------------- */
530 /* Screen Thumbnail Preview */
531 
537  const bScreen *screen, float size_x, float size_y, const float asp[2], float r_scale[2])
538 {
539  float max_x = 0, max_y = 0;
540 
541  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
542  max_x = MAX2(max_x, area->totrct.xmax);
543  max_y = MAX2(max_y, area->totrct.ymax);
544  }
545  r_scale[0] = (size_x * asp[0]) / max_x;
546  r_scale[1] = (size_y * asp[1]) / max_y;
547 }
548 
549 static void screen_preview_draw_areas(const bScreen *screen,
550  const float scale[2],
551  const float col[4],
552  const float ofs_between_areas)
553 {
554  const float ofs_h = ofs_between_areas * 0.5f;
556 
559 
560  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
561  rctf rect = {
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,
566  };
567 
569  immVertex2f(pos, rect.xmin, rect.ymin);
570  immVertex2f(pos, rect.xmax, rect.ymin);
571  immVertex2f(pos, rect.xmax, rect.ymax);
572  immVertex2f(pos, rect.xmin, rect.ymax);
573  immEnd();
574  }
575 
577 }
578 
579 static void screen_preview_draw(const bScreen *screen, int size_x, int size_y)
580 {
581  const float asp[2] = {1.0f, 0.8f}; /* square previews look a bit ugly */
582  /* could use theme color (tui.wcol_menu_item.text),
583  * but then we'd need to regenerate all previews when changing. */
584  const float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
585  float scale[2];
586 
587  wmOrtho2(0.0f, size_x, 0.0f, size_y);
588  /* center */
589  GPU_matrix_push();
591  GPU_matrix_translate_2f(size_x * (1.0f - asp[0]) * 0.5f, size_y * (1.0f - asp[1]) * 0.5f);
592 
593  screen_preview_scale_get(screen, size_x, size_y, asp, scale);
594  screen_preview_draw_areas(screen, scale, col, 1.5f);
595 
596  GPU_matrix_pop();
597 }
598 
602 void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uint *r_rect)
603 {
604  char err_out[256] = "unknown";
605  GPUOffScreen *offscreen = GPU_offscreen_create(size_x, size_y, true, false, err_out);
606 
607  GPU_offscreen_bind(offscreen, true);
608  GPU_clear_color(0.0f, 0.0f, 0.0f, 0.0f);
609  GPU_clear_depth(1.0f);
610 
611  screen_preview_draw(screen, size_x, size_y);
612 
613  GPU_offscreen_read_pixels(offscreen, GPU_DATA_UBYTE, r_rect);
614  GPU_offscreen_unbind(offscreen, true);
615 
616  GPU_offscreen_free(offscreen);
617 }
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
Definition: BLI_listbase.h:120
MINLINE float max_ff(float a, float b)
#define M_PI_2
Definition: BLI_math_base.h:41
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:157
void BLI_rcti_init_minmax(struct rcti *rect)
Definition: rct.c:516
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition: rct.c:436
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2])
Definition: rct.c:528
unsigned int uint
Definition: BLI_sys_types.h:83
#define UNUSED(x)
#define MAX2(a, b)
#define ELEM(...)
@ SCREENFULL
GPUBatch
Definition: GPU_batch.h:93
#define GPU_batch_uniform_1f(batch, name, x)
Definition: GPU_batch.h:134
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
Definition: gpu_batch.cc:299
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
Definition: gpu_batch.cc:60
void GPU_batch_draw(GPUBatch *batch)
Definition: gpu_batch.cc:234
#define GPU_batch_uniform_4fv(batch, name, val)
Definition: GPU_batch.h:142
@ GPU_BATCH_OWNS_VBO
Definition: GPU_batch.h:45
#define GPU_batch_uniform_1i(batch, name, x)
Definition: GPU_batch.h:132
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 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)
Definition: gpu_matrix.cc:142
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:135
void GPU_matrix_identity_set(void)
Definition: gpu_matrix.cc:184
void GPU_matrix_translate_2f(float x, float y)
Definition: gpu_matrix.cc:190
@ GPU_DRIVER_ANY
Definition: GPU_platform.h:56
@ GPU_OS_UNIX
Definition: GPU_platform.h:48
@ GPU_DEVICE_INTEL_UHD
Definition: GPU_platform.h:36
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver)
@ GPU_PRIM_TRI_FAN
Definition: GPU_primitive.h:41
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:36
@ GPU_PRIM_TRI_STRIP
Definition: GPU_primitive.h:40
@ GPU_SHADER_2D_AREA_EDGES
Definition: GPU_shader.h:372
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:171
@ GPU_BLEND_NONE
Definition: GPU_state.h:55
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:57
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:55
void GPU_scissor_test(bool enable)
Definition: gpu_state.cc:199
void GPU_line_width(float width)
Definition: gpu_state.cc:173
void GPU_flush(void)
Definition: gpu_state.cc:311
void GPU_scissor(int x, int y, int width, int height)
Definition: gpu_state.cc:204
@ GPU_DATA_UBYTE
Definition: GPU_texture.h:175
#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
@ TH_EDITOR_OUTLINE
Definition: UI_resources.h:310
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1199
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
GPUBatch * batch
Definition: drawnode.c:3779
uint pos
uint col
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)
#define sinf(x)
#define cosf(x)
#define fabsf(x)
format
Definition: logImageCore.h:47
static unsigned c
Definition: RandGen.cpp:97
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)
Definition: screen_draw.c:296
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:536
void ED_screen_draw_split_preview(ScrArea *area, const int dir, const float fac)
Definition: screen_draw.c:476
static void screen_preview_draw(const bScreen *screen, int size_x, int size_y)
Definition: screen_draw.c:579
static void drawscredge_area(ScrArea *area, int sizex, int sizey, float edge_thickness)
Screen edges drawing.
Definition: screen_draw.c:350
void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uint *r_rect)
Definition: screen_draw.c:602
static void draw_vertical_join_shape(ScrArea *area, char dir, uint pos)
Definition: screen_draw.c:124
static void do_vert_pair(GPUVertBuf *vbo, uint pos, uint *vidx, int corner, int i)
Definition: screen_draw.c:216
void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2)
Definition: screen_draw.c:435
static void drawscredge_area_draw(int sizex, int sizey, short x1, short y1, short x2, short y2, float edge_thickness)
Definition: screen_draw.c:315
void ED_screen_draw_edges(wmWindow *win)
Definition: screen_draw.c:363
#define CORNER_RESOLUTION
Definition: screen_draw.c:214
static void scrarea_draw_shape_light(ScrArea *area, char UNUSED(dir), uint pos)
Definition: screen_draw.c:307
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:549
static void draw_join_shape(ScrArea *area, char dir, uint pos)
Definition: screen_draw.c:204
static void draw_horizontal_join_shape(ScrArea *area, char dir, uint pos)
Definition: screen_draw.c:44
static GPUBatch * batch_screen_edges_get(int *corner_len)
Definition: screen_draw.c:261
int area_getorientation(ScrArea *area, ScrArea *sb)
Definition: screen_edit.c:285
int screen_geom_area_width(const ScrArea *area)
int screen_geom_area_height(const ScrArea *area)
ListBase areabase
float xmax
Definition: DNA_vec_types.h:85
float xmin
Definition: DNA_vec_types.h:85
float ymax
Definition: DNA_vec_types.h:86
float ymin
Definition: DNA_vec_types.h:86
int ymin
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
float x
Definition: DNA_vec_types.h:39
float y
Definition: DNA_vec_types.h:39
void wmOrtho2(float x1, float x2, float y1, float y2)
Definition: wm_subwindow.c:100
int WM_window_pixels_y(const wmWindow *win)
Definition: wm_window.c:2136
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2372
int WM_window_pixels_x(const wmWindow *win)
Definition: wm_window.c:2130