elementary - backport 81207 & 81206
authorChunEon Park <hermet@hermet.pe.kr>
Tue, 18 Dec 2012 07:16:33 +0000 (07:16 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Tue, 18 Dec 2012 07:16:33 +0000 (07:16 +0000)
SVN revision: 81210

ChangeLog
NEWS
src/lib/elm_image.c
src/lib/elm_transit.c

index 0030e2b7600b6a7b541c3a6399bb486943551b93..41b9d5cfaa220b6c4e93b816df688e18cc93bc4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2012-12-17  Chueon Park (Hermet)
 
-       * Makes naviframe safety even if someone deletes the naviframe in transition finished cb.
\ No newline at end of file
+       * Makes naviframe safety even if someone deletes the naviframe in transition finished cb.
+
+2012-12-18  Chueon Park (Hermet)
+
+       * Don't Elm_transit image animation use image preloading to avoid image flickering.
+
+2012-12-18  Chueon Park (Hermet)
+
+       * Let image update right now if the image preloading is disabled.
\ No newline at end of file
diff --git a/NEWS b/NEWS
index de52aa5ee267792ab30fbf93de2948e5d3f8ef7d..22090b301c0a8bfe252ad90663ed63fe9619fc56 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Fixes:
    * Now, dummy object is always smart member of naviframe.
    * Fix the popup that returned invalid action buttons.
    * Fix the naviframe to not have crash even if user deletes the naviframe in the transition finished cb.
+   * Fix Don't elm_transit image animation use the image preloading to avoid image flickering.
+   * Fix the image to show the image right now if the image preloading is disabled.
 
 
 Elementary 1.7.3
index 4631ad1019b1f6298bcf155c10684d45452acf98..e280ff5fc279f03e1100f9ece2bf38ef9cf05d8a 100644 (file)
@@ -899,10 +899,20 @@ _elm_image_smart_preload_set(Evas_Object *obj,
 {
    ELM_IMAGE_DATA_GET(obj, sd);
 
-   if (sd->edje) return;
+   if (sd->edje || !sd->preloading) return;
 
    evas_object_image_preload(sd->img, disable);
    sd->preloading = !disable;
+
+   if (disable)
+     {
+        if (sd->show && sd->img) evas_object_show(sd->img);
+        if (sd->prev_img)
+          {
+             evas_object_del(sd->prev_img);
+             sd->prev_img = NULL;
+          }
+     }
 }
 
 static void
index e8d1c120db3cb9135c36fd0f2ad412929b8f3d79..04787d8586b3e6b66a993361234fbcd823c24225 100644 (file)
@@ -2283,6 +2283,7 @@ typedef struct _Elm_Transit_Effect_Image_Animation Elm_Transit_Effect_Image_Anim
 struct _Elm_Transit_Effect_Image_Animation
 {
    Eina_List *images;
+   unsigned int prev_idx;
 };
 
 static void
@@ -2310,26 +2311,39 @@ _transit_effect_image_animation_op(Elm_Transit_Effect *effect, Elm_Transit *tran
    EINA_SAFETY_ON_NULL_RETURN(transit);
    Eina_List *elist;
    Evas_Object *obj;
-   const char *type;
+   const char *type, *type_deprecated;
    Elm_Transit_Effect_Image_Animation *image_animation = effect;
-   unsigned int count = 0;
+   unsigned int idx = 0;
    int len;
 
-   type = eina_stringshare_add("elm_icon");
+   type = eina_stringshare_add("elm_image");
+   //FIXME: Remove later when elm_icon is cleared.
+   type_deprecated = eina_stringshare_add("elm_icon");
+
    len = eina_list_count(image_animation->images);
    if (len)
      {
-        count = floor(progress * len);
-        EINA_LIST_FOREACH(transit->objs, elist, obj)
+        idx = floor(progress * len);
+        if (image_animation->prev_idx != idx)
           {
-             if (elm_widget_type_check(obj, type, __func__))
-               elm_image_file_set(obj,
-                                  eina_list_nth(image_animation->images, count),
-                                  NULL);
+             EINA_LIST_FOREACH(transit->objs, elist, obj)
+               {
+                  if (elm_widget_type_check(obj, type, __func__) ||
+                      elm_widget_type_check(obj, type_deprecated, __func__))
+                    {
+                       const char *file = eina_list_nth(image_animation->images,
+                                                        idx);
+
+                       elm_image_file_set(obj, file, NULL);
+                       elm_image_preload_disabled_set(obj, EINA_TRUE);
+                    }
+               }
           }
+        image_animation->prev_idx = idx;
      }
 
    eina_stringshare_del(type);
+   eina_stringshare_del(type_deprecated);
 }
 
 static Elm_Transit_Effect *
@@ -2340,6 +2354,7 @@ _transit_effect_image_animation_context_new(Eina_List *images)
 
    if (!image_animation) return NULL;
    image_animation->images = images;
+   image_animation->prev_idx = -1;
    return image_animation;
 }