Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c272
1 files changed, 136 insertions, 136 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 588839ad18f..66cadf1e76a 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -66,27 +66,27 @@
#include "wm_event_system.h"
/* swap */
-#define WIN_NONE_OK 0
+#define WIN_NONE_OK 0
#define WIN_BACK_OK 1
#define WIN_FRONT_OK 2
-#define WIN_BOTH_OK 3
+#define WIN_BOTH_OK 3
/* ******************* drawing, overlays *************** */
static void wm_paintcursor_draw(bContext *C, ARegion *ar)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
if (wm->paintcursors.first) {
- wmWindow *win= CTX_wm_window(C);
- bScreen *screen= win->screen;
+ wmWindow *win = CTX_wm_window(C);
+ bScreen *screen = win->screen;
wmPaintCursor *pc;
if (screen->subwinactive == ar->swinid) {
- for (pc= wm->paintcursors.first; pc; pc= pc->next) {
+ for (pc = wm->paintcursors.first; pc; pc = pc->next) {
if (pc->poll == NULL || pc->poll(C)) {
- ARegion *ar_other= CTX_wm_region(C);
+ ARegion *ar_other = CTX_wm_region(C);
if (ELEM(win->grabcursor, GHOST_kGrabWrap, GHOST_kGrabHide)) {
int x = 0, y = 0;
wm_get_cursor_position(win, &x, &y);
@@ -112,13 +112,13 @@ static void wm_paintcursor_draw(bContext *C, ARegion *ar)
static void wm_area_mark_invalid_backbuf(ScrArea *sa)
{
if (sa->spacetype == SPACE_VIEW3D)
- ((View3D*)sa->spacedata.first)->flag |= V3D_INVALID_BACKBUF;
+ ((View3D *)sa->spacedata.first)->flag |= V3D_INVALID_BACKBUF;
}
static int wm_area_test_invalid_backbuf(ScrArea *sa)
{
if (sa->spacetype == SPACE_VIEW3D)
- return (((View3D*)sa->spacedata.first)->flag & V3D_INVALID_BACKBUF);
+ return (((View3D *)sa->spacedata.first)->flag & V3D_INVALID_BACKBUF);
else
return 1;
}
@@ -127,7 +127,7 @@ static void wm_region_test_render_do_draw(ScrArea *sa, ARegion *ar)
{
if (sa->spacetype == SPACE_VIEW3D) {
RegionView3D *rv3d = ar->regiondata;
- RenderEngine *engine = (rv3d)? rv3d->render_engine: NULL;
+ RenderEngine *engine = (rv3d) ? rv3d->render_engine : NULL;
if (engine && (engine->flag & RE_ENGINE_DO_DRAW)) {
ar->do_draw = 1;
@@ -141,15 +141,15 @@ static void wm_region_test_render_do_draw(ScrArea *sa, ARegion *ar)
static void wm_method_draw_full(bContext *C, wmWindow *win)
{
- bScreen *screen= win->screen;
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
/* draw area regions */
- for (sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
CTX_wm_area_set(C, sa);
- for (ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->swinid) {
CTX_wm_region_set(C, ar);
ED_region_do_draw(C, ar);
@@ -167,7 +167,7 @@ static void wm_method_draw_full(bContext *C, wmWindow *win)
ED_area_overdraw(C);
/* draw overlapping regions */
- for (ar=screen->regionbase.first; ar; ar= ar->next) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
if (ar->swinid) {
CTX_wm_menu_set(C, ar);
ED_region_do_draw(C, ar);
@@ -191,12 +191,12 @@ static void wm_flush_regions_down(bScreen *screen, rcti *dirty)
ScrArea *sa;
ARegion *ar;
- for (sa= screen->areabase.first; sa; sa= sa->next) {
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
- ar->do_draw= RGN_DRAW;
+ ar->do_draw = RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
- ar->swap= WIN_NONE_OK;
+ ar->swap = WIN_NONE_OK;
}
}
}
@@ -207,50 +207,50 @@ static void wm_flush_regions_up(bScreen *screen, rcti *dirty)
{
ARegion *ar;
- for (ar= screen->regionbase.first; ar; ar= ar->next) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
if (BLI_isect_rcti(dirty, &ar->winrct, NULL)) {
- ar->do_draw= RGN_DRAW;
+ ar->do_draw = RGN_DRAW;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
- ar->swap= WIN_NONE_OK;
+ ar->swap = WIN_NONE_OK;
}
}
}
static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
{
- wmWindowManager *wm= CTX_wm_manager(C);
- bScreen *screen= win->screen;
+ wmWindowManager *wm = CTX_wm_manager(C);
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
- static rcti rect= {0, 0, 0, 0};
+ static rcti rect = {0, 0, 0, 0};
/* after backbuffer selection draw, we need to redraw */
- for (sa= screen->areabase.first; sa; sa= sa->next)
- for (ar= sa->regionbase.first; ar; ar= ar->next)
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
if (ar->swinid && !wm_area_test_invalid_backbuf(sa))
ED_region_tag_redraw(ar);
/* flush overlapping regions */
if (screen->regionbase.first) {
/* flush redraws of area regions up to overlapping regions */
- for (sa= screen->areabase.first; sa; sa= sa->next)
- for (ar= sa->regionbase.first; ar; ar= ar->next)
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
if (ar->swinid && ar->do_draw)
wm_flush_regions_up(screen, &ar->winrct);
/* flush between overlapping regions */
- for (ar= screen->regionbase.last; ar; ar= ar->prev)
+ for (ar = screen->regionbase.last; ar; ar = ar->prev)
if (ar->swinid && ar->do_draw)
wm_flush_regions_up(screen, &ar->winrct);
/* flush redraws of overlapping regions down to area regions */
- for (ar= screen->regionbase.last; ar; ar= ar->prev)
+ for (ar = screen->regionbase.last; ar; ar = ar->prev)
if (ar->swinid && ar->do_draw)
wm_flush_regions_down(screen, &ar->winrct);
}
/* flush drag item */
- if (rect.xmin!=rect.xmax) {
+ if (rect.xmin != rect.xmax) {
wm_flush_regions_down(screen, &rect);
rect.xmin = rect.xmax = 0;
}
@@ -260,10 +260,10 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
}
/* draw marked area regions */
- for (sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
CTX_wm_area_set(C, sa);
- for (ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->swinid) {
if (ar->do_draw) {
CTX_wm_region_set(C, ar);
@@ -273,7 +273,7 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
CTX_wm_region_set(C, NULL);
if (exchange)
- ar->swap= WIN_FRONT_OK;
+ ar->swap = WIN_FRONT_OK;
}
else if (exchange) {
if (ar->swap == WIN_FRONT_OK) {
@@ -283,12 +283,12 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
ED_area_overdraw_flush(sa, ar);
CTX_wm_region_set(C, NULL);
- ar->swap= WIN_BOTH_OK;
+ ar->swap = WIN_BOTH_OK;
}
else if (ar->swap == WIN_BACK_OK)
- ar->swap= WIN_FRONT_OK;
+ ar->swap = WIN_FRONT_OK;
else if (ar->swap == WIN_BOTH_OK)
- ar->swap= WIN_BOTH_OK;
+ ar->swap = WIN_BOTH_OK;
}
}
}
@@ -302,23 +302,23 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange)
ED_screen_draw(win);
if (exchange)
- screen->swap= WIN_FRONT_OK;
+ screen->swap = WIN_FRONT_OK;
}
else if (exchange) {
- if (screen->swap==WIN_FRONT_OK) {
+ if (screen->swap == WIN_FRONT_OK) {
ED_screen_draw(win);
- screen->swap= WIN_BOTH_OK;
+ screen->swap = WIN_BOTH_OK;
}
- else if (screen->swap==WIN_BACK_OK)
- screen->swap= WIN_FRONT_OK;
- else if (screen->swap==WIN_BOTH_OK)
- screen->swap= WIN_BOTH_OK;
+ else if (screen->swap == WIN_BACK_OK)
+ screen->swap = WIN_FRONT_OK;
+ else if (screen->swap == WIN_BOTH_OK)
+ screen->swap = WIN_BOTH_OK;
}
ED_area_overdraw(C);
/* draw marked overlapping regions */
- for (ar=screen->regionbase.first; ar; ar= ar->next) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
if (ar->swinid && ar->do_draw) {
CTX_wm_menu_set(C, ar);
ED_region_do_draw(C, ar);
@@ -357,7 +357,7 @@ static void wm_method_draw_damage(bContext *C, wmWindow *win)
#define MAX_N_TEX 3
typedef struct wmDrawTriple {
- GLuint bind[MAX_N_TEX*MAX_N_TEX];
+ GLuint bind[MAX_N_TEX * MAX_N_TEX];
int x[MAX_N_TEX], y[MAX_N_TEX];
int nx, ny;
GLenum target;
@@ -369,46 +369,46 @@ static void split_width(int x, int n, int *splitx, int *nx)
/* if already power of two just use it */
if (is_power_of_2_i(x)) {
- splitx[0]= x;
+ splitx[0] = x;
(*nx)++;
return;
}
if (n == 1) {
/* last part, we have to go larger */
- splitx[0]= power_of_2_max_i(x);
+ splitx[0] = power_of_2_max_i(x);
(*nx)++;
}
else {
/* two or more parts to go, use smaller part */
- splitx[0]= power_of_2_min_i(x);
- newnx= ++(*nx);
- split_width(x-splitx[0], n-1, splitx+1, &newnx);
+ splitx[0] = power_of_2_min_i(x);
+ newnx = ++(*nx);
+ split_width(x - splitx[0], n - 1, splitx + 1, &newnx);
- for (waste=0, a=0; a<n; a++)
+ for (waste = 0, a = 0; a < n; a++)
waste += splitx[a];
/* if we waste more space or use the same amount,
* revert deeper splits and just use larger */
if (waste >= power_of_2_max_i(x)) {
- splitx[0]= power_of_2_max_i(x);
- memset(splitx+1, 0, sizeof(int)*(n-1));
+ splitx[0] = power_of_2_max_i(x);
+ memset(splitx + 1, 0, sizeof(int) * (n - 1));
}
else
- *nx= newnx;
+ *nx = newnx;
}
}
static void wm_draw_triple_free(wmWindow *win)
{
if (win->drawdata) {
- wmDrawTriple *triple= win->drawdata;
+ wmDrawTriple *triple = win->drawdata;
- glDeleteTextures(triple->nx*triple->ny, triple->bind);
+ glDeleteTextures(triple->nx * triple->ny, triple->bind);
MEM_freeN(triple);
- win->drawdata= NULL;
+ win->drawdata = NULL;
}
}
@@ -416,7 +416,7 @@ static void wm_draw_triple_fail(bContext *C, wmWindow *win)
{
wm_draw_window_clear(win);
- win->drawfail= 1;
+ win->drawfail = 1;
wm_method_draw_overlap_all(C, win, 0);
}
@@ -427,29 +427,29 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
/* compute texture sizes */
if (GLEW_ARB_texture_rectangle || GLEW_NV_texture_rectangle || GLEW_EXT_texture_rectangle) {
- triple->target= GL_TEXTURE_RECTANGLE_ARB;
- triple->nx= 1;
- triple->ny= 1;
- triple->x[0]= win->sizex;
- triple->y[0]= win->sizey;
+ triple->target = GL_TEXTURE_RECTANGLE_ARB;
+ triple->nx = 1;
+ triple->ny = 1;
+ triple->x[0] = win->sizex;
+ triple->y[0] = win->sizey;
}
else if (GPU_non_power_of_two_support()) {
- triple->target= GL_TEXTURE_2D;
- triple->nx= 1;
- triple->ny= 1;
- triple->x[0]= win->sizex;
- triple->y[0]= win->sizey;
+ triple->target = GL_TEXTURE_2D;
+ triple->nx = 1;
+ triple->ny = 1;
+ triple->x[0] = win->sizex;
+ triple->y[0] = win->sizey;
}
else {
- triple->target= GL_TEXTURE_2D;
- triple->nx= 0;
- triple->ny= 0;
+ triple->target = GL_TEXTURE_2D;
+ triple->nx = 0;
+ triple->ny = 0;
split_width(win->sizex, MAX_N_TEX, triple->x, &triple->nx);
split_width(win->sizey, MAX_N_TEX, triple->y, &triple->ny);
}
/* generate texture names */
- glGenTextures(triple->nx*triple->ny, triple->bind);
+ glGenTextures(triple->nx * triple->ny, triple->bind);
if (!triple->bind[0]) {
/* not the typical failure case but we handle it anyway */
@@ -457,8 +457,8 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
return 0;
}
- for (y=0; y<triple->ny; y++) {
- for (x=0; x<triple->nx; x++) {
+ for (y = 0; y < triple->ny; y++) {
+ for (x = 0; x < triple->nx; x++) {
/* proxy texture is only guaranteed to test for the cases that
* there is only one texture in use, which may not be the case */
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize);
@@ -471,7 +471,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
}
/* setup actual texture */
- glBindTexture(triple->target, triple->bind[x + y*triple->nx]);
+ glBindTexture(triple->target, triple->bind[x + y * triple->nx]);
glTexImage2D(triple->target, 0, GL_RGB8, triple->x[x], triple->y[y], 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(triple->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(triple->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -497,16 +497,16 @@ static void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple)
glEnable(triple->target);
- for (y=0, offy=0; y<triple->ny; offy+=triple->y[y], y++) {
- for (x=0, offx=0; x<triple->nx; offx+=triple->x[x], x++) {
- sizex= (x == triple->nx-1)? win->sizex-offx: triple->x[x];
- sizey= (y == triple->ny-1)? win->sizey-offy: triple->y[y];
+ for (y = 0, offy = 0; y < triple->ny; offy += triple->y[y], y++) {
+ for (x = 0, offx = 0; x < triple->nx; offx += triple->x[x], x++) {
+ sizex = (x == triple->nx - 1) ? win->sizex - offx : triple->x[x];
+ sizey = (y == triple->ny - 1) ? win->sizey - offy : triple->y[y];
/* wmOrtho for the screen has this same offset */
- ratiox= sizex;
- ratioy= sizey;
- halfx= 0.375f;
- halfy= 0.375f;
+ ratiox = sizex;
+ ratioy = sizey;
+ halfx = 0.375f;
+ halfy = 0.375f;
/* texture rectangle has unnormalized coordinates */
if (triple->target == GL_TEXTURE_2D) {
@@ -516,21 +516,21 @@ static void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple)
halfy /= triple->y[y];
}
- glBindTexture(triple->target, triple->bind[x + y*triple->nx]);
+ glBindTexture(triple->target, triple->bind[x + y * triple->nx]);
glColor3f(1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
- glTexCoord2f(halfx, halfy);
- glVertex2f(offx, offy);
+ glTexCoord2f(halfx, halfy);
+ glVertex2f(offx, offy);
- glTexCoord2f(ratiox+halfx, halfy);
- glVertex2f(offx+sizex, offy);
+ glTexCoord2f(ratiox + halfx, halfy);
+ glVertex2f(offx + sizex, offy);
- glTexCoord2f(ratiox+halfx, ratioy+halfy);
- glVertex2f(offx+sizex, offy+sizey);
+ glTexCoord2f(ratiox + halfx, ratioy + halfy);
+ glVertex2f(offx + sizex, offy + sizey);
- glTexCoord2f(halfx, ratioy+halfy);
- glVertex2f(offx, offy+sizey);
+ glTexCoord2f(halfx, ratioy + halfy);
+ glVertex2f(offx, offy + sizey);
glEnd();
}
}
@@ -543,12 +543,12 @@ static void wm_triple_copy_textures(wmWindow *win, wmDrawTriple *triple)
{
int x, y, sizex, sizey, offx, offy;
- for (y=0, offy=0; y<triple->ny; offy+=triple->y[y], y++) {
- for (x=0, offx=0; x<triple->nx; offx+=triple->x[x], x++) {
- sizex= (x == triple->nx-1)? win->sizex-offx: triple->x[x];
- sizey= (y == triple->ny-1)? win->sizey-offy: triple->y[y];
+ for (y = 0, offy = 0; y < triple->ny; offy += triple->y[y], y++) {
+ for (x = 0, offx = 0; x < triple->nx; offx += triple->x[x], x++) {
+ sizex = (x == triple->nx - 1) ? win->sizex - offx : triple->x[x];
+ sizey = (y == triple->ny - 1) ? win->sizey - offy : triple->y[y];
- glBindTexture(triple->target, triple->bind[x + y*triple->nx]);
+ glBindTexture(triple->target, triple->bind[x + y * triple->nx]);
glCopyTexSubImage2D(triple->target, 0, 0, 0, offx, offy, sizex, sizey);
}
}
@@ -558,23 +558,23 @@ static void wm_triple_copy_textures(wmWindow *win, wmDrawTriple *triple)
static void wm_method_draw_triple(bContext *C, wmWindow *win)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmDrawTriple *triple;
- bScreen *screen= win->screen;
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
- int copytex= 0, paintcursor= 1;
+ int copytex = 0, paintcursor = 1;
if (win->drawdata) {
glClearColor(0, 0, 0, 0);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
wmSubWindowSet(win, screen->mainwin);
wm_triple_draw_textures(win, win->drawdata);
}
else {
- win->drawdata= MEM_callocN(sizeof(wmDrawTriple), "wmDrawTriple");
+ win->drawdata = MEM_callocN(sizeof(wmDrawTriple), "wmDrawTriple");
if (!wm_triple_gen_textures(win, win->drawdata)) {
wm_draw_triple_fail(C, win);
@@ -582,19 +582,19 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
}
}
- triple= win->drawdata;
+ triple = win->drawdata;
/* draw marked area regions */
- for (sa= screen->areabase.first; sa; sa= sa->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
CTX_wm_area_set(C, sa);
- for (ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->swinid && ar->do_draw) {
CTX_wm_region_set(C, ar);
ED_region_do_draw(C, ar);
ED_area_overdraw_flush(sa, ar);
CTX_wm_region_set(C, NULL);
- copytex= 1;
+ copytex = 1;
}
}
@@ -613,13 +613,13 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
ED_screen_draw(win);
/* draw overlapping regions */
- for (ar=screen->regionbase.first; ar; ar= ar->next) {
+ for (ar = screen->regionbase.first; ar; ar = ar->next) {
if (ar->swinid) {
CTX_wm_menu_set(C, ar);
ED_region_do_draw(C, ar);
CTX_wm_menu_set(C, NULL);
/* when a menu is being drawn, don't do the paint cursors */
- paintcursor= 0;
+ paintcursor = 0;
}
}
@@ -628,8 +628,8 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win)
wm_gesture_draw(win);
if (paintcursor && wm->paintcursors.first) {
- for (sa= screen->areabase.first; sa; sa= sa->next) {
- for (ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (ar->swinid == screen->subwinactive) {
CTX_wm_area_set(C, sa);
CTX_wm_region_set(C, ar);
@@ -661,19 +661,19 @@ static int wm_draw_update_test_window(wmWindow *win)
{
ScrArea *sa;
ARegion *ar;
- int do_draw= 0;
+ int do_draw = 0;
- for (ar= win->screen->regionbase.first; ar; ar= ar->next) {
+ for (ar = win->screen->regionbase.first; ar; ar = ar->next) {
if (ar->do_draw_overlay) {
wm_tag_redraw_overlay(win, ar);
- ar->do_draw_overlay= 0;
+ ar->do_draw_overlay = 0;
}
if (ar->swinid && ar->do_draw)
- do_draw= 1;
+ do_draw = 1;
}
- for (sa= win->screen->areabase.first; sa; sa= sa->next) {
- for (ar=sa->regionbase.first; ar; ar= ar->next) {
+ for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
wm_region_test_render_do_draw(sa, ar);
if (ar->swinid && ar->do_draw)
@@ -737,22 +737,22 @@ void wm_tag_redraw_overlay(wmWindow *win, ARegion *ar)
if (ar && win) {
if (wm_automatic_draw_method(win) != USER_DRAW_TRIPLE)
ED_region_tag_redraw(ar);
- win->screen->do_draw_paintcursor= 1;
+ win->screen->do_draw_paintcursor = 1;
}
}
void wm_draw_update(bContext *C)
{
- wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
int drawmethod;
GPU_free_unused_buffers();
- for (win= wm->windows.first; win; win= win->next) {
+ for (win = wm->windows.first; win; win = win->next) {
if (win->drawmethod != U.wmdrawmethod) {
wm_draw_window_clear(win);
- win->drawmethod= U.wmdrawmethod;
+ win->drawmethod = U.wmdrawmethod;
}
if (wm_draw_update_test_window(win)) {
@@ -765,7 +765,7 @@ void wm_draw_update(bContext *C)
if (win->screen->do_refresh)
ED_screen_refresh(wm, win);
- drawmethod= wm_automatic_draw_method(win);
+ drawmethod = wm_automatic_draw_method(win);
if (win->drawfail)
wm_method_draw_overlap_all(C, win, 0);
@@ -778,9 +778,9 @@ void wm_draw_update(bContext *C)
else // if (drawmethod == USER_DRAW_TRIPLE)
wm_method_draw_triple(C, win);
- win->screen->do_draw_gesture= 0;
- win->screen->do_draw_paintcursor= 0;
- win->screen->do_draw_drag= 0;
+ win->screen->do_draw_gesture = 0;
+ win->screen->do_draw_paintcursor = 0;
+ win->screen->do_draw_drag = 0;
wm_window_swap_buffers(win);
@@ -791,39 +791,39 @@ void wm_draw_update(bContext *C)
void wm_draw_window_clear(wmWindow *win)
{
- bScreen *screen= win->screen;
+ bScreen *screen = win->screen;
ScrArea *sa;
ARegion *ar;
- int drawmethod= wm_automatic_draw_method(win);
+ int drawmethod = wm_automatic_draw_method(win);
if (drawmethod == USER_DRAW_TRIPLE)
wm_draw_triple_free(win);
/* clear screen swap flags */
if (screen) {
- for (sa= screen->areabase.first; sa; sa= sa->next)
- for (ar=sa->regionbase.first; ar; ar= ar->next)
- ar->swap= WIN_NONE_OK;
+ for (sa = screen->areabase.first; sa; sa = sa->next)
+ for (ar = sa->regionbase.first; ar; ar = ar->next)
+ ar->swap = WIN_NONE_OK;
- screen->swap= WIN_NONE_OK;
+ screen->swap = WIN_NONE_OK;
}
}
void wm_draw_region_clear(wmWindow *win, ARegion *ar)
{
- int drawmethod= wm_automatic_draw_method(win);
+ int drawmethod = wm_automatic_draw_method(win);
if (ELEM(drawmethod, USER_DRAW_OVERLAP, USER_DRAW_OVERLAP_FLIP))
wm_flush_regions_down(win->screen, &ar->winrct);
- win->screen->do_draw= 1;
+ win->screen->do_draw = 1;
}
void WM_redraw_windows(bContext *C)
{
- wmWindow *win_prev= CTX_wm_window(C);
- ScrArea *area_prev= CTX_wm_area(C);
- ARegion *ar_prev= CTX_wm_region(C);
+ wmWindow *win_prev = CTX_wm_window(C);
+ ScrArea *area_prev = CTX_wm_area(C);
+ ARegion *ar_prev = CTX_wm_region(C);
wm_draw_update(C);