evas/cserve2: Set image->flags.loaded on loaded_handle.
authorantognolli <antognolli@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Jul 2012 15:14:54 +0000 (15:14 +0000)
committerantognolli <antognolli@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Jul 2012 15:14:54 +0000 (15:14 +0000)
The flag and pixel data will be set on this callback, avoiding new
image_load_data() to create a new request or wait for the LOADED
message.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@73999 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/evas_cserve2_requests.c
src/lib/cache2/evas_cache2.c
src/lib/cserve2/evas_cs2_client.c

index 9fd789f..f155a22 100644 (file)
@@ -340,10 +340,15 @@ _slave_read_cb(Slave *s __UNUSED__, Slave_Command cmd, void *msg, void *data)
    if (cmd == ERROR)
      {
         Error_Type *err = msg;
+        WRN("Received error %d from slave, for request type %d.",
+            *err, req->type);
         req->funcs->error(req->data, *err);
      }
    else
-     resp = req->funcs->response(req->data, msg, &resp_size);
+     {
+        DBG("Received response from slave for message type %d.", req->type);
+        resp = req->funcs->response(req->data, msg, &resp_size);
+     }
 
    EINA_LIST_FREE(req->waiters, w)
      {
index a9d9ae2..7fc3b7b 100644 (file)
@@ -777,13 +777,10 @@ evas_cache2_image_load_data(Image_Entry *ie)
      {
         evas_cserve2_image_load_data_wait(ie);
         RGBA_Image *im = (RGBA_Image *)ie;
-        im->image.data = evas_cserve2_image_data_get(ie);
         DBG("try cserve2 image data '%s' '%s' loaded!",
             ie->file, ie->key ? ie->key : "");
         if (im->image.data)
           {
-             im->image.no_free = 1;
-             ie->flags.loaded = EINA_TRUE;
              error = EVAS_LOAD_ERROR_NONE;
           }
         else
index 752c939..df45b0a 100644 (file)
@@ -335,7 +335,7 @@ _image_opened_cb(void *data, const void *msg_received)
 }
 
 static void
-_loaded_handle(Image_Entry *ie, Msg_Loaded *msg)
+_loaded_handle(Image_Entry *ie, const Msg_Loaded *msg)
 {
    Data_Entry *dentry = ie->data2;
    const char *shmpath;
@@ -368,7 +368,13 @@ _loaded_handle(Image_Entry *ie, Msg_Loaded *msg)
      }
 
    if (ie->data2)
-     ie->flags.alpha_sparse = msg->alpha_sparse;
+     {
+        RGBA_Image *im = (RGBA_Image *)ie;
+        im->image.data = evas_cserve2_image_data_get(ie);
+        ie->flags.alpha_sparse = msg->alpha_sparse;
+        ie->flags.loaded = EINA_TRUE;
+        im->image.no_free = 1;
+     }
 }
 
 static void