Blender  V2.93
Macros | Functions
screen_draw.c File Reference
#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 GPUBatchbatch_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)
 

Macro Definition Documentation

◆ CORNER_RESOLUTION

#define CORNER_RESOLUTION   3

Definition at line 214 of file screen_draw.c.

Function Documentation

◆ batch_screen_edges_get()

static GPUBatch* batch_screen_edges_get ( int *  corner_len)
static

◆ do_vert_pair()

static void do_vert_pair ( GPUVertBuf vbo,
uint  pos,
uint vidx,
int  corner,
int  i 
)
static

◆ draw_horizontal_join_shape()

static void draw_horizontal_join_shape ( ScrArea area,
char  dir,
uint  pos 
)
static

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()

static void draw_join_shape ( ScrArea area,
char  dir,
uint  pos 
)
static

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_join_shape()

static void draw_vertical_join_shape ( ScrArea area,
char  dir,
uint  pos 
)
static

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().

◆ drawscredge_area()

static void drawscredge_area ( ScrArea area,
int  sizex,
int  sizey,
float  edge_thickness 
)
static

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().

◆ drawscredge_area_draw()

static void drawscredge_area_draw ( int  sizex,
int  sizey,
short  x1,
short  y1,
short  x2,
short  y2,
float  edge_thickness 
)
static

◆ ED_screen_draw_edges()

void ED_screen_draw_edges ( wmWindow win)

◆ ED_screen_draw_join_shape()

void ED_screen_draw_join_shape ( ScrArea sa1,
ScrArea sa2 
)

The blended join arrows.

Parameters
sa1Area from which the resultant originates.
sa2Target 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().

◆ ED_screen_draw_split_preview()

void ED_screen_draw_split_preview ( ScrArea area,
const int  dir,
const float  fac 
)

◆ ED_screen_preview_render()

void ED_screen_preview_render ( const bScreen screen,
int  size_x,
int  size_y,
uint r_rect 
)

◆ scrarea_draw_shape_dark()

static void scrarea_draw_shape_dark ( ScrArea area,
char  dir,
uint  pos 
)
static

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().

◆ scrarea_draw_shape_light()

static void scrarea_draw_shape_light ( ScrArea area,
char   UNUSEDdir,
uint  pos 
)
static

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().

◆ screen_preview_draw()

static void screen_preview_draw ( const bScreen screen,
int  size_x,
int  size_y 
)
static

◆ screen_preview_draw_areas()

static void screen_preview_draw_areas ( const bScreen screen,
const float  scale[2],
const float  col[4],
const float  ofs_between_areas 
)
static

◆ screen_preview_scale_get()

static void screen_preview_scale_get ( const bScreen screen,
float  size_x,
float  size_y,
const float  asp[2],
float  r_scale[2] 
)
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().