svn 51625 : Some ignores for the .git ppls
authorjh0506.yun <jh0506.yun@samsung.com>
Tue, 5 Oct 2010 06:19:41 +0000 (15:19 +0900)
committerjh0506.yun <jh0506.yun@samsung.com>
Tue, 5 Oct 2010 06:19:41 +0000 (15:19 +0900)
svn 51635 : remove segv in ghl engine with native surfaces if data is null!
svn 51644 : and fail init of gl cleanly again... :)
svn 51646 : Evas textblock: Paired formats (e.g <b> and </b>) are now only deleted if they point to the same place. This makes everything nice and clean.

.gitignore [new file with mode: 0755]
src/lib/canvas/evas_object_textblock.c
src/modules/engines/gl_common/evas_gl_context.c
src/modules/engines/gl_common/evas_gl_image.c
src/modules/engines/gl_common/evas_gl_shader.c
src/modules/engines/gl_common/evas_gl_texture.c
src/modules/engines/gl_x11/evas_engine.c

diff --git a/.gitignore b/.gitignore
new file mode 100755 (executable)
index 0000000..c325b99
--- /dev/null
@@ -0,0 +1,9 @@
+*.o
+*.lo
+*.la
+.libs
+.deps
+*.pc
+Makefile
+Makefile.in
+*.so
index f0596de..402011e 100644 (file)
@@ -444,7 +444,8 @@ static const Evas_Object_Func object_func =
    MAGIC_CHECK_END();
 
 
-
+static void _evas_textblock_node_text_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *n);  
+static void _evas_textblock_node_text_remove_formats_between(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *n, int start, int end);  
 static Evas_Object_Textblock_Node_Format *_evas_textblock_cursor_node_format_before_or_at_pos_get(const Evas_Textblock_Cursor *cur);
 static size_t _evas_textblock_node_format_pos_get(const Evas_Object_Textblock_Node_Format *fmt);
 static Eina_Bool _evas_textblock_format_is_visible(const char *s);
@@ -552,8 +553,7 @@ _nodes_clear(const Evas_Object *obj)
        Evas_Object_Textblock_Node_Text *n;
 
        n = o->text_nodes;
-       o->text_nodes = _NODE_TEXT(eina_inlist_remove(EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(n)));
-        _evas_textblock_node_text_free(n);
+       _evas_textblock_node_text_remove(o, n); 
      }
    while (o->format_nodes)
      {
@@ -4073,18 +4073,18 @@ evas_object_textblock_text_markup_get(const Evas_Object *obj)
  *
  * @param o the text block object.
  * @param to merge into to.
- * @param from merge from from.
  */
 static void
-_evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *to,
-      Evas_Object_Textblock_Node_Text *from)
+_evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *to)
 {
    Evas_Object_Textblock_Node_Format *itr;
    Evas_Object_Textblock_Node_Format *pnode;
+   Evas_Object_Textblock_Node_Text *from;
    const Eina_Unicode *text;
    int to_len, len;
 
-   if (!to || !from) return;
+   if (!to) return;  
+   from = _NODE_TEXT(EINA_INLIST_GET(to)->next);    
 
    to_len = eina_ustrbuf_length_get(to->unicode);
    text = eina_ustrbuf_string_get(from->unicode);
@@ -4098,7 +4098,6 @@ _evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node
         if (pnode && (pnode->text_node == to))
           {
              itr->offset += to_len - _evas_textblock_node_format_pos_get(pnode);
-             itr->offset -= (pnode->visible) ? 1 : 0;
           }
         else
           {
@@ -4117,9 +4116,7 @@ _evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node
      }
 
    _evas_textblock_cursors_set_node(o, from, to);
-   o->text_nodes = _NODE_TEXT(eina_inlist_remove(
-            EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(from)));
-   _evas_textblock_node_text_free(from);
+   _evas_textblock_node_text_remove(o, from); 
 }
 
 /**
@@ -4141,8 +4138,9 @@ _evas_textblock_cursor_nodes_merge(Evas_Textblock_Cursor *cur)
    if (!cur) return;
    o = (Evas_Object_Textblock *)(cur->obj->object_data);
    nnode = _NODE_TEXT(EINA_INLIST_GET(cur->node)->next);
-   _evas_textblock_nodes_merge(o, cur->node, nnode);
-   _evas_textblock_cursors_update_offset(o->cursor, nnode, 0, len);
+   _evas_textblock_nodes_merge(o, cur->node);  
+   _evas_textblock_cursors_update_offset(cur, nnode, 0, len);  
+   _evas_textblock_cursors_set_node(o, nnode, cur->node);      
    if (nnode == o->cursor->node)
      {
         o->cursor->node = cur->node;
@@ -4940,6 +4938,62 @@ _evas_textblock_cursor_node_text_at_format(Evas_Textblock_Cursor *cur, Evas_Obje
    cur->pos = position;
 
 }
+
+/**
+ * @internal
+ * Remove pairs of + and - formats and also remove formats without + or -
+ * i.e formats that pair to themselves
+ *
+ * @param o the textblock object.
+ * @param fmt the current format.
+ */
+static void
+_evas_textblock_node_format_remove_matching(Evas_Object_Textblock *o,
+                     Evas_Object_Textblock_Node_Format *fmt)
+{
+   Evas_Object_Textblock_Node_Text *tnode;
+   Eina_List *formats = NULL;
+   size_t offset;
+   
+   if (!fmt) return;
+   
+   tnode = fmt->text_node;
+   
+   do
+     {
+        Evas_Object_Textblock_Node_Format *nnode;
+       const char *fstr = eina_strbuf_string_get(fmt->format);
+       
+       nnode = _NODE_FORMAT(EINA_INLIST_GET(fmt)->next);
+       if (nnode)
+         {
+            offset = nnode->offset;
+         }
+
+       
+       if (fstr && (*fstr == '+'))
+         {
+            formats = eina_list_prepend(formats, fmt);
+         }
+       else if (fstr && (*fstr == '-'))
+         {
+            Evas_Object_Textblock_Node_Format *fnode;
+            fnode = eina_list_data_get(formats);
+            if (fnode)
+              {
+                 formats = eina_list_remove(formats, fnode);
+                 _evas_textblock_node_format_remove(o, fnode, 0);
+                 _evas_textblock_node_format_remove(o, fmt, 0);
+              }
+         }
+       else
+         {
+            _evas_textblock_node_format_remove(o, fmt, 0);
+         }
+       fmt = nnode;
+     }
+   while (fmt && (offset == 0) && (fmt->text_node == tnode));
+}
 /**
  * @internal
  * Add the offset (may be negative) to the first node after fmt which is
@@ -5000,6 +5054,12 @@ _evas_textblock_node_format_remove(Evas_Object_Textblock *o, Evas_Object_Textblo
              /* If there's no next one update the text nodes */
              nnode = _NODE_FORMAT(EINA_INLIST_GET(n)->prev);
              tnode = n->text_node;
+            /* Even if it's not the current text_node's main node  
+             * it can still be the next's. */  
+            if (tnode && (tnode->format_node != n))  
+              {  
+                 tnode = _NODE_TEXT(EINA_INLIST_GET(tnode)->next);  
+              }                             
              while (tnode && (tnode->format_node == n))
                {
                   tnode->format_node = nnode;
@@ -5016,30 +5076,115 @@ _evas_textblock_node_format_remove(Evas_Object_Textblock *o, Evas_Object_Textblo
 
 /**
  * @internal
- * Removes all the format nodes at a location strating from n.
- * This function updates the offset of the next format node and the
- * text nodes pointing to it.
+ * Sets all the offsets of the format nodes between start and end in the text
+ * node n to 0.
+ * If end == -1 end means the end of the string.
  *
- * @param o the textblock object.
- * @param n the fromat node to remove from.
+ * @param n the text node the positinos refer to.
+ * @param start the start of where to delete from.
+ * @param end the end of the section to delete, if end == -1 it means the end of the string.
+ * @returns #EINA_TRUE if removed a PS, false otherwise.
  */
-static void
-_evas_textblock_node_format_remove_all_at_pos(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Format *n)
+static Eina_Bool
+_evas_textblock_node_text_adjust_offsets_to_start(Evas_Object_Textblock *o,
+      Evas_Object_Textblock_Node_Text *n, size_t start, int end)
 {
-   Evas_Object_Textblock_Node_Format *nnode;
-   Evas_Object_Textblock_Node_Text *tnode;
-
-   nnode = n;
-   tnode = n->text_node;
-   do
+   Evas_Object_Textblock_Node_Format *last_node, *itr;
+   Evas_Object_Textblock_Node_Text *new_node;
+   int use_end = 1;
+   int delta = 0;
+   int first = 1;
+   int update_format_node;
+   size_t pos = 0;
+   
+   itr = n->format_node;
+   if (!itr || (itr->text_node != n)) return EINA_FALSE;
+   
+   if ((end < 0) || ((size_t) end == eina_ustrbuf_length_get(n->unicode)))
      {
-        Evas_Object_Textblock_Node_Format *curnode;
-        curnode = nnode;
-        nnode = _NODE_FORMAT(EINA_INLIST_GET(nnode)->next);
-
-        _evas_textblock_node_format_remove(o, curnode, curnode->visible);
+        use_end = 0;
+     }
+   
+   /* If we are not removing the text node, all should stay in this text
+    * node, otherwise, everything should move to the previous node */
+   if ((start == 0) && !use_end)
+     {
+        new_node = _NODE_TEXT(EINA_INLIST_GET(n)->prev);
+       if (!new_node)
+         {
+            new_node = _NODE_TEXT(EINA_INLIST_GET(n)->next);
+         }
+     }
+   else
+     {
+        new_node = n;
      }
-   while (nnode && (nnode->text_node == tnode) && (nnode->offset == 0));
+   
+   /* Find the first node after start */
+   while (itr && (itr->text_node == n))
+     {
+        pos += itr->offset;
+       if (pos >= start)
+         {
+            break;
+         }
+       itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
+     }
+   
+   if (!itr || (itr->text_node != n))
+     {
+        return EINA_FALSE;
+     }
+   
+   update_format_node = ((itr == n->format_node) && (new_node != n));
+   delta = end - pos;
+   itr->offset -= pos - start;
+   
+   while (itr && (itr->text_node == n))
+     {
+        last_node = itr;
+       itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
+       
+       if (!first)
+         {
+            pos += last_node->offset;
+         }
+       
+       /* start is negative when this gets relevant */
+       if (use_end && (pos > (size_t) end))
+         {
+            last_node->offset -= delta;
+            break;
+         }
+       
+       delta = end - pos;
+       if (!first)
+         {
+            last_node->offset = 0;
+         }
+       else
+         {
+            first = 0;
+         }
+       if (!itr || (itr && (itr->text_node != n)))
+         {
+            /* Remove the PS, and return since it's the end of the node */
+            if (_IS_PARAGRAPH_SEPARATOR(
+                     eina_strbuf_string_get(last_node->format)))
+              {
+                 _evas_textblock_node_format_remove(o, last_node, 0);            
+                 return EINA_TRUE;
+              }
+            
+         }
+       last_node->text_node = new_node;
+       if (update_format_node)
+         {
+            n->format_node = last_node;
+         }
+     }
+   
+   return EINA_FALSE;
 }
 
 /**
@@ -5135,27 +5280,11 @@ _evas_textblock_node_text_get_first_format_between(
 static void
 _evas_textblock_node_text_remove(Evas_Object_Textblock *o, Evas_Object_Textblock_Node_Text *n)
 {
-   Evas_Object_Textblock_Node_Format *fnode;
-   Evas_Object_Textblock_Node_Text *tnode;
-   fnode = n->format_node;
-   /* We want to get the last format node that will exist so if
-    * it's a node to be deleted get the previous one */
-   if (fnode && (fnode->text_node == n))
-     {
-        fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->prev);
-     }
-   /* Update all the text node -> format node links
-    * go through all the text nodes starting from ours and update
-    * all the ones pointing to a format node that belongs to n */
-   tnode = _NODE_TEXT(EINA_INLIST_GET(n)->next);
-   while (tnode && tnode->format_node && (tnode->format_node->text_node = n))
-     {
-        tnode->format_node = fnode;
-        tnode = _NODE_TEXT(EINA_INLIST_GET(tnode)->next);
-     }
-   _evas_textblock_node_text_remove_formats_between(o, n, 0, -1);
+   _evas_textblock_node_text_adjust_offsets_to_start(o, n, 0, -1);
+   
    o->text_nodes = _NODE_TEXT(eina_inlist_remove(
            EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(n)));
+   _evas_textblock_node_text_free(n); 
 }
 
 /**
@@ -5338,9 +5467,11 @@ evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Curs
 /* text controls */
 /**
  * @internal
- * Free a text node.
+ * Free a text node. Shouldn't be used usually, it's better to use  
+ * @ref _evas_textblock_node_text_remove for most cases .    
  *
  * @param n the text node to free
+ * @see _evas_textblock_node_text_remove
  */
 static void
 _evas_textblock_node_text_free(Evas_Object_Textblock_Node_Text *n)
@@ -5879,35 +6010,28 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur)
    /* Remove a format node if needed, and remove the char only if the
     * fmt node is not visible */
      {
-        Evas_Object_Textblock_Node_Format *fmt;
+       Evas_Object_Textblock_Node_Format *fmt, *fmt2;
         fmt = _evas_textblock_cursor_node_format_at_pos_get(cur);
         if (fmt)
           {
              const char *format = NULL;
              Evas_Object_Textblock_Node_Format *itr;
-             itr = fmt;
-             do
+            /* If there's a PS it must be the last become it delimits paragraphs */  
+            itr = _evas_textblock_node_format_last_at_off(fmt);  
+            format = eina_strbuf_string_get(fmt->format);  
+            if (format && _IS_PARAGRAPH_SEPARATOR(format))                
                {
-                  format = eina_strbuf_string_get(fmt->format);
-                  if (format && _IS_PARAGRAPH_SEPARATOR(format))
-                    {
-                       merge_nodes = 1;
-                    }
-                  itr = _NODE_FORMAT(EINA_INLIST_GET(itr)->next);
+                 merge_nodes = 1;
                }
-             while (itr && (itr->text_node == fmt->text_node) &&
-                   (itr->offset == 0));
-             _evas_textblock_node_format_remove_all_at_pos(o, fmt);
-          }
-        /* If the format node is not visible (because visible nodes adjust
-         * automatically when removing them) adjust */
-        if (!evas_textblock_cursor_format_is_visible_get(cur))
-          {
-             fmt = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);
-             fmt = _evas_textblock_node_format_last_at_off(fmt);
-             _evas_textblock_node_format_adjust_offset(o, cur->node, fmt,
-                   -(index - cur->pos));
-          }
+         }
+
+       fmt2 = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur);  
+       fmt2 = _evas_textblock_node_format_last_at_off(fmt2);  
+       _evas_textblock_node_format_adjust_offset(o, cur->node, fmt2,  
+             -(index - cur->pos));  
+          
+       _evas_textblock_node_format_remove_matching(o, fmt);  
+             
      }
    eina_ustrbuf_remove(n->unicode, cur->pos, index);
    /* If it was a paragraph separator, we should merge the current with the
@@ -5943,8 +6067,8 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C
 {
    Evas_Object_Textblock *o;
    Evas_Object_Textblock_Node_Text *n1, *n2, *n;
-   Evas_Object_Textblock_Node_Format *fnode = NULL;
-
+   Eina_Bool should_merge = EINA_FALSE;
+   
    if (!cur1 || !cur1->node) return;
    if (!cur2 || !cur2->node) return;
    if (cur1->obj != cur2->obj) return;
@@ -5961,43 +6085,23 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C
    n2 = cur2->node;
    cur2->pos++; /* Also remove the marked char */
 
-   /* Find the first format node after cur2 */
-   fnode = _evas_textblock_cursor_node_format_before_pos_get(cur2);
-     {
-        if (fnode)
-          {
-             fnode = _evas_textblock_node_format_last_at_off(fnode);
-             Evas_Object_Textblock_Node_Text *tnode;
-             tnode = fnode->text_node;
-             fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
-             if (fnode && (tnode != fnode->text_node))
-               {
-                  fnode = NULL;
-               }
+   if (n1 == n2)  
+     {  
+       eina_ustrbuf_remove(n1->unicode, cur1->pos, cur2->pos);  
+        if ((cur1->pos == 0) && (cur2->pos == eina_ustrbuf_length_get(n1->unicode)))  
+          {  
+             _evas_textblock_node_text_remove_formats_between(o, n1, 0, -1);        
           }
         else
           {
-             fnode = cur2->node->format_node;
-             if (fnode && (cur2->node != fnode->text_node))
-               {
-                  fnode = NULL;
-               }
-          }
-     }
-   if (n1 == n2)
-     {
-        _evas_textblock_node_text_remove_formats_between(o, n1, cur1->pos,
-              cur2->pos);
-        eina_ustrbuf_remove(n1->unicode, cur1->pos, cur2->pos);
-        if (fnode && (fnode->text_node == n1))
-          {
-             fnode->offset -= cur2->pos - cur1->pos;
+            should_merge = _evas_textblock_node_text_adjust_offsets_to_start(o, n1, cur1->pos, cur2->pos);
           }
         _evas_textblock_cursors_update_offset(cur1, cur1->node, cur1->pos, - (cur2->pos - cur1->pos));
      }
    else
      {
         int len;
+       _evas_textblock_node_text_adjust_offsets_to_start(o, n1, cur1->pos, -1); 
         n = _NODE_TEXT(EINA_INLIST_GET(n1)->next);
         /* Remove all the text nodes between */
         while (n && (n != n2))
@@ -6005,25 +6109,27 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C
              Evas_Object_Textblock_Node_Text *nnode;
 
              nnode = _NODE_TEXT(EINA_INLIST_GET(n)->next);
+            _evas_textblock_cursors_set_node(o, n, n1); 
              _evas_textblock_node_text_remove(o, n);
              n = nnode;
           }
+       should_merge = _evas_textblock_node_text_adjust_offsets_to_start(o, n2, 0, cur2->pos); 
 
         /* Remove the formats and the strings in the first and last nodes */
         len = eina_ustrbuf_length_get(n1->unicode);
-        _evas_textblock_node_text_remove_formats_between(o, n1, cur1->pos,
-              len);
-        _evas_textblock_node_text_remove_formats_between(o, n2, 0, cur2->pos);
         eina_ustrbuf_remove(n1->unicode, cur1->pos, len);
         eina_ustrbuf_remove(n2->unicode, 0, cur2->pos);
-        if (fnode && (fnode->text_node == n2))
-          {
-             fnode->offset -= cur2->pos;
-          }
         /* Merge the nodes because we removed the PS */
-        _evas_textblock_nodes_merge(o, n1, n2);
         _evas_textblock_cursors_update_offset(cur1, cur1->node, cur1->pos, - cur1->pos);
         _evas_textblock_cursors_update_offset(cur2, cur2->node, 0, - cur2->pos);
+       _evas_textblock_nodes_merge(o, n1); 
+     }  
+   _evas_textblock_node_format_remove_matching(o,  
+         _evas_textblock_cursor_node_format_at_pos_get(cur1));  
+   
+   if (should_merge)  
+     {  
+        _evas_textblock_nodes_merge(o, n1);                 
      }
    evas_textblock_cursor_copy(cur1, cur2);
    evas_textblock_cursor_copy(cur1, o->cursor);
@@ -7620,3 +7726,25 @@ _evas_object_textblock_rehint(Evas_Object *obj)
  * @}
  */
 
+
+#if 0
+/* Good for debugging */
+void
+pfnode(Evas_Object_Textblock_Node_Format *n)
+{
+   printf("Format Node: %p\n", n);
+   printf("next = %p, prev = %p, last = %p\n", EINA_INLIST_GET(n)->next, EINA_INLIST_GET(n)->prev, EINA_INLIST_GET(n)->last);
+   printf("text_node = %p, offset = %u, visible = %d\n", n->text_node, n->offset, n->visible);
+   printf("%s\n", eina_strbuf_string_get(n->format));
+}
+
+void
+ptnode(Evas_Object_Textblock_Node_Text *n)
+{
+   printf("Text Node: %p\n", n);
+   printf("next = %p, prev = %p, last = %p\n", EINA_INLIST_GET(n)->next, EINA_INLIST_GET(n)->prev, EINA_INLIST_GET(n)->last);
+   printf("format_node = %p\n", n->format_node);
+   printf("%ls\n", eina_ustrbuf_string_get(n->unicode));
+}
+#endif
+
index a46b6e1..f3a4c1d 100644 (file)
@@ -660,13 +660,16 @@ evas_gl_common_context_free(Evas_GL_Context *gc)
    
    if (gc->def_surface) evas_gl_common_image_free(gc->def_surface);
   
-   for (i = 0; i < gc->shared->info.pipes_max; i++)
+   if (gc->shared)
      {
-       if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
-       if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
-       if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
-       if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2);
-       if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
+        for (i = 0; i < gc->shared->info.pipes_max; i++)
+           {
+             if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
+             if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
+             if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
+             if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2);
+             if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
+           }
      }
    
    if ((gc->shared) && (gc->shared->references == 0))
index 83c9641..4a435ba 100644 (file)
@@ -63,17 +63,20 @@ evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, DATA32 *da
    Evas_GL_Image *im;
    Eina_List *l;
 
-   EINA_LIST_FOREACH(gc->shared->images, l, im)
-     {
-       if (((void *)(im->im->image.data) == (void *)data) &&
-           (im->im->cache_entry.w == w) &&
-           (im->im->cache_entry.h == h))
-         {
-            gc->shared->images = eina_list_remove_list(gc->shared->images, l);
-            gc->shared->images = eina_list_prepend(gc->shared->images, im);
-            im->references++;
-            return im;
-         }
+   if (data)
+     {    
+        EINA_LIST_FOREACH(gc->shared->images, l, im)
+          {
+            if (((void *)(im->im->image.data) == (void *)data) &&
+                (im->im->cache_entry.w == w) &&
+                (im->im->cache_entry.h == h))
+              {
+                 gc->shared->images = eina_list_remove_list(gc->shared->images, l);
+                 gc->shared->images = eina_list_prepend(gc->shared->images, im);
+                 im->references++;
+                 return im;
+              }
+          }
      }
    im = calloc(1, sizeof(Evas_GL_Image));
    if (!im) return NULL;
index a2043bf..1f1fe5e 100644 (file)
@@ -441,6 +441,7 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p,
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    glCompileShader(p->vert);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+   ok = 0;
    glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    if (!ok)
@@ -454,6 +455,7 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p,
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    glCompileShader(p->frag);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+   ok = 0;
    glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    if (!ok)
@@ -482,6 +484,7 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p,
    
    glLinkProgram(p->prog);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+   ok = 0;
    glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    if (!ok)
index 92193ef..a9aae2c 100644 (file)
@@ -714,6 +714,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
           }
      }
    if (!tex->pt) return;
+   if (!im->image.data) return;
+
    fmt = tex->pt->format;
    glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
index ded1de4..e5eb5dc 100644 (file)
@@ -837,10 +837,12 @@ eng_image_alpha_set(void *data, void *image, int has_alpha)
    if (im->references > 1)
      {
         Evas_GL_Image *im_new;
-        
-        im_new = evas_gl_common_image_new_from_copied_data(im->gc, im->im->cache_entry.w, im->im->cache_entry.h, im->im->image.data,
-                                                           eng_image_alpha_get(data, image),
-                                                           eng_image_colorspace_get(data, image));
+       
+        im_new = evas_gl_common_image_new_from_copied_data  
+          (im->gc, im->im->cache_entry.w, im->im->cache_entry.h,   
+              im->im->image.data,  
+              eng_image_alpha_get(data, image),  
+               eng_image_colorspace_get(data, image)); 
         if (!im_new) return im;
         evas_gl_common_image_free(im);
         im = im_new;
@@ -1479,9 +1481,11 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
               {
                  Evas_GL_Image *im_new;
 
-                 im_new = evas_gl_common_image_new_from_copied_data(im->gc, im->im->cache_entry.w, im->im->cache_entry.h, im->im->image.data,
-                                                                    eng_image_alpha_get(data, image),
-                                                                    eng_image_colorspace_get(data, image));
+                 im_new = evas_gl_common_image_new_from_copied_data  
+                    (im->gc, im->im->cache_entry.w, im->im->cache_entry.h,  
+                        im->im->image.data,  
+                        eng_image_alpha_get(data, image),  
+                        eng_image_colorspace_get(data, image));    
                  if (!im_new)
                    {
                       *image_data = NULL;