diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-08 15:29:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-08 15:35:34 +0300 |
commit | e830334357d1f73afbeeeb421ffcbed8e99b2fab (patch) | |
tree | 01042f96ba220e1afba8f090730b9933c257d31d /source/blender/editors/sculpt_paint | |
parent | 0634fd0e974573d4e9452795ce99b2c8105f9fee (diff) |
Math Lib: use x-span for fill_poly_v2i_n callback
Instead of running the callback per-pixel,
pass the x-span to the callback.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_mask.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index ead0fb5d067..83589a9b05e 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -315,10 +315,14 @@ static bool is_effected_lasso(LassoMaskData *data, float co[3]) return BLI_BITMAP_TEST_BOOL(data->px, scr_co_s[1] * data->width + scr_co_s[0]); } -static void mask_lasso_px_cb(int x, int y, void *user_data) +static void mask_lasso_px_cb(int x, int x_end, int y, void *user_data) { struct LassoMaskData *data = user_data; - BLI_BITMAP_ENABLE(data->px, (y * data->width) + x); + int index = (y * data->width) + x; + int index_end = (y * data->width) + x_end; + do { + BLI_BITMAP_ENABLE(data->px, index); + } while (++index != index_end); } static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op) |