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>2013-02-04 04:02:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-04 04:02:26 +0400
commitc584e01beeaa8c800f9b50bbe9d866037b42230b (patch)
tree5b2c9bdb7e95aad58e8155d1f8b4e2c203a6dce0 /source/blender/editors/space_view3d/drawvolume.c
parent2950214527812503b009995c638d2be37efaa22f (diff)
drawvolume was timing drawing unnecessarily,
replace local defined timing functions with calls to TIMEIT_* macros from PIL_time.h and disable by default.
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c62
1 files changed, 12 insertions, 50 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 29daee3e11b..70d3857601f 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -74,61 +74,18 @@
#include "ED_mesh.h"
-
#include "BLF_api.h"
-
#include "view3d_intern.h" // own include
+struct GPUTexture;
-#ifdef _WIN32
-#include <time.h>
-#include <stdio.h>
-#include <conio.h>
-#include <windows.h>
-
-static LARGE_INTEGER liFrequency;
-static LARGE_INTEGER liStartTime;
-static LARGE_INTEGER liCurrentTime;
+// #define DEBUG_DRAW_TIME
-static void tstart(void)
-{
- QueryPerformanceFrequency(&liFrequency);
- QueryPerformanceCounter(&liStartTime);
-}
-static void tend(void)
-{
- QueryPerformanceCounter(&liCurrentTime);
-}
-static double tval(void)
-{
- return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart) * (double)1000.0 / (double)liFrequency.QuadPart));
-}
-#else
-#include <sys/time.h>
-static struct timeval _tstart, _tend;
-static struct timezone tz;
-static void tstart(void)
-{
- gettimeofday(&_tstart, &tz);
-}
-static void tend(void)
-{
- gettimeofday(&_tend, &tz);
-}
- #if 0
-static double tval()
-{
- double t1, t2;
- t1 = ( double ) _tstart.tv_sec * 1000 + ( double ) _tstart.tv_usec / (1000);
- t2 = ( double ) _tend.tv_sec * 1000 + ( double ) _tend.tv_usec / (1000);
- return t2 - t1;
-}
- #endif
+#ifdef DEBUG_DRAW_TIME
+# include "PIL_time.h"
#endif
-struct GPUTexture;
-
static int intersect_edges(float *points, float a, float b, float c, float d, float edges[12][2][3])
{
int i;
@@ -275,7 +232,10 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
return;
}
- tstart();
+#ifdef DEBUG_DRAW_TIME
+ TIMEIT_START(draw);
+#endif
+
/* generate flame spectrum texture */
#define SPEC_WIDTH 256
#define FIRE_THRESH 7
@@ -522,8 +482,10 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
n++;
}
- tend();
- // printf ( "Draw Time: %f\n",(float) tval() );
+#ifdef DEBUG_DRAW_TIME
+ printf("Draw Time: %f\n", (float)TIMEIT_VALUE(draw));
+ TIMEIT_END(draw);
+#endif
if (tex_shadow)
GPU_texture_unbind(tex_shadow);