diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-05 18:05:41 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-30 21:01:20 +0400 |
commit | a51aeedade2d0620d8509602ab04c2ec00e06053 (patch) | |
tree | 7a2f697942ebb94f13073136af72568663513ffc /source/blender/editors/screen/glutil.c | |
parent | e919a37e97874d2e7b5abc134eab7ed43c993b18 (diff) |
Experiment with the compositor border in editor
Preserve buffer form previous runs so it's possible to make
a compo of full frame, then draw a border and start tweaking
nodes and see updates in that border.
Main idea is to make it able to visually compare difference
between what was changed inside the border and how frame
looked before the tweaks outside of the border.
Also implemented Clear Viewer Border in compositor, shortcut
it Ctrl-Alt-B.
Reviewers: lukastoenne, jbakker
CC: venomgfx, sebastian_k
Differential Revision: https://developer.blender.org/D582
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index f31d79ff76b..0edde66ffff 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -50,6 +50,8 @@ #include "IMB_colormanagement.h" #include "IMB_imbuf_types.h" +#include "UI_interface.h" + #ifndef GL_CLAMP_TO_EDGE #define GL_CLAMP_TO_EDGE 0x812F #endif @@ -1139,3 +1141,40 @@ void cpack(unsigned int x) (((x) >> 8) & 0xFF), (((x) >> 16) & 0xFF) ); } + +void glaDrawBorderCorners(const rcti *border, float zoomx, float zoomy) +{ + float delta_x = 4.0f * UI_DPI_FAC / zoomx; + float delta_y = 4.0f * UI_DPI_FAC / zoomy; + + delta_x = min_ff(delta_x, border->xmax - border->xmin); + delta_y = min_ff(delta_y, border->ymax - border->ymin); + + /* left bottom corner */ + glBegin(GL_LINE_STRIP); + glVertex2f(border->xmin, border->ymin + delta_y); + glVertex2f(border->xmin, border->ymin); + glVertex2f(border->xmin + delta_x, border->ymin); + glEnd(); + + /* left top corner */ + glBegin(GL_LINE_STRIP); + glVertex2f(border->xmin, border->ymax - delta_y); + glVertex2f(border->xmin, border->ymax); + glVertex2f(border->xmin + delta_x, border->ymax); + glEnd(); + + /* right bottom corner */ + glBegin(GL_LINE_STRIP); + glVertex2f(border->xmax - delta_x, border->ymin); + glVertex2f(border->xmax, border->ymin); + glVertex2f(border->xmax, border->ymin + delta_y); + glEnd(); + + /* right top corner */ + glBegin(GL_LINE_STRIP); + glVertex2f(border->xmax - delta_x, border->ymax); + glVertex2f(border->xmax, border->ymax); + glVertex2f(border->xmax, border->ymax - delta_y); + glEnd(); +} |