cedric pushed a commit to branch master.
commit 7c7c2310152e5421b454729548b1af49b67826e4
Author: Jean-Philippe Andre <[email protected]>
Date: Wed Jul 3 16:56:47 2013 +0900
evas/cserve2: simplify more
Remove Image_Load_Opts and use Evas_Image_Load_Opts for cs2 master to
slave communication.
2 things to note:
- The struct size is bigger (but at the same time we removed a memcpy)
- The scale_load field is not passed to the slave
---
src/bin/evas/evas_cserve2.h | 12 +-----------
src/bin/evas/evas_cserve2_cache.c | 7 +++----
src/bin/evas/evas_cserve2_slave.c | 25 ++-----------------------
3 files changed, 6 insertions(+), 38 deletions(-)
diff --git a/src/bin/evas/evas_cserve2.h b/src/bin/evas/evas_cserve2.h
index 52232f0..7708919 100644
--- a/src/bin/evas/evas_cserve2.h
+++ b/src/bin/evas/evas_cserve2.h
@@ -59,16 +59,6 @@ struct _Client {
typedef struct _Client Client;
-struct _Image_Load_Opts {
- unsigned int w, h;
- unsigned int rx, ry, rw, rh;
- unsigned int scale_down_by;
- double dpi;
- Eina_Bool orientation;
-};
-
-typedef struct _Image_Load_Opts Image_Load_Opts;
-
typedef enum {
IMAGE_OPEN,
IMAGE_LOAD,
@@ -100,7 +90,7 @@ struct _Slave_Msg_Image_Opened {
struct _Slave_Msg_Image_Load {
int w, h;
- Image_Load_Opts opts;
+ Evas_Image_Load_Opts opts;
struct {
int mmap_offset;
int image_offset;
diff --git a/src/bin/evas/evas_cserve2_cache.c
b/src/bin/evas/evas_cserve2_cache.c
index 21e5ecf..ae9903c 100644
--- a/src/bin/evas/evas_cserve2_cache.c
+++ b/src/bin/evas/evas_cserve2_cache.c
@@ -447,12 +447,11 @@ _load_request_build(Image_Data *i, int *bufsize)
msg.w = i->file->w;
msg.h = i->file->h;
msg.alpha = i->file->alpha;
+
+ // NOTE: Not passing scale_load options
msg.opts.w = i->opts.w;
msg.opts.h = i->opts.h;
- msg.opts.rx = i->opts.region.x;
- msg.opts.ry = i->opts.region.y;
- msg.opts.rw = i->opts.region.w;
- msg.opts.rh = i->opts.region.h;
+ msg.opts.region = i->opts.region;
msg.opts.scale_down_by = i->opts.scale_down_by;
msg.opts.dpi = i->opts.dpi;
msg.opts.orientation = i->opts.orientation;
diff --git a/src/bin/evas/evas_cserve2_slave.c
b/src/bin/evas/evas_cserve2_slave.c
index a5391e4..a5a407b 100644
--- a/src/bin/evas/evas_cserve2_slave.c
+++ b/src/bin/evas/evas_cserve2_slave.c
@@ -239,25 +239,6 @@ _cserve2_shm_unmap(void *map, size_t length)
munmap(map, length);
}
-static void
-_image_load_opts_copy(Evas_Image_Load_Opts *load_opts, Image_Load_Opts *opts)
-{
- memset(load_opts, 0, sizeof (Evas_Image_Load_Opts));
- if (opts)
- {
- load_opts->w = opts->w;
- load_opts->h = opts->h;
- load_opts->dpi = opts->dpi;
- load_opts->region.x = opts->rx;
- load_opts->region.y = opts->ry;
- load_opts->region.w = opts->rw;
- load_opts->region.h = opts->rh;
- load_opts->orientation = opts->orientation;
- load_opts->scale_down_by = opts->scale_down_by;
- }
- // Not set here: struct load_opts.scale_load
-}
-
static void *
_image_file_open(Eina_File *fd, Eina_Stringshare *key, Evas_Image_Load_Opts
*load_opts,
Evas_Module *module, Evas_Image_Property *property,
@@ -423,8 +404,7 @@ image_load(const char *file, const char *key, const char
*shmfile,
Evas_Module *module;
Eina_File *fd;
Evas_Image_Load_Func *funcs = NULL;
- Image_Load_Opts *opts = ¶ms->opts;
- Evas_Image_Load_Opts load_opts;
+ Evas_Image_Load_Opts *opts = ¶ms->opts;
Evas_Image_Property property;
Evas_Image_Animated animated;
Error_Type ret = CSERVE2_GENERIC;
@@ -460,8 +440,7 @@ image_load(const char *file, const char *key, const char
*shmfile,
property.h = params->h;
skey = eina_stringshare_add(key);
- _image_load_opts_copy(&load_opts, opts);
- loader_data = _image_file_open(fd, skey, &load_opts, module, &property,
&animated, &funcs);
+ loader_data = _image_file_open(fd, skey, opts, module, &property,
&animated, &funcs);
if (!loader_data)
{
printf("LOAD failed at %s:%d: could not open image %s:%s\n",
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev