From d5e300e14d17f3a9fb42f3b0d23b2d5eba78d140 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Oct 2014 20:19:06 +0200 Subject: Paint: add debug print to time strokes --- source/blender/editors/sculpt_paint/paint_stroke.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 101d176b00f..9c4701d0a01 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -68,6 +68,12 @@ #include #include +// #define DEBUG_TIME + +#ifdef DEBUG_TIME +# include "PIL_time_utildefines.h" +#endif + typedef struct PaintSample { float mouse[2]; float pressure; @@ -910,6 +916,7 @@ static void paint_stroke_line_end(bContext *C, wmOperator *op, PaintStroke *stro static bool paint_stroke_curve_end(bContext *C, wmOperator *op, PaintStroke *stroke) { Brush *br = stroke->brush; + if (br->flag & BRUSH_CURVE) { const Scene *scene = CTX_data_scene(C); const float spacing = paint_space_stroke_spacing(scene, stroke, 1.0f, 1.0f); @@ -921,6 +928,10 @@ static bool paint_stroke_curve_end(bContext *C, wmOperator *op, PaintStroke *str if (!pc) return true; +#ifdef DEBUG_TIME + TIMEIT_START(stroke); +#endif + pcp = pc->points; stroke->ups->overlap_factor = paint_stroke_integrate_overlap(br, 1.0); @@ -956,6 +967,11 @@ static bool paint_stroke_curve_end(bContext *C, wmOperator *op, PaintStroke *str } stroke_done(C, op); + +#ifdef DEBUG_TIME + TIMEIT_END(stroke); +#endif + return true; } -- cgit v1.2.3