Merge remote-tracking branch 'origin/upstream' into intefl/svn_merge
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 1 Aug 2012 08:11:26 +0000 (17:11 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 1 Aug 2012 08:11:26 +0000 (17:11 +0900)
Conflicts:
.gitignore
ChangeLog
src/lib/Evas_GL.h
src/lib/canvas/evas_gl.c
src/lib/canvas/evas_map.c
src/lib/canvas/evas_object_image.c
src/lib/canvas/evas_object_main.c
src/lib/canvas/evas_object_smart.c
src/lib/canvas/evas_render.c
src/lib/include/evas_private.h
src/modules/engines/gl_common/evas_gl_common.h
src/modules/engines/gl_common/evas_gl_texture.c
src/modules/engines/gl_x11/evas_engine.c
src/modules/loaders/gif/evas_image_load_gif.c

15 files changed:
1  2 
.gitignore
src/lib/Evas_GL.h
src/lib/cache/evas_cache_image.c
src/lib/canvas/evas_map.c
src/lib/canvas/evas_object_image.c
src/lib/canvas/evas_render.c
src/lib/engines/common/evas_draw_main.c
src/lib/engines/common/evas_font_ot.c
src/lib/engines/common/evas_image_main.c
src/lib/engines/common/evas_scale_sample.c
src/modules/engines/gl_common/evas_gl_context.c
src/modules/engines/gl_common/evas_gl_texture.c
src/modules/engines/gl_x11/evas_engine.c
src/modules/engines/gl_x11/evas_x_main.c
src/modules/engines/software_generic/evas_engine.c

diff --cc .gitignore
index f7cc2d4,542535f..b46dd18
mode 100755,100644..100755
@@@ -45,22 -51,21 +51,40 @@@ src/bin/dummy_slav
  *.gcov
  src/tests/evas_suite
  coverage
 +/config.guess.cdbs-orig
 +/config.sub.cdbs-orig
 +/debian/files
 +/debian/*.debhelper.log
 +/debian/*.substvars
 +/debian/libevas-dbg/
 +/debian/libevas-dev/
 +/debian/libevas-doc/
 +/debian/*.debhelper
 +/debian/libevas-engines-extras/
 +/debian/libevas-engines/
 +/debian/libevas/
 +/debian/stamp-*
 +/debian/tmp/
 +/doc/html/
 +/doc/latex/
 +/doc/man/
 +/*-doc.tar.bz2
 +/*-doc.tar.bz2.cdbs-config_list
+ src/examples/aspect.edj
+ src/examples/evas-smart-object
+ src/examples/evas-stacking
+ src/examples/evas_aspect_hints
+ src/examples/evas_box
+ src/examples/evas_buffer_simple
+ src/examples/evas_events
+ src/examples/evas_hints
+ src/examples/evas_images
+ src/examples/evas_images2
+ src/examples/evas_images3
+ src/examples/evas_init_shutdown
+ src/examples/evas_map_utils
+ src/examples/evas_object_manipulation
+ src/examples/evas_smart_object
+ src/examples/evas_stacking
+ src/examples/evas_text
Simple merge
@@@ -40,39 -40,32 +40,33 @@@ _evas_map_calc_map_geometry(Evas_Objec
  
     // WARN: Do not merge below code to SLP until it is fixed.
     // It has an infinite loop bug.
 +#if 0
     if (obj->prev.map)
       {
-         // FIXME: this causes an infinite loop somewhere... hard to debug
-         if (obj->prev.map->count == obj->cur.map->count)
+         if (obj->prev.map != obj->cur.map)
            {
-              const Evas_Map_Point *p2;
+              // FIXME: this causes an infinite loop somewhere... hard to debug
+              if (obj->prev.map->count == obj->cur.map->count)
+                {
+                   const Evas_Map_Point *p2;
  
-              p = obj->cur.map->points;
-              p_end = p + obj->cur.map->count;
-              p2 = obj->prev.map->points;
+                   p = obj->cur.map->points;
+                   p2 = obj->prev.map->points;
  
-              for (; p < p_end; p++, p2++)
-                {
-                   if ((p->a != p2->a) ||
-                       (p->r != p2->r) ||
-                       (p->g != p2->g) ||
-                       (p->b != p2->b))
-                     {
-                        ch = 1;
-                        break;
-                     }
-                   if ((p->x != p2->x) ||
-                       (p->y != p2->y) ||
-                       (p->z != p2->z))
+                   ch = memcmp(p, p2,
+                               sizeof (Evas_Map_Point) * obj->prev.map->count);
+                   ch = !!ch;
+                   if (!ch)
                      {
-                        ch = 1;
-                        break;
+                        if (obj->cache_map) evas_map_free(obj->cache_map); 
+                        obj->cache_map = obj->cur.map;
+                        obj->cur.map = obj->prev.map;
                      }
                 }
+              else
+                ch = 1;
            }
-         else
-            ch = 1;
       }
     else
        ch = 1;
Simple merge
Simple merge
index 0e4a644,78cc98c..1cc6bf1
mode 100755,100644..100755
@@@ -3246,92 -3331,97 +3334,146 @@@ _set_internal_config(Render_Engine *re
     return 1;
  }
  
- static void
- _create_rt_buffers(Render_Engine *data __UNUSED__,
-                    Render_Engine_GL_Surface *sfc)
+ static int
+ _attach_fbo_surface(Render_Engine *data __UNUSED__,
+                     Render_Engine_GL_Surface *sfc,
+                     int fbo)
  {
-    // Render Target texture
-    if (sfc->rt_fmt)
-      {
-         glGenTextures(1, &sfc->rt_tex);
-      }
+    int fb_status, curr_tex, curr_rb;
  
-    // First check if packed buffer is to be used.
-    if (sfc->rb_depth_stencil_fmt)
-      {
+    glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+    // Detach any previously attached buffers
+    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
  #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
-         glGenTextures(1, &sfc->rb_depth_stencil);
+    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
+    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
  #else
-         glGenRenderbuffers(1, &sfc->rb_depth_stencil);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
  #endif
-         return;
-      }
  
-    // Depth RenderBuffer - Create storage here...
-    if (sfc->rb_depth_fmt)
-       glGenRenderbuffers(1, &sfc->rb_depth);
  
-    // Stencil RenderBuffer - Create Storage here...
-    if (sfc->rb_stencil_fmt)
-       glGenRenderbuffers(1, &sfc->rb_stencil);
- }
+    // Render Target Texture
+    if (sfc->rt_tex)
+      {
+         curr_tex = 0;
+         glGetIntegerv(GL_TEXTURE_BINDING_2D, &curr_tex);
+         glBindTexture(GL_TEXTURE_2D, sfc->rt_tex );
+         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+         glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sfc->w, sfc->h, 0,
+                      GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+         glBindTexture(GL_TEXTURE_2D, curr_tex);
  
- static int
- _attach_fbo_surface(Render_Engine *data __UNUSED__,
-                     Render_Engine_GL_Surface *sfc,
-                     Render_Engine_GL_Context *ctx)
- {
-    int fb_status;
+         // Attach texture to FBO
+         if (sfc->rt_msaa_samples)
+            glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, 
+                                                    GL_COLOR_ATTACHMENT0, 
+                                                    GL_TEXTURE_2D, sfc->rt_tex, 
+                                                    0, sfc->rt_msaa_samples);
+         else
+            glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+                                   GL_TEXTURE_2D, sfc->rt_tex, 0);
+      }
  
++<<<<<<< HEAD
 +   glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo);
 +
 +   // Render Target Texture
 +   if (sfc->rt_tex)
 +     {
 +        glBindTexture(GL_TEXTURE_2D, sfc->rt_tex );
++=======
+    // Depth Stencil RenderBuffer - Attach it to FBO
+    if (sfc->rb_depth_stencil)
+      {
+ #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+         curr_tex = 0;
+         glGetIntegerv(GL_TEXTURE_BINDING_2D, &curr_tex);
+         glBindTexture(GL_TEXTURE_2D, sfc->rb_depth_stencil);
++>>>>>>> origin/upstream
 +        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 +        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 +        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 +        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
++<<<<<<< HEAD
 +        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sfc->w, sfc->h, 0,
 +                     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 +        glBindTexture(GL_TEXTURE_2D, 0);
 +
 +        // Attach texture to FBO
 +        if (sfc->rt_msaa_samples)
 +           glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sfc->rt_tex, 0, sfc->rt_msaa_samples);
 +        else
 +           glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
 +                                  GL_TEXTURE_2D, sfc->rt_tex, 0);
 +     }
 +
 +
 +
 +
 +   // Depth Stencil RenderBuffer - Attach it to FBO
 +   if (sfc->rb_depth_stencil)
 +     {
 +#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
 +        glBindTexture(GL_TEXTURE_2D, sfc->rb_depth_stencil);
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
          glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, sfc->w, sfc->h,
                       0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL);
 +        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
 +                               GL_TEXTURE_2D, sfc->rb_depth_stencil, 0);
 +        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
 +                               GL_TEXTURE_2D, sfc->rb_depth_stencil, 0);
 +        glBindTexture(GL_TEXTURE_2D, 0);
 +
 +#else
++=======
++        glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, sfc->w, sfc->h,
++                     0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL);
+         if (sfc->rt_msaa_samples)
+           {
+              glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, 
+                                                      GL_DEPTH_ATTACHMENT,
+                                                      GL_TEXTURE_2D, 
+                                                      sfc->rb_depth_stencil, 
+                                                      0, sfc->rt_msaa_samples);
+              glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, 
+                                                      GL_STENCIL_ATTACHMENT,
+                                                      GL_TEXTURE_2D, 
+                                                      sfc->rb_depth_stencil, 
+                                                      0, sfc->rt_msaa_samples);
+           }
+         else
+           {
+              glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+                                     GL_TEXTURE_2D, sfc->rb_depth_stencil, 0);
+              glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+                                     GL_TEXTURE_2D, sfc->rb_depth_stencil, 0);
+           }
+         glBindTexture(GL_TEXTURE_2D, curr_tex);
+ #else
+         curr_rb = 0;
+         glGetIntegerv(GL_RENDERBUFFER_BINDING, &curr_rb);
++>>>>>>> origin/upstream
          glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_depth_stencil);
          glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_depth_stencil_fmt,
                                sfc->w, sfc->h);
          glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
                                    GL_RENDERBUFFER, sfc->rb_depth_stencil);
++<<<<<<< HEAD
 +        glBindRenderbuffer(GL_RENDERBUFFER, 0);
++=======
+         glBindRenderbuffer(GL_RENDERBUFFER, curr_rb);
++>>>>>>> origin/upstream
  #endif
       }
  
@@@ -3445,27 -3602,35 +3654,57 @@@ eng_gl_surface_create(void *data, void 
       {
          ERR("xxxMakeCurrent() finish!");
          goto finish;
++<<<<<<< HEAD
++=======
+      }
+    // Set the engine surface capability first if it hasn't been set
+    if (!re->gl_cap_initted) _set_gl_surface_cap(re);
+    // Check the size of the surface
+    if ( (w > re->gl_cap.max_rb_size) || (h > re->gl_cap.max_rb_size) )
+      {
+         ERR("Surface size greater than the supported size. Max Surface Size: %d", re->gl_cap.max_rb_size);
+         goto finish;
+      }
+    // Set the internal config value
+    if (!_set_internal_config(re, sfc, cfg))
+      {
+         ERR("Unsupported Format!");
+         goto finish;
++>>>>>>> origin/upstream
       }
  
 -   // Create Render texture
 -   if (!_create_rt_buffers(re, sfc))
 +   // Set the engine surface capability first if it hasn't been set
 +   if (!re->gl_cap_initted) _set_gl_surface_cap(re);
 +
 +   // Check the size of the surface
 +   if ( (w > re->gl_cap.max_rb_size) || (h > re->gl_cap.max_rb_size) )
       {
++<<<<<<< HEAD
 +        ERR("Surface size greater than the supported size. Max Surface Size: %d", re->gl_cap.max_rb_size);
 +        goto finish;
 +     }
++=======
+         ERR("Unable Create Specificed Surfaces.  Unsupported format!");
+         goto finish;
+      };
+    ret = sfc;
+ finish:
++>>>>>>> origin/upstream
 +
 +   // Set the internal config value
 +   if (!_set_internal_config(re, sfc, cfg))
 +     {
 +        ERR("Unsupported Format!");
 +        goto finish;
 +     }
 +
 +   // Create Render texture
 +   _create_rt_buffers(re, sfc);
  
  #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
     res = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
  #endif
     if (!res)
       {
++<<<<<<< HEAD
 +        ERR("xxxMakeCurrent() finish!");
 +        goto finish;
 +     }
 +
 +   ret = sfc;
 +
 +finish:
 +
++=======
+         ERR("xxxMakeCurrent() (NULL, NULL) Error!");
+      }
++>>>>>>> origin/upstream
     if (!ret)
       {
          if (sfc) free(sfc);
@@@ -3806,10 -3966,10 +4051,17 @@@ eng_gl_make_current(void *data __UNUSED
                   (eglGetCurrentSurface(EGL_READ) != re->win->egl_surface[0]) ||
                   (eglGetCurrentSurface(EGL_DRAW) != re->win->egl_surface[0]) )
                 {
++<<<<<<< HEAD
++
++                  // Flush remainder of what's in Evas' pipeline
++                  eng_window_use(NULL);
++
++=======
  
                    // Flush remainder of what's in Evas' pipeline
                    eng_window_use(NULL);
  
++>>>>>>> origin/upstream
                    // Do a make current
                    ret = eglMakeCurrent(re->win->egl_disp, re->win->egl_surface[0],
                                               re->win->egl_surface[0], ctx->context);
@@@ -4723,9 -4884,9 +4976,15 @@@ module_open(Evas_Module *em
     if (getenv("EVAS_GL_DIRECT_OVERRIDE"))
       {
          gl_direct_override = 1;
++<<<<<<< HEAD
 +        fprintf(stderr, "########################################################\n");
 +        fprintf(stderr, "######### [Evas] Direct overriding is enabled ##########\n");
 +        fprintf(stderr, "########################################################\n");
++=======
+         DBG("########################################################");
+         DBG("######### [Evas] Direct overriding is enabled ##########");
+         DBG("########################################################");
++>>>>>>> origin/upstream
       }
  
     /* store it for later use */