void cserve2_cache_client_del(Client *client);
int cserve2_cache_file_open(Client *client, unsigned int client_file_id, const char *path, const char *key, unsigned int rid, Evas_Image_Load_Opts *lo);
void cserve2_cache_file_close(Client *client, unsigned int client_file_id);
-int cserve2_cache_image_entry_create(Client *client, int rid, unsigned int client_file_id, unsigned int image_id, Evas_Image_Load_Opts *opts);
+int cserve2_cache_image_entry_create(Client *client, int rid, unsigned int client_file_id, unsigned int image_id, const Evas_Image_Load_Opts *opts);
void cserve2_rgba_image_scale_do(void *src_data, int src_full_w, int src_full_h, void *dst_data, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int alpha, int smooth);
void cserve2_cache_image_load(Client *client, unsigned int client_image_id, unsigned int rid);
void cserve2_cache_image_preload(Client *client, unsigned int client_image_id, unsigned int rid);
_image_key_set(unsigned int file_id, const Evas_Image_Load_Opts *opts,
char *buf, int size)
{
- const char empty[sizeof(Evas_Image_Load_Opts)] = {0};
-
if (!opts)
- opts = (Evas_Image_Load_Opts *) ∅
+ opts = &empty_lo;
snprintf(buf, size,
"%u:%0.3f:%dx%d:%d:%d,%d+%dx%d:!([%d,%d:%dx%d]-[%dx%d:%d]):%d:%d",
}
static unsigned int
-_image_opts_id_get(unsigned int file_id, Evas_Image_Load_Opts *opts,
+_image_opts_id_get(unsigned int file_id, const Evas_Image_Load_Opts *opts,
char *buf, int size)
{
uintptr_t image_id;
static Image_Entry *
_image_entry_new(Client *client, int rid,
unsigned int client_file_id, unsigned int client_image_id,
- Evas_Image_Load_Opts *opts, char *buf, size_t buf_size)
+ const Evas_Image_Load_Opts *opts, char *buf, size_t buf_size)
{
Reference *ref, *oldref;
Image_Entry *ientry;
cserve2_cache_image_entry_create(Client *client, int rid,
unsigned int client_file_id,
unsigned int client_image_id,
- Evas_Image_Load_Opts *opts)
+ const Evas_Image_Load_Opts *opts)
{
Image_Data *idata;
Image_Entry *ientry;
unsigned int image_id = 0;
char buf[4096];
+ if (!opts)
+ opts = &empty_lo;
+
// search whether the image is already loaded by another client
ref = eina_hash_find(client->files.referencing, &client_file_id);
- if (ref && opts)
+ if (ref)
image_id = _image_opts_id_get(ref->entry->id, opts, buf, sizeof(buf));
if (image_id)