change dump API from tdm_helper to tbm_surface_internal
[platform/core/uifw/libtdm.git] / src / tdm_helper.c
index 5887986..d85d412 100644 (file)
@@ -31,6 +31,17 @@ tdm_helper_get_time_in_millis(void)
        return 0;
 }
 
+INTERN unsigned long
+tdm_helper_get_time_in_micros(void)
+{
+       struct timespec tp;
+
+       if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+               return (tp.tv_sec * 1000000) + (tp.tv_nsec / 1000L);
+
+       return 0;
+}
+
 static void
 _tdm_helper_dump_raw(const char *file, void *data1, int size1, void *data2,
                      int size2, void *data3, int size3)
@@ -251,8 +262,8 @@ tdm_helper_dump_start(char *dumppath, int *count)
                return;
        }
 
-       if (dumppath == NULL) {
-               TDM_DBG("tdm_helper_dump dumppath is null.");
+       if (dumppath == NULL || count == NULL) {
+               TDM_DBG("tdm_helper_dump dumppath or count is null.");
                return;
        }
 
@@ -275,19 +286,3 @@ tdm_helper_dump_stop(void)
        TDM_DBG("tdm_helper_dump stop.");
 }
 
-INTERN int
-tdm_helper_get_dump_count(void)
-{
-       if ((tdm_helper_dump_count != NULL) && (tdm_helper_dump_path != NULL)) {
-               if (*tdm_helper_dump_count == 1000)
-                       *tdm_helper_dump_count = 1;
-               return (*tdm_helper_dump_count)++;
-       } else
-               return 0;
-}
-
-INTERN char *
-tdm_helper_get_dump_path(void)
-{
-       return tdm_helper_dump_path;
-}