diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-04 11:35:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-04 11:41:16 +0300 |
commit | 465a9f65de769d76cc950b674683a0903e36f31a (patch) | |
tree | 4fb27495cc0ca35e250b7af3d334ca5d5259d518 /source/blender/editors/sculpt_paint/paint_image.c | |
parent | 1a23b0be97934ef684e8362e6a888b54a70cef9b (diff) |
Cleanup: remove window manager argument for paint cursor API
This caused an additional argument when exiting object modes
and many other low level functions which don't need to access context.
This simplifies fixing T77073.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index fd5018f76ff..cf2a36de6aa 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -511,12 +511,8 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo } if ((brush->imagepaint_tool == PAINT_TOOL_FILL) && (brush->flag & BRUSH_USE_GRADIENT)) { - pop->cursor = WM_paint_cursor_activate(CTX_wm_manager(C), - SPACE_TYPE_ANY, - RGN_TYPE_ANY, - image_paint_poll, - gradient_draw_line, - pop); + pop->cursor = WM_paint_cursor_activate( + SPACE_TYPE_ANY, RGN_TYPE_ANY, image_paint_poll, gradient_draw_line, pop); } settings->imapaint.flag |= IMAGEPAINT_DRAWING; @@ -655,7 +651,7 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke) } if (pop->cursor) { - WM_paint_cursor_end(CTX_wm_manager(C), pop->cursor); + WM_paint_cursor_end(pop->cursor); } ED_image_undo_push_end(); @@ -787,12 +783,11 @@ bool get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) static void toggle_paint_cursor(bContext *C, int enable) { - wmWindowManager *wm = CTX_wm_manager(C); Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; if (settings->imapaint.paintcursor && !enable) { - WM_paint_cursor_end(wm, settings->imapaint.paintcursor); + WM_paint_cursor_end(settings->imapaint.paintcursor); settings->imapaint.paintcursor = NULL; paint_cursor_delete_textures(); } @@ -827,7 +822,7 @@ void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene) if (enabled) { BKE_paint_init(bmain, scene, PAINT_MODE_TEXTURE_2D, PAINT_CURSOR_TEXTURE_PAINT); - paint_cursor_start_explicit(&imapaint->paint, wm, image_paint_poll); + paint_cursor_start_explicit(&imapaint->paint, image_paint_poll); } else { paint_cursor_delete_textures(); |