summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-04-16 03:54:53 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-04-16 03:54:53 +0100
commitaef36c6e5b580e70a8a85c343e4e766acb91d44a (patch)
treea04e02f216c81d4d7000a36e66192b2ebaac4ed3 /src
parent0c0d2c33bcfb71f748eaf7620da9006c6409d72d (diff)
edje_cc - dont try strip images that are unused at all
my previous disable didnt disable all the unused image stripping. this now does. this code is buggy especially with image sets, to remove it and let the warnings to the job for those compiling themes.
Diffstat (limited to 'src')
-rw-r--r--src/bin/edje/edje_cc_handlers.c1
-rw-r--r--src/bin/edje/edje_cc_out.c30
2 files changed, 23 insertions, 8 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 0ced3e3308..4377204b69 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -2494,6 +2494,7 @@ st_images_set_image_image(void)
2494 set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1; 2494 set = edje_file->image_dir->sets + edje_file->image_dir->sets_count - 1;
2495 entry = eina_list_data_get(eina_list_last(set->entries)); 2495 entry = eina_list_data_get(eina_list_last(set->entries));
2496 2496
2497 entry->id = 0;
2497 /* Add the image to the global pool with the same syntax. */ 2498 /* Add the image to the global pool with the same syntax. */
2498 st_images_image(); 2499 st_images_image();
2499 2500
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index c2bfb82fd1..b7a1a1d729 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -1469,8 +1469,18 @@ data_image_sets_init(void)
1469 if (!set->entries) continue; 1469 if (!set->entries) continue;
1470 EINA_LIST_FOREACH(set->entries, ll, set_entry) 1470 EINA_LIST_FOREACH(set->entries, ll, set_entry)
1471 { 1471 {
1472 img = &edje_file->image_dir->entries[set_entry->id]; 1472 if (set_entry->id < (int)edje_file->image_dir->entries_count)
1473 set_entry->name = img->entry; 1473 {
1474 img = &edje_file->image_dir->entries[set_entry->id];
1475 set_entry->name = img->entry;
1476 }
1477 else
1478 {
1479 ERR("set %i / %i, entry %i / %i\n",
1480 i, edje_file->image_dir->sets_count,
1481 set_entry->id, edje_file->image_dir->entries_count);
1482 abort();
1483 }
1474 } 1484 }
1475 } 1485 }
1476} 1486}
@@ -3606,6 +3616,7 @@ _data_image_sets_size_set(void)
3606 } 3616 }
3607} 3617}
3608 3618
3619/*
3609static void 3620static void
3610_data_image_id_update(Eina_List *images_unused_list) 3621_data_image_id_update(Eina_List *images_unused_list)
3611{ 3622{
@@ -3676,6 +3687,7 @@ _data_image_id_update(Eina_List *images_unused_list)
3676 } 3687 }
3677 } 3688 }
3678} 3689}
3690 */
3679 3691
3680void 3692void
3681data_process_lookups(void) 3693data_process_lookups(void)
@@ -3691,7 +3703,7 @@ data_process_lookups(void)
3691 Eina_Hash *images_in_use; 3703 Eina_Hash *images_in_use;
3692 char *group_name; 3704 char *group_name;
3693 Eina_Bool is_lua = EINA_FALSE; 3705 Eina_Bool is_lua = EINA_FALSE;
3694 Image_Unused_Ids *iui; 3706// Image_Unused_Ids *iui;
3695 3707
3696 /* remove all unreferenced Edje_Part_Collection */ 3708 /* remove all unreferenced Edje_Part_Collection */
3697 EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc) 3709 EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc)
@@ -4013,10 +4025,10 @@ free_group:
4013 4025
4014 if (edje_file->image_dir && !is_lua) 4026 if (edje_file->image_dir && !is_lua)
4015 { 4027 {
4016 Edje_Image_Directory_Entry *de, *de_last, *img; 4028 Edje_Image_Directory_Entry *de/*, *de_last, *img*/;
4017 Edje_Image_Directory_Set *set; 4029 Edje_Image_Directory_Set *set;
4018 Edje_Image_Directory_Set_Entry *set_e; 4030 Edje_Image_Directory_Set_Entry *set_e;
4019 Eina_List *images_unused_list = NULL; 4031// Eina_List *images_unused_list = NULL;
4020 unsigned int i; 4032 unsigned int i;
4021 4033
4022 for (i = 0; i < edje_file->image_dir->entries_count; ++i) 4034 for (i = 0; i < edje_file->image_dir->entries_count; ++i)
@@ -4032,6 +4044,7 @@ free_group:
4032 4044
4033 // so as not to write the unused images, moved last image in the 4045 // so as not to write the unused images, moved last image in the
4034 // list to unused image position and check it 4046 // list to unused image position and check it
4047/*
4035 free((void *)de->entry); 4048 free((void *)de->entry);
4036 de->entry = NULL; 4049 de->entry = NULL;
4037 de_last = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1; 4050 de_last = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
@@ -4046,6 +4059,7 @@ free_group:
4046 img = realloc(edje_file->image_dir->entries, 4059 img = realloc(edje_file->image_dir->entries,
4047 sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count); 4060 sizeof (Edje_Image_Directory_Entry) * edje_file->image_dir->entries_count);
4048 edje_file->image_dir->entries = img; 4061 edje_file->image_dir->entries = img;
4062 */
4049 } 4063 }
4050 4064
4051 for (i = 0; i < edje_file->image_dir->sets_count; ++i) 4065 for (i = 0; i < edje_file->image_dir->sets_count; ++i)
@@ -4091,9 +4105,9 @@ free_group:
4091 } 4105 }
4092 4106
4093 /* update image id in parts */ 4107 /* update image id in parts */
4094 if (images_unused_list) _data_image_id_update(images_unused_list); 4108// if (images_unused_list) _data_image_id_update(images_unused_list);
4095 EINA_LIST_FREE(images_unused_list, iui) 4109// EINA_LIST_FREE(images_unused_list, iui)
4096 free(iui); 4110// free(iui);
4097 4111
4098 _data_image_sets_size_set(); 4112 _data_image_sets_size_set();
4099 } 4113 }