[Bf-blender-cvs] [d5e300e] master: Paint: add debug print to time strokes

Campbell Barton noreply at git.blender.org
Tue Oct 7 20:26:41 CEST 2014


Commit: d5e300e14d17f3a9fb42f3b0d23b2d5eba78d140
Author: Campbell Barton
Date:   Tue Oct 7 20:19:06 2014 +0200
Branches: master
https://developer.blender.org/rBd5e300e14d17f3a9fb42f3b0d23b2d5eba78d140

Paint: add debug print to time strokes

===================================================================

M	source/blender/editors/sculpt_paint/paint_stroke.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 101d176..9c4701d 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -68,6 +68,12 @@
 #include <float.h>
 #include <math.h>
 
+// #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;
 	}




More information about the Bf-blender-cvs mailing list