diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_space_api.h | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/loopcut.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_api/spacetypes.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 26 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.h | 3 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 8 |
10 files changed, 28 insertions, 33 deletions
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 04b6be3bcaa..14819206dfa 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -60,8 +60,8 @@ void ED_spacetype_userpref(void); void ED_file_init(void); void ED_file_exit(void); -#define REGION_DRAW_PRE 1 -#define REGION_DRAW_POST 0 +#define REGION_DRAW_POST_VIEW 0 +#define REGION_DRAW_POST_PIXEL 1 void *ED_region_draw_cb_activate(struct ARegionType *, void (*draw)(const struct bContext *, struct ARegion *, void *), diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index b7a37f74938..e12f3c99fcd 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -301,7 +301,7 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut) /* assign the drawing handle for drawing preview line... */ lcd->ar= CTX_wm_region(C); - lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST); + lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW); lcd->ob = CTX_data_edit_object(C); lcd->em= BKE_mesh_get_editmesh((Mesh *)lcd->ob->data); lcd->extend = do_cut ? 0 : RNA_boolean_get(op->ptr, "extend"); diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index bdcfd20b5f0..f3db414099f 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -151,10 +151,6 @@ void ED_spacetypes_keymap(wmKeyConfig *keyconf) /* ********************** custom drawcall api ***************** */ -/* type */ -#define REGION_DRAW_PRE 1 -#define REGION_DRAW_POST 0 - typedef struct RegionDrawCB { struct RegionDrawCB *next, *prev; diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index a42fec30c45..46ec41eda58 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -173,8 +173,6 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f { char str[256]; int ofs; - - ED_region_pixelspace(ar); ofs= sprintf(str, "X: %d Y: %d ", x, y); if(cp) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index ffc737eb9af..8d7295e9f20 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1539,7 +1539,7 @@ static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event) info= MEM_callocN(sizeof(ImageSampleInfo), "ImageSampleInfo"); info->art= ar->type; - info->draw_handle = ED_region_draw_cb_activate(ar->type, sample_draw, info, REGION_DRAW_POST); + info->draw_handle = ED_region_draw_cb_activate(ar->type, sample_draw, info, REGION_DRAW_POST_PIXEL); op->customdata= info; sample_apply(C, op, event); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 115f970046f..36d1573a12c 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -431,15 +431,17 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_ortho(C, v2d); draw_uvedit_main(sima, ar, scene, obedit); - ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST); + ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); /* Grease Pencil too (in addition to UV's) */ draw_image_grease_pencil((bContext *)C, 1); UI_view2d_view_restore(C); - + /* draw Grease Pencil - screen space only */ draw_image_grease_pencil((bContext *)C, 0); + + ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL); /* scrollers? */ /*scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index fac3f9fb555..15e41a66981 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2056,7 +2056,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) view3d_update_depths(ar, v3d); } - ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST); + ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); // REEB_draw(); @@ -2123,6 +2123,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) ob= OBACT; if(U.uiflag & USER_DRAWVIEWINFO) draw_selected_name(scene, ob, v3d); + + ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL); /* XXX here was the blockhandlers for floating panels */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1319fdc0bc4..3df74020fab 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1124,15 +1124,8 @@ void drawHelpline(const struct bContext *C, TransInfo *t) projectFloatView(t, vecrot, cent); // no overflow in extreme cases - glDisable(GL_DEPTH_TEST); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); glPushMatrix(); - ED_region_pixelspace(t->ar); - switch(t->helpline) { case HLP_SPRING: @@ -1238,22 +1231,23 @@ void drawHelpline(const struct bContext *C, TransInfo *t) } } - glMatrixMode(GL_PROJECTION); glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - glEnable(GL_DEPTH_TEST); } } -void drawTransform(const struct bContext *C, struct ARegion *ar, void *arg) +void drawTransformView(const struct bContext *C, struct ARegion *ar, void *arg) { TransInfo *t = arg; drawConstraint(C, t); drawPropCircle(C, t); drawSnapping(C, t); +} + +void drawTransformPixel(const struct bContext *C, struct ARegion *ar, void *arg) +{ + TransInfo *t = arg; + drawHelpline(C, t); } @@ -1373,11 +1367,13 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int //calc_manipulator_stats(curarea); initTransformOrientation(C, t); - t->draw_handle = ED_region_draw_cb_activate(t->ar->type, drawTransform, t, REGION_DRAW_POST); + t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); + t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL); } else if(t->spacetype == SPACE_IMAGE) { Mat3One(t->spacemtx); - t->draw_handle = ED_region_draw_cb_activate(t->ar->type, drawTransform, t, REGION_DRAW_POST); + t->draw_handle_view = ED_region_draw_cb_activate(t->ar->type, drawTransformView, t, REGION_DRAW_POST_VIEW); + t->draw_handle_pixel = ED_region_draw_cb_activate(t->ar->type, drawTransformPixel, t, REGION_DRAW_POST_PIXEL); } else Mat3One(t->spacemtx); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index fc31fad622a..46e5dad3e05 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -302,7 +302,8 @@ typedef struct TransInfo { struct wmTimer *animtimer; short mval[2]; /* current mouse position */ struct Object *obedit; - void *draw_handle; + void *draw_handle_view; + void *draw_handle_pixel; } TransInfo; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 5372a9112c3..2af92719d19 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1045,10 +1045,10 @@ void postTrans (TransInfo *t) { TransData *td; - if (t->draw_handle) - { - ED_region_draw_cb_exit(t->ar->type, t->draw_handle); - } + if (t->draw_handle_view) + ED_region_draw_cb_exit(t->ar->type, t->draw_handle_view); + if (t->draw_handle_pixel) + ED_region_draw_cb_exit(t->ar->type, t->draw_handle_pixel); if (t->customFree) { |