add format strings at the name of png dump. 95/145395/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 22 Aug 2017 07:41:34 +0000 (16:41 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 22 Aug 2017 07:43:14 +0000 (16:43 +0900)
Change-Id: I843497597270cfce77893eb0dde48de8c3c92f2d

src/tbm_surface_internal.c

index 896d649..3633d73 100644 (file)
@@ -1989,6 +1989,7 @@ tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type)
        tbm_surface_info_s info;
        tbm_bo_handle bo_handle;
        const char *postfix;
+       const char *format;
        char *keys;
        int ret;
 
@@ -2047,9 +2048,10 @@ tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type)
                memcpy(&buf_info->info, &info, sizeof(tbm_surface_info_s));
        }
 
-       if (info.format == TBM_FORMAT_ARGB8888 || info.format == TBM_FORMAT_XRGB8888)
+       if (info.format == TBM_FORMAT_ARGB8888 || info.format == TBM_FORMAT_XRGB8888) {
                postfix = dump_postfix[0];
-       else
+               format = _tbm_surface_internal_format_to_str(info.format);
+       } else
                postfix = dump_postfix[1];
 
        keys = _tbm_surface_internal_get_keys(surface);
@@ -2073,9 +2075,9 @@ tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type)
        case TBM_FORMAT_ARGB8888:
        case TBM_FORMAT_XRGB8888:
                snprintf(buf_info->name, sizeof(buf_info->name),
-                               "%10.3f_%03d%s_%p-%s.%s",
+                               "%10.3f_%03d%s_%p_%s-%s.%s",
                                 _tbm_surface_internal_get_time(),
-                                g_dump_info->count++, keys, surface, type, postfix);
+                                g_dump_info->count++, keys, surface, format, type, postfix);
 
                if (scale_factor > 0.0) {
                        ret = _tbm_surface_internal_buffer_scale(info.planes[0].ptr,