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/windowmanager | |
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/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 288e6711b56..92c9b81cdef 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -235,12 +235,15 @@ struct LassoFillData { int width; }; -static void draw_filled_lasso_px_cb(int x, int y, void *user_data) +static void draw_filled_lasso_px_cb(int x, int x_end, int y, void *user_data) { struct LassoFillData *data = user_data; unsigned char *col = (unsigned char *)&(data->px[(y * data->width) + x]); - col[0] = col[1] = col[2] = 0xff; - col[3] = 0x10; + do { + col[0] = col[1] = col[2] = 0xff; + col[3] = 0x10; + col += 4; + } while (++x != x_end); } static void draw_filled_lasso(wmWindow *win, wmGesture *gt) |