From 5869ae04196ffeb3be8ad8380cb6fef3ed7f4fba Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 29 Nov 2009 15:01:00 +0000 Subject: Update texture information in the treemodel --- src/texture.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/texture.c b/src/texture.c index 255db9c..a9ba987 100644 --- a/src/texture.c +++ b/src/texture.c @@ -434,7 +434,8 @@ static gboolean texture_action_read_info(struct rbug_event *e, struct rbug_proto_texture_info_reply *info; struct texture_action_read *action; uint32_t serial = 0; - char info_string[128]; + char info_short_string[64]; + char info_long_string[128]; GdkPixbuf *buf = NULL; info = (struct rbug_proto_texture_info_reply *)header; @@ -486,13 +487,13 @@ static gboolean texture_action_read_info(struct rbug_event *e, } + snprintf(info_short_string, 64, "%ux%ux%u", info->width[0], info->height[0], info->depth[0]); + snprintf(info_long_string, 128, "%s (%ux%ux%u) %u", pf_name(info->format), info->width[0], info->height[0], info->depth[0], info->last_level); - gtk_tree_store_set(p->main.treestore, &action->iter, COLUMN_PIXBUF, buf, -1); - snprintf(info_string, 128, "%ux%ux%u", info->width[0], info->height[0], info->depth[0]); - gtk_tree_store_set(p->main.treestore, &action->iter, COLUMN_INFO_SHORT, info_string, -1); - snprintf(info_string, 128, "%s (%ux%ux%u) %u", pf_name(info->format), info->width[0], info->height[0], info->depth[0], info->last_level); - gtk_tree_store_set(p->main.treestore, &action->iter, COLUMN_INFO_LONG, info_string + 12, -1); - + gtk_tree_store_set(p->main.treestore, &action->iter, + COLUMN_PIXBUF, buf, + COLUMN_INFO_SHORT, info_short_string, + COLUMN_INFO_LONG, info_long_string, -1); /* no longer interested in this action */ if (!action->running || p->texture.read != action) @@ -607,9 +608,14 @@ static gboolean texture_action_list_list(struct rbug_event *e, COLUMN_ID, list->textures[i], COLUMN_TYPE, TYPE_TEXTURE, COLUMN_TYPENAME, "texture", + COLUMN_INFO_SHORT, "(?x?x?) ?", + COLUMN_INFO_LONG, "PIPE_FORMAT_UNKNOWN (?x?x?) ?", -1); - +#if 1 texture_start_read_action(list->textures[i], &iter, p); +#else + (void)p; +#endif } g_free(action); -- cgit v1.2.3