sync with private
authorChunEon Park <chuneon.park@samsung.com>
Mon, 27 Aug 2012 07:22:54 +0000 (16:22 +0900)
committerChunEon Park <chuneon.park@samsung.com>
Mon, 27 Aug 2012 07:23:29 +0000 (16:23 +0900)
Change-Id: Ia3d8e9a82db01342168e04fdf3521ab696a68abf

packaging/evas.spec
src/lib/canvas/evas_object_image.c
src/lib/canvas/evas_object_main.c
src/lib/canvas/evas_object_textblock.c
src/lib/canvas/evas_render.c
src/lib/include/evas_private.h
src/modules/engines/gl_x11/evas_x_main.c
src/modules/loaders/jpeg/evas_image_load_jpeg.c

index 31a047e..8ede30e 100755 (executable)
@@ -1,7 +1,7 @@
 #sbs-git:slp/pkgs/e/evas evas 1.1.0+svn.69113slp2+build01 828d8bb285397266eb8985fd081fa2692fa3a7d6
 Name:       evas
 Summary:    Multi-platform Canvas Library
-Version:    1.6.0+svn.74704slp2+build04
+Version:    1.6.0+svn.74704slp2+build13
 Release:    1
 Group:      System/Libraries
 License:    BSD
index c55e1e8..bae0809 100755 (executable)
@@ -447,36 +447,34 @@ evas_object_image_source_set(Evas_Object *obj, Evas_Object *src)
    return EINA_FALSE;
    MAGIC_CHECK_END();
 
-   if (obj->delete_me)
+   if (obj->delete_me && src)
      {
-        CRIT("Setting deleted object %p as image source %p", src, obj);
-        abort();
+        WRN("Setting deleted object %p as image source %p", src, obj);
         return EINA_FALSE;
      }
-   if (src->delete_me)
-     {
-        CRIT("Setting object %p to deleted image source %p", src, obj);
-        abort();
-        return EINA_FALSE;
-     }
-   if (!src->layer)
-     {
-        CRIT("No evas surface associated with source object (%p)", obj);
-        abort();
-        return EINA_FALSE;
-     }
-   if ((obj->layer && src->layer) &&
-       (obj->layer->evas != src->layer->evas))
-     {
-        CRIT("Setting object %p from Evas (%p) from another Evas (%p)", src, src->layer->evas, obj->layer->evas);
-        abort();
-        return EINA_FALSE;
-     }
-   if (src == obj)
+   if (src)
      {
-        CRIT("Setting object %p as a source for itself", obj);
-        abort();
-        return EINA_FALSE;
+        if (src->delete_me)
+          {
+             WRN("Setting object %p to deleted image source %p", src, obj);
+             return EINA_FALSE;
+          }
+        if (!src->layer)
+          {
+             CRIT("No evas surface associated with source object (%p)", obj);
+             return EINA_FALSE;
+          }
+        if ((obj->layer && src->layer) &&
+            (obj->layer->evas != src->layer->evas))
+          {
+             CRIT("Setting object %p from Evas (%p) from another Evas (%p)", src, src->layer->evas, obj->layer->evas);
+             return EINA_FALSE;
+          }
+        if (src == obj)
+          {
+             CRIT("Setting object %p as a source for itself", obj);
+             return EINA_FALSE;
+          }
      }
    if (o->cur.source == src) return EINA_TRUE;
 
@@ -485,10 +483,8 @@ evas_object_image_source_set(Evas_Object *obj, Evas_Object *src)
    if (o->cur.file || o->cur.key)
       evas_object_image_file_set(obj, NULL, NULL);
 
-   if (src)
-     {
-        _proxy_set(obj, src);
-     }
+   if (src) _proxy_set(obj, src);
+   else _proxy_unset(obj);
 
    return EINA_TRUE;
 }
index c7e9aed..2fa7748 100644 (file)
@@ -43,6 +43,9 @@ evas_object_change_reset(Evas_Object *obj)
 void
 evas_object_cur_prev(Evas_Object *obj)
 {
+   if (!obj->prev.valid_map && (obj->prev.map == obj->cur.map))
+     obj->prev.map = NULL;
+
    if (obj->cur.map != obj->prev.map)
      {
         if (obj->cache_map) evas_map_free(obj->cache_map);
index 0426bf3..804d5c9 100644 (file)
@@ -6133,16 +6133,10 @@ evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur)
 
    i = cur->pos;
 
-   /* Skip the first one. This ensures we don't point to the nul, and also
-    * we just don't care about it anyway. */
-   if (i > 0) i--;
-
    for ( ; i > 0 ; i--)
      {
-        if (BREAK_AFTER(i))
+        if (BREAK_AFTER(i - 1))
           {
-             /* Advance to the current char */
-             i++;
              break;
           }
      }
@@ -6194,7 +6188,7 @@ evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur)
 #ifdef HAVE_LINEBREAK
    free(breaks);
 #endif
-   return EINA_TRUE;;
+   return EINA_TRUE;
 }
 
 EAPI Eina_Bool
index 78ab7d2..29941a0 100644 (file)
@@ -917,6 +917,11 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
              evas_object_change_reset(obj);
           }
 
+        /* mark the old map as invalid, so later we don't reuse it as a
+         * cache. */
+        if (changed && obj->prev.map)
+           obj->prev.valid_map = EINA_FALSE;
+
         // clear surface before re-render
         if ((changed) && (obj->cur.map->surface))
           {
@@ -988,6 +993,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
              obj->cur.map->surface = e->engine.func->image_dirty_region
                 (e->engine.data.output, obj->cur.map->surface,
                  0, 0, obj->cur.map->surface_w, obj->cur.map->surface_h);
+             obj->cur.valid_map = EINA_TRUE;
           }
         e->engine.func->context_clip_unset(e->engine.data.output,
                                            context);
index ad6785a..fc3033f 100644 (file)
@@ -533,6 +533,7 @@ struct _Evas_Object
          unsigned char      r, g, b, a;
       } color;
       Eina_Bool             usemap : 1;
+      Eina_Bool             valid_map : 1;
       Eina_Bool             visible : 1;
       Eina_Bool             have_clipees : 1;
       Eina_Bool             anti_alias : 1;
index 852a603..9c8a9f5 100644 (file)
@@ -234,6 +234,11 @@ eng_window_new(Display *disp,
         if (strstr((const char *)renderer, "Software Rasterizer"))
           blacklist = 1;
      }
+   //Temporary Code for Tizen Emulator. With this driver, mapbuf would not
+   //work correctly some kind of the reason.
+   else if (strstr((const char *)vendor, "Huone Inc."))
+     blacklist = 1;
+
    if (strstr((const char *)renderer, "softpipe"))
      blacklist = 1;
    if (blacklist)
index cf17af6..b7ed636 100644 (file)
@@ -25,6 +25,9 @@ struct _JPEG_error_mgr
 static void _JPEGFatalErrorHandler(j_common_ptr cinfo);
 static void _JPEGErrorHandler(j_common_ptr cinfo);
 static void _JPEGErrorHandler2(j_common_ptr cinfo, int msg_level);
+static int _get_orientation_app0(char *app0_head, size_t remain_length);
+static int _get_orientation_app1(char *app1_head, size_t remain_length);
+static int _get_orientation(void *map, size_t length);
 
 static Eina_Bool evas_image_load_file_head_jpeg_internal(Image_Entry *ie,
                                                          void *map,
@@ -161,8 +164,11 @@ _evas_jpeg_membuf_src(j_decompress_ptr cinfo,
    return 0;
 }
 
-/*! Magic number for EXIF header & App1*/
+/*! Magic number for EXIF header, App0, App1*/
 static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
+static const unsigned char JfifHeader[] = {0x4A, 0x46, 0x49, 0x46, 0x00};
+static const unsigned char JfxxHeader[] = {0x4A, 0x46, 0x58, 0x58, 0x00};
+static const unsigned char App0[] = {0xff, 0xe0};
 static const unsigned char App1[] = {0xff, 0xe1};
 typedef enum {
      EXIF_BYTE_ALIGN_II,
@@ -170,7 +176,48 @@ typedef enum {
 } ExifByteAlign;
 
 static int
-_get_orientation(void *map, size_t length)
+_get_orientation_app0(char *app0_head, size_t remain_length)
+{
+   unsigned int length = 0;
+   unsigned int w = 0, h = 0;
+   unsigned int format = 0;
+   unsigned int data_size = 0;
+   char *p;
+
+   /* p is appn's start pointer excluding app0 marker */
+   p = app0_head + 2;
+
+
+   length = ((*p << 8) + *(p + 1));
+
+   /* JFIF segment format */
+   if (!memcmp(p + 2, JfifHeader, sizeof (JfifHeader)))
+     {
+        format = 3;
+        w = *(p + 14);
+        h = *(p + 15);
+     }
+   else if (!memcmp(p + 2, JfxxHeader, sizeof (JfxxHeader)))
+     {
+        if (*(p + 7) == 0x11)
+          format = 1;
+        else
+          format = 3;
+        w = *(p + 8);
+        h = *(p + 9);
+     }
+
+     data_size = format * w * h;
+     p += length + data_size;
+
+     if (!memcmp(p, App1, sizeof (App1)))
+       return _get_orientation_app1(p, remain_length - (2 + length + data_size));
+     else
+       return 0;
+}
+
+static int
+_get_orientation_app1(char *app1_head, size_t remain_length)
 {
    char *buf;
    char orientation[2];
@@ -179,39 +226,33 @@ _get_orientation(void *map, size_t length)
    unsigned int i, j;
    int direction;
 
-   /* open file and get 22 byte frome file */
-   if (!map) return 0;
-   /* 1. read 22byte */
-   if (length < 22) return 0;
-   buf = (char *)map;
-
-   /* 2. check 2,3 bypte with APP1(0xFFE1) */
-   if (memcmp(buf + 2, App1, sizeof (App1))) return 0;
+   /* start of app1 frame */
+   buf = app1_head;
 
-   /* 3. check 6~11bype with Exif Header (0x45786966 0000) */
-   if (memcmp(buf + 6, ExifHeader, sizeof (ExifHeader))) return 0;
+   /* 1. check 4~9bype with Exif Header (0x45786966 0000) */
+   if (memcmp(buf + 4, ExifHeader, sizeof (ExifHeader))) return 0;
 
-   /* 4. get 12&13 byte  get info of "II(0x4949)" or "MM(0x4d4d)" */
-   /* 5. get [20]&[21] get directory entry # */
-   if (!strncmp(buf + 12, "MM", 2))
+   /* 2. get 10&11 byte  get info of "II(0x4949)" or "MM(0x4d4d)" */
+   /* 3. get [18]&[19] get directory entry # */
+   if (!strncmp(buf + 10, "MM", 2))
      {
         byte_align = EXIF_BYTE_ALIGN_MM;
-        num_directory = ((*(buf + 20) << 8) + *(buf + 21));
+        num_directory = ((*(buf + 18) << 8) + *(buf + 19));
         orientation[0] = 0x01;
         orientation[1] = 0x12;
      }
-   else if (!strncmp(buf + 12, "II", 2))
+   else if (!strncmp(buf + 10, "II", 2))
      {
         byte_align = EXIF_BYTE_ALIGN_II;
-        num_directory = ((*(buf + 21) << 8) + *(buf + 20));
+        num_directory = ((*(buf + 19) << 8) + *(buf + 18));
         orientation[0] = 0x12;
         orientation[1] = 0x01;
      }
    else return 0;
 
-   buf = map + 22;
+   buf = app1_head + 20;
 
-   if (length < (12 * num_directory + 22)) return 0;
+   if (remain_length < (12 * num_directory + 20)) return 0;
 
    j = 0;
 
@@ -221,7 +262,7 @@ _get_orientation(void *map, size_t length)
           {
              /*get orientation tag */
              if (byte_align == EXIF_BYTE_ALIGN_MM)
-               direction = *(buf+ j + 11);
+              direction = *(buf+ j + 9);
              else direction = *(buf+ j + 8);
              switch (direction)
                {
@@ -244,6 +285,25 @@ _get_orientation(void *map, size_t length)
    return 0;
 }
 
+static int
+_get_orientation(void *map, size_t length)
+{
+   char *buf;
+
+   /* open file and get 22 byte frome file */
+   if (!map) return 0;
+   /* 1. read 22byte */
+   if (length < 22) return 0;
+   buf = (char *)map;
+
+   /* 2. check 2,3 bypte with APP0(0xFFE0) or APP1(0xFFE1) */
+   if (!memcmp(buf + 2, App0, sizeof (App0)))
+      return _get_orientation_app0(buf + 2, length - 2);
+   if (!memcmp(buf + 2, App1, sizeof (App1)))
+      return _get_orientation_app1(buf + 2, length - 2);
+   return 0;
+}
+
 static Eina_Bool
 evas_image_load_file_head_jpeg_internal(Image_Entry *ie,
                                         void *map, size_t length,