evas/engine: updated ector_begin() engine function signature.
authorsubhransu mohanty <smohantty@gmail.com>
Fri, 2 Dec 2016 06:35:16 +0000 (15:35 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 07:23:57 +0000 (16:23 +0900)
Change-Id: Ib274f8c7321d4a3408e4eda55d2ecc0e9bf75b58

src/lib/evas/canvas/evas_object_vg.c
src/lib/evas/include/evas_private.h
src/modules/evas/engines/gl_generic/evas_engine.c
src/modules/evas/engines/software_generic/evas_engine.c

index 8c3836d..23a5be3 100644 (file)
@@ -239,7 +239,7 @@ _svg_data_render(Evas_Object_Protected_Data *obj,
          svg->h == obj->cur->geometry.h))
      {
          evas_cache_svg_entry_del(svg);
-         svg = evas_cache_svg_find(svg->file, svg->src_vg, svg->dest_vg, 
+         svg = evas_cache_svg_find(svg->file, svg->src_vg, svg->dest_vg,
                                    svg->key_frame, obj->cur->geometry.w, obj->cur->geometry.h);
          vd->svg = svg;
      }
@@ -270,8 +270,9 @@ _svg_data_render(Evas_Object_Protected_Data *obj,
         evas_common_draw_context_set_render_op(ct, _EVAS_RENDER_COPY);
         evas_common_draw_context_set_color(ct, 255, 255, 255, 255);
         obj->layer->evas->engine.func->ector_begin(output, ct,
-                                                   ector, buffer,
+                                                   ector, buffer, EINA_TRUE,
                                                    0, 0,
+                                                   obj->cur->geometry.w, obj->cur->geometry.h,
                                                    do_async);
         _evas_vg_render(obj, vd,
                         output, ct, buffer,
@@ -356,8 +357,9 @@ evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED,
 
    if (!vd->backing_store)
      {
-        obj->layer->evas->engine.func->ector_begin(output, context, ector, surface,
+        obj->layer->evas->engine.func->ector_begin(output, context, ector, surface, EINA_FALSE,
                                                    obj->cur->geometry.x + x, obj->cur->geometry.y + y,
+                                                   obj->cur->geometry.w, obj->cur->geometry.h,
                                                    do_async);
         _evas_vg_render(obj, vd, output, context, surface, vd->root, NULL, do_async);
         obj->layer->evas->engine.func->ector_end(output, context, ector, surface, do_async);
@@ -366,7 +368,10 @@ evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED,
      {
         if (vd->content_changed)
           {
-             obj->layer->evas->engine.func->ector_begin(output, context, ector, vd->backing_store, 0, 0, do_async);
+             obj->layer->evas->engine.func->ector_begin(output, context, ector, vd->backing_store, EINA_TRUE,
+                                                        0, 0,
+                                                        obj->cur->geometry.w, obj->cur->geometry.h,
+                                                        do_async);
              _evas_vg_render(obj, vd, output, context, vd->backing_store, vd->root, NULL,do_async);
              obj->layer->evas->engine.func->image_dirty_region(obj->layer->evas->engine.data.output, vd->backing_store,
                                                                0, 0, 0, 0);
index dae6c70..e69ee3b 100755 (executable)
@@ -1474,7 +1474,7 @@ struct _Evas_Func
    void  (*output_copy)                  (void *data, void *buffer, int stride, int width, int height, uint format, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh);
    Ector_Surface *(*ector_create)        (void *data);
    void  (*ector_destroy)                (void *data, Ector_Surface *surface);
-   void  (*ector_begin)                  (void *data, void *context, Ector_Surface *ector, void *surface, int x, int y, Eina_Bool do_async);
+   void  (*ector_begin)                  (void *data, void *context, Ector_Surface *ector, void *surface, Eina_Bool surface_clear, int x, int y, int w, int h, Eina_Bool do_async);
    void  (*ector_renderer_draw)          (void *data, void *context, void *surface, Ector_Renderer *r, Eina_Array *clips, Eina_Bool do_async);
    void  (*ector_end)                    (void *data, void *context, Ector_Surface *ector, void *surface, Eina_Bool do_async);
    void *(*ector_surface_create)         (void *data, void *surface, int w, int h, Eina_Bool force, int *error);
index fb87129..420c659 100644 (file)
@@ -2556,7 +2556,9 @@ eng_ector_renderer_draw(void *data, void *context, void *surface, Ector_Renderer
 
 static void
 eng_ector_begin(void *data EINA_UNUSED, void *context EINA_UNUSED, Ector_Surface *ector,
-                void *surface, int x, int y, Eina_Bool do_async EINA_UNUSED)
+                void *surface, Eina_Bool surface_clear EINA_UNUSED,
+                int x, int y, int width EINA_UNUSED, int height EINA_UNUSED,
+                Eina_Bool do_async EINA_UNUSED)
 {
    int w, h, stride;
    Evas_GL_Image *glim = surface;
index a6c8688..91a45f6 100644 (file)
@@ -89,7 +89,7 @@ struct _Render_Engine_GL_Surface
    int     depth_bits;
    int     stencil_bits;
 
-   // Data 
+   // Data
    void   *buffer;
 
    Render_Engine_GL_Context   *current_ctx;
@@ -1115,8 +1115,8 @@ eng_image_native_set(void *data EINA_UNUSED, void *image, void *native)
                                     EVAS_COLORSPACE_ARGB8888);
      }
    else
-     im2 = evas_cache_image_data(evas_common_image_cache_get(), 
-                                 im->w, im->h, 
+     im2 = evas_cache_image_data(evas_common_image_cache_get(),
+                                 im->w, im->h,
                                  NULL, 1,
                                  EVAS_COLORSPACE_ARGB8888);
    if (im->references > 1)
@@ -2330,8 +2330,8 @@ eng_image_map_surface_new(void *data EINA_UNUSED, int w, int h, int alpha)
         return surface;
      }
 #endif
-   surface = evas_cache_image_copied_data(evas_common_image_cache_get(), 
-                                          w, h, NULL, alpha, 
+   surface = evas_cache_image_copied_data(evas_common_image_cache_get(),
+                                          w, h, NULL, alpha,
                                           EVAS_COLORSPACE_ARGB8888);
    if (!surface) return NULL;
    evas_cache_image_pixels(surface);
@@ -2867,7 +2867,7 @@ static int
 eng_image_load_error_get(void *data EINA_UNUSED, void *image)
 {
    RGBA_Image *im;
-   
+
    if (!image) return EVAS_LOAD_ERROR_NONE;
    im = image;
    return im->cache_entry.load_error;
@@ -2951,7 +2951,7 @@ eng_gl_surface_create(void *data EINA_UNUSED, void *config, int w, int h)
          sfc->depth_bits = 0;
          break;
      }
-   
+
    // Stencil Bits
    switch (cfg->stencil_bits)
      {
@@ -3153,7 +3153,7 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
 
 
    // Call MakeCurrent
-   ret = _sym_OSMesaMakeCurrent(ctx->context, sfc->buffer, GL_UNSIGNED_BYTE, 
+   ret = _sym_OSMesaMakeCurrent(ctx->context, sfc->buffer, GL_UNSIGNED_BYTE,
                                 sfc->w, sfc->h);
 
    if (ret == GL_FALSE)
@@ -3214,7 +3214,7 @@ eng_gl_native_surface_get(void *data EINA_UNUSED, void *surface, void *native_su
    ns->type = EVAS_NATIVE_SURFACE_EVASGL;
    ns->version = EVAS_NATIVE_SURFACE_VERSION;
    ns->data.evasgl.surface = sfc->buffer;
-   
+
    return 1;
 #else
    (void) surface;
@@ -3929,7 +3929,7 @@ eng_ector_surface_create(void *data, void *surface, int width, int height, Eina_
 
 static Ector_Surface_Cache *surface_cache = NULL;
 
-static void 
+static void
 _ector_surface_cache_init(void)
 {
    if (!surface_cache)
@@ -3939,7 +3939,7 @@ _ector_surface_cache_init(void)
      }
 }
 
-static void 
+static void
 _ector_surface_cache_dump(void)
 {
    Ector_Surface_Data *data;
@@ -3989,7 +3989,7 @@ eng_ector_surface_cache_get(void *data EINA_UNUSED, void *key)
 
    _ector_surface_cache_init();
    surface_data =  eina_hash_find(surface_cache->surface_hash, &key);
-   if (surface_data) 
+   if (surface_data)
      {
         EINA_LIST_FOREACH(surface_cache->lru_list, l, lru_data)
           {
@@ -4006,7 +4006,10 @@ eng_ector_surface_cache_get(void *data EINA_UNUSED, void *key)
 
 
 static void
-eng_ector_begin(void *data EINA_UNUSED, void *context EINA_UNUSED, Ector_Surface *ector, void *surface, int x, int y, Eina_Bool do_async)
+eng_ector_begin(void *data EINA_UNUSED, void *context EINA_UNUSED, Ector_Surface *ector,
+                void *surface, Eina_Bool surface_clear EINA_UNUSED,
+                int x, int y, int width EINA_UNUSED, int height EINA_UNUSED,
+                Eina_Bool do_async EINA_UNUSED)
 {
    if (do_async)
      {
@@ -4786,7 +4789,7 @@ gl_sym_init(void)
 // Wrapped GL APIs to handle desktop compatibility
 
 // Stripping precision code from GLES shader for desktop compatibility
-// Code adopted from Meego GL code. Temporary Fix.  
+// Code adopted from Meego GL code. Temporary Fix.
 static const char *
 opengl_strtok(const char *s, int *n, char **saveptr, char *prevbuf)
 {
@@ -4798,33 +4801,33 @@ opengl_strtok(const char *s, int *n, char **saveptr, char *prevbuf)
 
    if (prevbuf) free(prevbuf);
 
-   if (s) 
+   if (s)
       *saveptr = (char *)s;
-   else 
+   else
      {
         if (!(*saveptr) || !(*n))
            return NULL;
         s = *saveptr;
      }
 
-   for (; *n && strchr(delim, *s); s++, (*n)--) 
+   for (; *n && strchr(delim, *s); s++, (*n)--)
      {
-        if (*s == '/' && *n > 1) 
+        if (*s == '/' && *n > 1)
           {
-             if (s[1] == '/') 
+             if (s[1] == '/')
                {
-                  do 
+                  do
                     {
                        s++, (*n)--;
-                    } 
+                    }
                   while (*n > 1 && s[1] != '\n' && s[1] != '\r');
-               } 
-             else if (s[1] == '*') 
+               }
+             else if (s[1] == '*')
                {
-                  do 
+                  do
                     {
                        s++, (*n)--;
-                    } 
+                    }
                   while (*n > 2 && (s[1] != '*' || s[2] != '/'));
                   s++, (*n)--;
                }
@@ -4841,26 +4844,26 @@ opengl_strtok(const char *s, int *n, char **saveptr, char *prevbuf)
    ret = malloc(retlen + 1);
    p = ret;
 
-   while (retlen > 0) 
+   while (retlen > 0)
      {
-        if (*start == '/' && retlen > 1) 
+        if (*start == '/' && retlen > 1)
           {
-             if (start[1] == '/') 
+             if (start[1] == '/')
                {
-                  do 
+                  do
                     {
                        start++, retlen--;
-                    } 
+                    }
                   while (retlen > 1 && start[1] != '\n' && start[1] != '\r');
                   start++, retlen--;
                   continue;
-               } 
-             else if (start[1] == '*') 
+               }
+             else if (start[1] == '*')
                {
-                  do 
+                  do
                     {
                        start++, retlen--;
-                    } 
+                    }
                   while (retlen > 2 && (start[1] != '*' || start[2] != '/'));
                   start += 3, retlen -= 3;
                   continue;
@@ -4871,7 +4874,7 @@ opengl_strtok(const char *s, int *n, char **saveptr, char *prevbuf)
 
    *p = 0;
    return ret;
-}      
+}
 
 static char *
 patch_gles_shader(const char *source, int length, int *patched_len)
@@ -4889,36 +4892,36 @@ patch_gles_shader(const char *source, int length, int *patched_len)
    if (!patched) return NULL;
 
    p = (char *)opengl_strtok(source, &length, &saveptr, NULL);
-   for (; p; p = (char *)opengl_strtok(0, &length, &saveptr, p)) 
+   for (; p; p = (char *)opengl_strtok(0, &length, &saveptr, p))
      {
-        if (!strncmp(p, "lowp", 4) || !strncmp(p, "mediump", 7) || !strncmp(p, "highp", 5)) 
+        if (!strncmp(p, "lowp", 4) || !strncmp(p, "mediump", 7) || !strncmp(p, "highp", 5))
           {
              continue;
-          } 
-        else if (!strncmp(p, "precision", 9)) 
+          }
+        else if (!strncmp(p, "precision", 9))
           {
              while ((p = (char *)opengl_strtok(0, &length, &saveptr, p)) && !strchr(p, ';'));
-          } 
-        else 
+          }
+        else
           {
-             if (!strncmp(p, "gl_MaxVertexUniformVectors", 26)) 
+             if (!strncmp(p, "gl_MaxVertexUniformVectors", 26))
                {
-                  free(p); 
+                  free(p);
                   p = strdup("(gl_MaxVertexUniformComponents / 4)");
-               } 
-             else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28)) 
+               }
+             else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28))
                {
                   free(p);
                   p = strdup("(gl_MaxFragmentUniformComponents / 4)");
-               } 
-             else if (!strncmp(p, "gl_MaxVaryingVectors", 20)) 
+               }
+             else if (!strncmp(p, "gl_MaxVaryingVectors", 20))
                {
                   free(p);
                   p = strdup("(gl_MaxVaryingFloats / 4)");
                }
 
              int new_len = strlen(p);
-             if (*patched_len + new_len > patched_size) 
+             if (*patched_len + new_len > patched_size)
                {
                   char *tmp;
 
@@ -4935,18 +4938,18 @@ patch_gles_shader(const char *source, int length, int *patched_len)
 
              memcpy(patched + *patched_len, p, new_len);
              *patched_len += new_len;
-          }     
+          }
      }
 
    patched[*patched_len] = 0;
    /* check that we don't leave dummy preprocessor lines */
-   for (sp = patched; *sp;) 
+   for (sp = patched; *sp;)
      {
         for (; *sp == ' ' || *sp == '\t'; sp++);
-        if (!strncmp(sp, "#define", 7)) 
+        if (!strncmp(sp, "#define", 7))
           {
              for (p = sp + 7; *p == ' ' || *p == '\t'; p++);
-             if (*p == '\n' || *p == '\r' || *p == '/') 
+             if (*p == '\n' || *p == '\r' || *p == '/')
                {
                   memset(sp, 0x20, 7);
                }
@@ -4968,21 +4971,21 @@ evgl_glShaderSource(GLuint shader, GLsizei count, const char* const* string, con
    memset(s, 0, count * sizeof(char*));
    memset(l, 0, count * sizeof(GLint));
 
-   for (i = 0; i < count; ++i) 
+   for (i = 0; i < count; ++i)
      {
-        if (length) 
+        if (length)
           {
              len = length[i];
-             if (len < 0) 
+             if (len < 0)
                 len = string[i] ? strlen(string[i]) : 0;
           }
         else
            len = string[i] ? strlen(string[i]) : 0;
 
-        if (string[i]) 
+        if (string[i])
           {
              s[i] = patch_gles_shader(string[i], len, &l[i]);
-             if (!s[i]) 
+             if (!s[i])
                {
                   while(i)
                      free(s[--i]);
@@ -4992,8 +4995,8 @@ evgl_glShaderSource(GLuint shader, GLsizei count, const char* const* string, con
                   DBG("Patching Shader Failed.");
                   return;
                }
-          } 
-        else 
+          }
+        else
           {
              s[i] = NULL;
              l[i] = 0;
@@ -5112,7 +5115,7 @@ override_gl_apis(Evas_GL_API *api)
    ORD(glCheckFramebufferStatus);
    ORD(glClear);
    ORD(glClearColor);
-   ORD(glClearDepthf);     
+   ORD(glClearDepthf);
    ORD(glClearStencil);
    ORD(glColorMask);
    ORD(glCompileShader);
@@ -5131,7 +5134,7 @@ override_gl_apis(Evas_GL_API *api)
    ORD(glDeleteTextures);
    ORD(glDepthFunc);
    ORD(glDepthMask);
-   ORD(glDepthRangef);     
+   ORD(glDepthRangef);
    ORD(glDetachShader);
    ORD(glDisable);
    ORD(glDisableVertexAttribArray);
@@ -5164,7 +5167,7 @@ override_gl_apis(Evas_GL_API *api)
    ORD(glGetRenderbufferParameteriv);
    ORD(glGetShaderiv);
    ORD(glGetShaderInfoLog);
-   ORD(glGetShaderPrecisionFormat);  
+   ORD(glGetShaderPrecisionFormat);
    ORD(glGetShaderSource);
    ORD(glGetTexParameterfv);
    ORD(glGetTexParameteriv);
@@ -5187,11 +5190,11 @@ override_gl_apis(Evas_GL_API *api)
    ORD(glPixelStorei);
    ORD(glPolygonOffset);
    ORD(glReadPixels);
-   ORD(glReleaseShaderCompiler); 
+   ORD(glReleaseShaderCompiler);
    ORD(glRenderbufferStorage);
    ORD(glSampleCoverage);
    ORD(glScissor);
-   ORD(glShaderBinary); 
+   ORD(glShaderBinary);
    ORD(glShaderSource);
    ORD(glStencilFunc);
    ORD(glStencilFuncSeparate);
@@ -5264,7 +5267,7 @@ gl_lib_init(void)
    // Current ctx & sfc stuff
    if (!_tls_check()) return 0;
 
-   // dlopen OSMesa 
+   // dlopen OSMesa
    gl_lib_handle = dlopen("libOSMesa.so.9", RTLD_NOW);
    if (!gl_lib_handle) gl_lib_handle = dlopen("libOSMesa.so.8", RTLD_NOW);
    if (!gl_lib_handle) gl_lib_handle = dlopen("libOSMesa.so.7", RTLD_NOW);