diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-17 01:56:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-17 01:56:52 +0300 |
commit | 9c9209f7e59d1561935ddeb7f5f42181ac965a86 (patch) | |
tree | b8ef93ba02dc40e09e6fcb385b5ccb345cc0d24b /source/blender/editors/screen | |
parent | 8c74944a8e6e21cca35a2f610360e1e2a1418b76 (diff) |
resizing any area/region would redraw all views in every window.
This means a large scene will make blender resize the border between the timeline and the graph editor slow since it redraws the 3d view for each update.
edited the operators to only redraw whats needed. since tons away IFDEF'd this incse it needs to be reverted.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 59 |
3 files changed, 58 insertions, 6 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index bf4dba5a4fe..56dd9b4a361 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -121,10 +121,12 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note) case NC_WINDOW: ED_region_tag_redraw(ar); break; +#ifndef WM_FAST_DRAW case NC_SCREEN: if(note->action==NA_EDITED) ED_region_tag_redraw(ar); /* pass on */ +#endif default: if(ar->type && ar->type->listener) ar->type->listener(ar, note); diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 6278ea8db88..d7d94a9ec62 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -60,6 +60,9 @@ void ed_screen_context(const bContext *C, const char *member, bContextDataResult void SCREEN_OT_screenshot(struct wmOperatorType *ot); void SCREEN_OT_screencast(struct wmOperatorType *ot); +/* partial updates, much faster then drawing everything, ton is away so allow easy undo'ing - campbell */ +#define WM_FAST_DRAW + #endif /* ED_SCREEN_INTERN_H */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 912ac98aee4..4461549aa28 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -640,6 +640,11 @@ static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event) area_swap_exit(C, op); +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(sad->sa1); + ED_area_tag_redraw(sad->sa2); +#endif + WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -708,6 +713,10 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event) /* copy area to new screen */ area_copy_data((ScrArea *)newsc->areabase.first, sa, 0); +#ifdef WM_FAST_DRAW + ED_area_tag_redraw((ScrArea *)newsc->areabase.first); +#endif + /* screen, areas init */ WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); @@ -854,8 +863,16 @@ static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int } } } - - WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); +#ifdef WM_FAST_DRAW + { + ScrArea *sa; + for(sa= sc->areabase.first; sa; sa= sa->next) + if(sa->v1->flag || sa->v2->flag || sa->v3->flag || sa->v4->flag) + ED_area_tag_redraw(sa); + } + +#endif + WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); /* redraw everything */ } static void area_move_apply(bContext *C, wmOperator *op) @@ -1116,7 +1133,11 @@ static int area_split_apply(bContext *C, wmOperator *op) if(dir=='h') sd->origval= sd->nedge->v1->vec.y; else sd->origval= sd->nedge->v1->vec.x; - + +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(sd->sarea); + ED_area_tag_redraw(sd->narea); +#endif WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); return 1; @@ -1128,6 +1149,12 @@ static int area_split_apply(bContext *C, wmOperator *op) static void area_split_exit(bContext *C, wmOperator *op) { if (op->customdata) { +#ifdef WM_FAST_DRAW + sAreaSplitData *sd= (sAreaSplitData *)op->customdata; + if(sd->sarea) ED_area_tag_redraw(sd->sarea); + if(sd->narea) ED_area_tag_redraw(sd->narea); +#endif + MEM_freeN(op->customdata); op->customdata = NULL; } @@ -1250,8 +1277,6 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event) fac= (dir == 'v') ? event->x-sd->origmin : event->y-sd->origmin; RNA_float_set(op->ptr, "factor", fac / (float)sd->origsize); - - WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); break; case LEFTMOUSE: @@ -1414,7 +1439,9 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event) else if(rmd->ar->flag & RGN_FLAG_HIDDEN) ED_region_toggle_hidden(C, rmd->ar); } - +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(rmd->sa); +#endif WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); break; @@ -1425,6 +1452,9 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event) if(ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) { if(rmd->ar->flag & RGN_FLAG_HIDDEN) { ED_region_toggle_hidden(C, rmd->ar); +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(rmd->sa); +#endif WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); } } @@ -1907,6 +1937,10 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event) break; case LEFTMOUSE: if(event->val==KM_RELEASE) { +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(jd->sa1); + ED_area_tag_redraw(jd->sa2); +#endif area_join_apply(C, op); WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); area_join_exit(C, op); @@ -2089,6 +2123,9 @@ static int region_quadview_exec(bContext *C, wmOperator *op) MEM_freeN(ar); } } +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(sa); +#endif WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); } else if(ar->next) @@ -2125,6 +2162,9 @@ static int region_quadview_exec(bContext *C, wmOperator *op) rv3d->view= RV3D_VIEW_CAMERA; rv3d->persp= RV3D_CAMOB; } +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(sa); +#endif WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); } @@ -2167,6 +2207,9 @@ static int region_flip_exec(bContext *C, wmOperator *op) else if(ar->alignment==RGN_ALIGN_RIGHT) ar->alignment= RGN_ALIGN_LEFT; +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(CTX_wm_area(C)); +#endif WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -2220,6 +2263,10 @@ static int header_flip_exec(bContext *C, wmOperator *op) else if(ar->alignment==RGN_ALIGN_RIGHT) ar->alignment= RGN_ALIGN_LEFT; +#ifdef WM_FAST_DRAW + ED_area_tag_redraw(CTX_wm_area(C)); +#endif + WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); printf("executed header region flip\n"); |