aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2005-10-19 11:07:00 +0000
committerlecoanet2005-10-19 11:07:00 +0000
commit9011f0c80a33c658c81cdbb44d8e9c5e3fe6822e (patch)
tree494d81c9436aa484230d41b29f1b4143e5d1dc32 /generic
parent740d6c7d3a81e1416c2827531efa6a226ef42500 (diff)
downloadtkzinc-9011f0c80a33c658c81cdbb44d8e9c5e3fe6822e.zip
tkzinc-9011f0c80a33c658c81cdbb44d8e9c5e3fe6822e.tar.gz
tkzinc-9011f0c80a33c658c81cdbb44d8e9c5e3fe6822e.tar.bz2
tkzinc-9011f0c80a33c658c81cdbb44d8e9c5e3fe6822e.tar.xz
Added some code to do high precision timing in the main drawing function
Repair(). Tkzinc now test whether the tagOrIdOrTransform given to translate is not the empty string (cf zinc-anim and D Etienne).
Diffstat (limited to 'generic')
-rw-r--r--generic/tkZinc.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index 99018d7..6e8cabb 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -6123,7 +6123,12 @@ WidgetObjCmd(ClientData client_data, /* Information about the widget.
ZnBool abs = False;
if ((argc != 5) && (argc != 6)) {
- Tcl_WrongNumArgs(interp, 1, args, "translate tagOrIdorTransform xAmount yAmount ?abs?");
+ Tcl_WrongNumArgs(interp, 1, args, "translate tagOrIdOrTransform xAmount yAmount ?abs?");
+ goto error;
+ }
+ str = Tcl_GetString(args[2]);
+ if (strlen(str) == 0) {
+ Tcl_AppendResult(interp, " must provide a valid tagOrIdOrTransform", NULL);
goto error;
}
entry = Tcl_FindHashEntry(wi->t_table, Tcl_GetString(args[2]));
@@ -8319,6 +8324,16 @@ Update(ZnWInfo *wi)
*
**********************************************************************************
*/
+#if defined (_WIN32)
+#define START \
+ QueryPerformanceCounter(&start)
+
+#define STOP_PRINT(text) \
+ QueryPerformanceCounter(&stop); \
+ printf(text##" : %g ms\n", \
+ ((double) (stop.QuadPart - start.QuadPart)) * 1000.0 / ((double) sw_freq.QuadPart))
+#endif
+
static void
Repair(ZnWInfo *wi)
{
@@ -8332,7 +8347,10 @@ Repair(ZnWInfo *wi)
#endif
int int_width = Tk_Width(wi->win);
int int_height = Tk_Height(wi->win);
-
+ //LARGE_INTEGER start, stop, sw_freq;
+
+ //QueryPerformanceFrequency(&sw_freq);
+ //START;
/*SET(wi->flags, ZN_CONFIGURE_EVENT);*/
if (wi->render) {
#ifdef GL
@@ -8524,12 +8542,14 @@ Repair(ZnWInfo *wi)
}
ZnGLReleaseContext(ce);
+ //STOP_PRINT("Total GL");
#endif
}
else {
XRectangle r, rs[4];
ZnBBox merge;
+ //START;
ClampDamageArea(wi);
/*
m * Merge the damaged area with the exposed area.
@@ -8642,6 +8662,7 @@ m * Merge the damaged area with the exposed area.
rs[3].height = int_height;
XFillRectangles(wi->dpy, Tk_WindowId(wi->win), wi->gc, rs, 4);
}
+ //STOP_PRINT("Total GDI");
}
}