evas: initalize orient property in file_set() 75/136175/2
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 28 Jun 2017 06:13:00 +0000 (15:13 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Thu, 29 Jun 2017 00:36:49 +0000 (00:36 +0000)
    Summary:
    Someone calls evas_object_image_file_set() and set orient,
    and then re-set another file.
    At that time, there is a mismatch between Evas_Image_Data's
    cur->orient and engine's orient data.

    So, "file_set(a) -> orient_set(90) -> file_set(b) -> orient_set(90)"
    is not working now.

    Therefore, when a file_set() is finished, initialization is needed.

Change-Id: Icb0b393773f14b24949ad33188253e84669bd21c

src/lib/evas/canvas/evas_object_image.c

index cafe04a..39c36c9 100644 (file)
@@ -498,12 +498,14 @@ _image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
      {
         int w, h;
         int stride;
+        Evas_Image_Orient orient;
 
         ENFN->image_size_get(ENDT, o->engine_data, &w, &h);
         if (ENFN->image_stride_get)
           ENFN->image_stride_get(ENDT, o->engine_data, &stride);
         else
           stride = w * 4;
+        orient = ENFN->image_orient_get(ENDT, o->engine_data);
 
         EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
           {
@@ -516,6 +518,7 @@ _image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
              state_write->image.w = w;
              state_write->image.h = h;
              state_write->image.stride = stride;
+             state_write->orient = orient;
           }
         EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
      }
@@ -535,6 +538,7 @@ _image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
              state_write->image.w = 0;
              state_write->image.h = 0;
              state_write->image.stride = 0;
+             state_write->orient = EVAS_IMAGE_ORIENT_NONE;
           }
         EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
      }