Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-01-08 15:29:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-08 15:35:34 +0300
commite830334357d1f73afbeeeb421ffcbed8e99b2fab (patch)
tree01042f96ba220e1afba8f090730b9933c257d31d /source/blender/windowmanager/intern
parent0634fd0e974573d4e9452795ce99b2c8105f9fee (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/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c9
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)