summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-01-22 23:31:30 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-01-22 23:34:05 +0000
commit68d7f584cb78402dbe884d3a7b902c4735d96f8a (patch)
treead24b0d0a4ef8bd57328f7dc648e393b9993a06a /src/lib/edje
parent97098dcc50b62e51dad3469619ed55242ca01a80 (diff)
edje - store original size in edje struct and dont exceed max size
evas can tell us max texture size. in edje when we have image sets (multiple images that make up mipmaps effectively for a logical image), we now can avoid choosing an image that exceeds max texture size. this actually fixes bugs i have seen on the rpi3 which has a max texture size of 2048 which makes it easy to exceed it with wallpapers or even terminology's default theme. so combo of new feature and fix... but requires a rebuild of the edj files... @feat + @fix
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_calc.c9
-rw-r--r--src/lib/edje/edje_data.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 336bbc00cc..07f25ec02d 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -552,7 +552,7 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps,
552 Edje_Image_Directory_Set_Entry *entry; 552 Edje_Image_Directory_Set_Entry *entry;
553 Edje_Image_Directory_Set *set = NULL; 553 Edje_Image_Directory_Set *set = NULL;
554 Eina_List *l; 554 Eina_List *l;
555 int w = 0, h = 0, id; 555 int w = 0, h = 0, id, maxw = 0, maxh = 0;
556 556
557 if (!st && !imid) return -1; 557 if (!st && !imid) return -1;
558 if (st && !st->image.set) return st->image.id; 558 if (st && !st->image.set) return st->image.id;
@@ -581,8 +581,15 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps,
581 581
582 if (!set) set = ed->file->image_dir->sets + id; 582 if (!set) set = ed->file->image_dir->sets + id;
583 583
584 if (set->entries)
585 evas_image_max_size_get(evas_object_evas_get(obj), &maxw, &maxh);
584 EINA_LIST_FOREACH(set->entries, l, entry) 586 EINA_LIST_FOREACH(set->entries, l, entry)
585 { 587 {
588 // skip images that exceed max size
589 if ((maxw > 0) && (maxh > 0) &&
590 (entry->size.w > 0) && (entry->size.h > 0) &&
591 ((w > entry->size.w) || (h > entry->size.h)))
592 continue;
586 if ((entry->size.min.w <= w) && (w <= entry->size.max.w)) 593 if ((entry->size.min.w <= w) && (w <= entry->size.max.w))
587 { 594 {
588 if ((entry->size.min.h <= h) && (h <= entry->size.max.h)) 595 if ((entry->size.min.h <= h) && (h <= entry->size.max.h))
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index ca9cbf11ad..daa4a01ac7 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -399,6 +399,8 @@ _edje_edd_init(void)
399 eet_data_descriptor_file_new(&eddc); 399 eet_data_descriptor_file_new(&eddc);
400 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "name", name, EET_T_STRING); 400 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "name", name, EET_T_STRING);
401 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "id", id, EET_T_INT); 401 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "id", id, EET_T_INT);
402 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "w", size.w, EET_T_INT);
403 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "h", size.h, EET_T_INT);
402 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.w", size.min.w, EET_T_INT); 404 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.w", size.min.w, EET_T_INT);
403 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.h", size.min.h, EET_T_INT); 405 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.h", size.min.h, EET_T_INT);
404 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "max.w", size.max.w, EET_T_INT); 406 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "max.w", size.max.w, EET_T_INT);