static pthread_mutex_t gLock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t tbm_bufmgr_lock = PTHREAD_MUTEX_INITIALIZER;
static __thread tbm_error_e tbm_last_error = TBM_ERROR_NONE;
-
+static double scale_factor = 0;
static void _tbm_bufmgr_mutex_unlock(void);
//#define TBM_BUFMGR_INIT_TIME
_tbm_bufmgr_mutex_unlock();
}
+void
+tbm_bufmgr_debug_dump_set_scale(double scale)
+{
+ pthread_mutex_lock(&gLock);
+ scale_factor = scale;
+ pthread_mutex_unlock(&gLock);
+}
+
int
tbm_bufmgr_debug_queue_dump(char *path, int count, int onoff)
{
return 0;
}
- tbm_surface_internal_dump_start(path, w, h, count);
+ tbm_surface_internal_dump_with_scale_start(path, w, h, count, scale_factor);
+ scale_factor = 0;
+
b_dump_queue = 1;
}
return 1;
}
- tbm_surface_internal_dump_start(path, w, h, count);
+ tbm_surface_internal_dump_with_scale_start(path, w, h, count, scale_factor);
+ scale_factor = 0;
LIST_FOR_EACH_ENTRY(surface, &gBufMgr->surf_list, item_link)
tbm_surface_internal_dump_buffer(surface, "dump_all");
*/
int tbm_bufmgr_debug_queue_dump(char *path, int count, int onoff);
+/**
+ * @brief Set scale factor for the nearest calling tbm_bufmgr_debug_dump_all() or tbm_bufmgr_debug_queue_dump()
+ * @since_tizen 3.0
+ * @param[in] scale : the scale factor, 0 - disable scaling
+ * @par Example
+ @code
+ #include <tbm_bufmgr.h>
+
+ // Dump all surface with scale factor 0.5
+ tbm_bufmgr_debug_dump_set_scale(0.5);
+ tbm_bufmgr_debug_dump_all("/tmp/");
+
+ // Start the dump debugging for queue with scale factor 0.5
+ tbm_bufmgr_debug_dump_set_scale(0.2);
+ tbm_bufmgr_debug_queue_dump("/tmp/", 10, 1);
+
+ @endcode
+ */
+void tbm_bufmgr_debug_dump_set_scale(double scale);
+
int tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *NativeDisplay);
#ifdef __cplusplus
void
tbm_surface_internal_dump_with_scale_start(char *path, int w, int h, int count, double scale)
{
- TBM_RETURN_IF_FAIL(scale > 0.0);
-
- tbm_surface_internal_dump_start(path, (int)(scale * w), (int)(scale * h), count);
+ if (scale > 0.0) {
+ w *= scale;
+ h *= scale;
+ }
+ tbm_surface_internal_dump_start(path, w, h, count);
scale_factor = scale;
}