forked from enlightenment/efl
parent
00c661adab
commit
c689865500
|
@ -1375,7 +1375,6 @@ evas_cache_image_unload_data(Image_Entry *im)
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
evas_common_rgba_image_scalecache_dirty(im);
|
|
||||||
cache->func.destructor(im);
|
cache->func.destructor(im);
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
|
|
|
@ -58,7 +58,7 @@ _evas_preload_thread_end(Evas_Preload_Pthread_Data *pth)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_preload_thread_done(void *target, Evas_Callback_Type type, void *event_info)
|
_evas_preload_thread_done(void *target __UNUSED__, Evas_Callback_Type type __UNUSED__, void *event_info)
|
||||||
{
|
{
|
||||||
Evas_Preload_Pthread_Worker *work;
|
Evas_Preload_Pthread_Worker *work;
|
||||||
|
|
||||||
|
|
|
@ -178,9 +178,9 @@ _evas_render_cur_clip_cache_del(Evas *e, Evas_Object *obj)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_render_phase1_direct(Evas *e,
|
_evas_render_phase1_direct(Evas *e,
|
||||||
Eina_Array *active_objects,
|
Eina_Array *active_objects __UNUSED__,
|
||||||
Eina_Array *restack_objects,
|
Eina_Array *restack_objects __UNUSED__,
|
||||||
Eina_Array *delete_objects,
|
Eina_Array *delete_objects __UNUSED__,
|
||||||
Eina_Array *render_objects)
|
Eina_Array *render_objects)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -1338,6 +1338,8 @@ evas_sync(Evas *e)
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
evas_common_frameq_flush ();
|
evas_common_frameq_flush ();
|
||||||
|
#else
|
||||||
|
(void) e;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -291,6 +291,7 @@ static void
|
||||||
_evas_common_rgba_image_unload(Image_Entry *im)
|
_evas_common_rgba_image_unload(Image_Entry *im)
|
||||||
{
|
{
|
||||||
// printf("unload: [%p] %s %s\n", im, im->file, im->key);
|
// printf("unload: [%p] %s %s\n", im, im->file, im->key);
|
||||||
|
evas_common_rgba_image_scalecache_dirty(im);
|
||||||
evas_common_rgba_image_unload(im);
|
evas_common_rgba_image_unload(im);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,15 @@ read_short(FILE *file, short *ret)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
read_ushort(FILE *file, unsigned short *ret)
|
||||||
|
{
|
||||||
|
unsigned char b[2];
|
||||||
|
if (fread(b, sizeof(unsigned char), 2, file) != 2) return 0;
|
||||||
|
*ret = (b[1] << 8) | b[0];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
read_int(FILE *file, int *ret)
|
read_int(FILE *file, int *ret)
|
||||||
{
|
{
|
||||||
|
@ -43,17 +52,26 @@ read_int(FILE *file, int *ret)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
read_uint(FILE *file, unsigned int *ret)
|
||||||
|
{
|
||||||
|
unsigned char b[4];
|
||||||
|
if (fread(b, sizeof(unsigned char), 4, file) != 4) return 0;
|
||||||
|
*ret = ARGB_JOIN(b[3], b[2], b[1], b[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error)
|
evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
unsigned char buf[4096];
|
char buf[4096];
|
||||||
char hasa = 0;
|
char hasa = 0;
|
||||||
int w = 0, h = 0, planes = 0, bit_count = 0,
|
int w = 0, h = 0, planes = 0, bit_count = 0,
|
||||||
image_size = 0, comp = 0, hdpi = 0, vdpi = 0,
|
image_size = 0, comp = 0, hdpi = 0, vdpi = 0,
|
||||||
palette_size = -1, important_colors = 0, rowlen = 0;
|
palette_size = -1, important_colors = 0;
|
||||||
unsigned int offset, head_size, rmask = 0, gmask = 0, bmask = 0, amask = 0;
|
unsigned int offset, head_size, rmask = 0, gmask = 0, bmask = 0, amask = 0;
|
||||||
unsigned int *pal = NULL, pal_num = 0;
|
unsigned int pal_num = 0;
|
||||||
int right_way_up = 0;
|
int right_way_up = 0;
|
||||||
int fsize = 0;
|
int fsize = 0;
|
||||||
unsigned int bmpsize;
|
unsigned int bmpsize;
|
||||||
|
@ -75,11 +93,11 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
if (fread(buf, 2, 1, f) != 1) goto close_file;
|
if (fread(buf, 2, 1, f) != 1) goto close_file;
|
||||||
if (strncmp(buf, "BM", 2)) goto close_file; // magic number
|
if (strncmp(buf, "BM", 2)) goto close_file; // magic number
|
||||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||||
if (!read_int(f, &bmpsize)) goto close_file;
|
if (!read_uint(f, &bmpsize)) goto close_file;
|
||||||
if (!read_short(f, &res1)) goto close_file;
|
if (!read_ushort(f, &res1)) goto close_file;
|
||||||
if (!read_short(f, &res2)) goto close_file;
|
if (!read_ushort(f, &res2)) goto close_file;
|
||||||
if (!read_int(f, &offset)) goto close_file;
|
if (!read_uint(f, &offset)) goto close_file;
|
||||||
if (!read_int(f, &head_size)) goto close_file;
|
if (!read_uint(f, &head_size)) goto close_file;
|
||||||
if (head_size == 12) // OS/2 V1 + Windows 3.0
|
if (head_size == 12) // OS/2 V1 + Windows 3.0
|
||||||
{
|
{
|
||||||
short tmp;
|
short tmp;
|
||||||
|
@ -246,8 +264,6 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
|
|
||||||
if (bit_count < 16)
|
if (bit_count < 16)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
if ((palette_size < 0) || (palette_size > 256)) pal_num = 256;
|
if ((palette_size < 0) || (palette_size > 256)) pal_num = 256;
|
||||||
else pal_num = palette_size;
|
else pal_num = palette_size;
|
||||||
if (bit_count == 1)
|
if (bit_count == 1)
|
||||||
|
@ -318,11 +334,12 @@ static Eina_Bool
|
||||||
evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error)
|
evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
unsigned char buf[4096], *buffer = NULL, *buffer_end = NULL, *p;
|
char buf[4096];
|
||||||
|
unsigned char *buffer = NULL, *buffer_end = NULL, *p;
|
||||||
char hasa = 0;
|
char hasa = 0;
|
||||||
int x = 0, y = 0, w = 0, h = 0, planes = 0, bit_count = 0, image_size = 0,
|
int x = 0, y = 0, w = 0, h = 0, planes = 0, bit_count = 0, image_size = 0,
|
||||||
comp = 0, hdpi = 0, vdpi = 0, palette_size = -1, important_colors = 0,
|
comp = 0, hdpi = 0, vdpi = 0, palette_size = -1, important_colors = 0;
|
||||||
offset = 0, head_size = 0;
|
unsigned int offset = 0, head_size = 0;
|
||||||
unsigned int *pal = NULL, pal_num = 0, *pix = NULL, *surface = NULL, fix,
|
unsigned int *pal = NULL, pal_num = 0, *pix = NULL, *surface = NULL, fix,
|
||||||
rmask = 0, gmask = 0, bmask = 0, amask = 0;
|
rmask = 0, gmask = 0, bmask = 0, amask = 0;
|
||||||
int right_way_up = 0;
|
int right_way_up = 0;
|
||||||
|
@ -347,11 +364,11 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
if (fread(buf, 2, 1, f) != 1) goto close_file;
|
if (fread(buf, 2, 1, f) != 1) goto close_file;
|
||||||
if (strncmp(buf, "BM", 2)) goto close_file; // magic number
|
if (strncmp(buf, "BM", 2)) goto close_file; // magic number
|
||||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||||
if (!read_int(f, &bmpsize)) goto close_file;
|
if (!read_uint(f, &bmpsize)) goto close_file;
|
||||||
if (!read_short(f, &res1)) goto close_file;
|
if (!read_ushort(f, &res1)) goto close_file;
|
||||||
if (!read_short(f, &res2)) goto close_file;
|
if (!read_ushort(f, &res2)) goto close_file;
|
||||||
if (!read_int(f, &offset)) goto close_file;
|
if (!read_uint(f, &offset)) goto close_file;
|
||||||
if (!read_int(f, &head_size)) goto close_file;
|
if (!read_uint(f, &head_size)) goto close_file;
|
||||||
image_size = fsize - offset;
|
image_size = fsize - offset;
|
||||||
if (image_size < 1) goto close_file;
|
if (image_size < 1) goto close_file;
|
||||||
|
|
||||||
|
@ -533,7 +550,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
|
|
||||||
if (bit_count < 16)
|
if (bit_count < 16)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (bit_count == 1)
|
if (bit_count == 1)
|
||||||
{
|
{
|
||||||
|
@ -958,9 +975,9 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
}
|
}
|
||||||
else if (comp == 3) // bit field
|
else if (comp == 3) // bit field
|
||||||
{
|
{
|
||||||
if (!read_int(f, &rmask)) goto close_file;
|
if (!read_uint(f, &rmask)) goto close_file;
|
||||||
if (!read_int(f, &gmask)) goto close_file;
|
if (!read_uint(f, &gmask)) goto close_file;
|
||||||
if (!read_int(f, &bmask)) goto close_file;
|
if (!read_uint(f, &bmask)) goto close_file;
|
||||||
|
|
||||||
fseek(f, offset, SEEK_SET);
|
fseek(f, offset, SEEK_SET);
|
||||||
buffer = malloc(image_size + 8); // add 8 for padding to avoid checks
|
buffer = malloc(image_size + 8); // add 8 for padding to avoid checks
|
||||||
|
@ -1088,7 +1105,7 @@ module_open(Evas_Module *em)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
module_close(Evas_Module *em)
|
module_close(__UNUSED__ Evas_Module *em)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue