Revert "Upstream merge"
[framework/uifw/evas.git] / src / modules / engines / software_generic / evas_engine.c
index 536d507..5540b3e 100644 (file)
@@ -1,8 +1,5 @@
 #include "evas_common.h" /* Also includes international specific stuff */
 #include "evas_private.h"
-#ifdef EVAS_CSERVE2
-#include "evas_cs2_private.h"
-#endif
 
 #ifdef HAVE_DLSYM
 # include <dlfcn.h>      /* dlopen,dlclose,etc */
@@ -441,7 +438,11 @@ static void
 eng_rectangle_draw(void *data __UNUSED__, void *context, void *surface, int x, int y, int w, int h)
 {
 #ifdef BUILD_PIPE_RENDER
-   if ((cpunum > 1))
+   if ((cpunum > 1)
+#ifdef EVAS_FRAME_QUEUING
+        && evas_common_frameq_enabled()
+#endif
+        )
      evas_common_pipe_rectangle_draw(surface, context, x, y, w, h);
    else
 #endif
@@ -455,7 +456,11 @@ static void
 eng_line_draw(void *data __UNUSED__, void *context, void *surface, int x1, int y1, int x2, int y2)
 {
 #ifdef BUILD_PIPE_RENDER
-   if ((cpunum > 1))
+   if ((cpunum > 1)
+ #ifdef EVAS_FRAME_QUEUING
+        && evas_common_frameq_enabled()
+#endif
+        )
     evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2);
    else
 #endif   
@@ -481,7 +486,11 @@ static void
 eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
 {
 #ifdef BUILD_PIPE_RENDER
-   if ((cpunum > 1))
+   if ((cpunum > 1)
+#ifdef EVAS_FRAME_QUEUING
+        && evas_common_frameq_enabled()
+#endif
+        )
      evas_common_pipe_poly_draw(surface, context, polygon, x, y);
    else
 #endif
@@ -566,8 +575,9 @@ eng_image_alpha_set(void *data __UNUSED__, void *image, int has_alpha)
        return im;
      }
    im = (RGBA_Image *) evas_cache_image_alone(&im->cache_entry);
-   im->cache_entry.flags.alpha = has_alpha ? 1 : 0;
    evas_common_image_colorspace_dirty(im);
+
+   im->cache_entry.flags.alpha = has_alpha ? 1 : 0;
    return im;
 }
 
@@ -657,58 +667,24 @@ static void *
 eng_image_load(void *data __UNUSED__, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
 {
    *error = EVAS_LOAD_ERROR_NONE;
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        Image_Entry *ie;
-        ie = evas_cache2_image_open(evas_common_image_cache2_get(),
-                                    file, key, lo, error);
-        if (ie)
-          evas_cache2_image_open_wait(ie);
-
-        return ie;
-     }
-#endif
    return evas_common_load_image_from_file(file, key, lo, error);
 }
 
 static void *
 eng_image_new_from_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace)
 {
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        Evas_Cache2 *cache = evas_common_image_cache2_get();
-        return evas_cache2_image_data(cache, w, h, image_data, alpha, cspace);
-     }
-#endif
    return evas_cache_image_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace);
 }
 
 static void *
 eng_image_new_from_copied_data(void *data __UNUSED__, int w, int h, DATA32 *image_data, int alpha, int cspace)
 {
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        Evas_Cache2 *cache = evas_common_image_cache2_get();
-        return evas_cache2_image_copied_data(cache, w, h, image_data, alpha,
-                                             cspace);
-     }
-#endif
    return evas_cache_image_copied_data(evas_common_image_cache_get(), w, h, image_data, alpha, cspace);
 }
 
 static void
 eng_image_free(void *data __UNUSED__, void *image)
 {
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        evas_cache2_image_close(image);
-        return;
-     }
-#endif
    evas_cache_image_drop(image);
 }
 
@@ -727,10 +703,6 @@ eng_image_size_set(void *data __UNUSED__, void *image, int w, int h)
 {
    Image_Entry *im = image;
    if (!im) return NULL;
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     return evas_cache2_image_size_set(im, w, h);
-#endif
    return evas_cache_image_size_set(im, w, h);
 }
 
@@ -739,10 +711,6 @@ eng_image_dirty_region(void *data __UNUSED__, void *image, int x, int y, int w,
 {
    Image_Entry *im = image;
    if (!im) return NULL;
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     return evas_cache2_image_dirty(im, x, y, w, h);
-#endif
    return evas_cache_image_dirty(im, x, y, w, h);
 }
 
@@ -750,7 +718,7 @@ static void *
 eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **image_data, int *err)
 {
    RGBA_Image *im;
-   int error = EVAS_LOAD_ERROR_NONE;
+   int error;
 
    if (!image)
      {
@@ -758,21 +726,6 @@ eng_image_data_get(void *data __UNUSED__, void *image, int to_write, DATA32 **im
        return NULL;
      }
    im = image;
-
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        error = evas_cache2_image_load_data(&im->cache_entry);
-        if (err) *err = error;
-
-        if (to_write)
-          im = (RGBA_Image *)evas_cache2_image_writable(&im->cache_entry);
-
-        *image_data = im->image.data;
-        return im;
-     }
-#endif
-
    error = evas_cache_image_load_data(&im->cache_entry);
    switch (im->cache_entry.space)
      {
@@ -815,14 +768,6 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
             im2 = eng_image_new_from_data(data, w, h, image_data,
                                           eng_image_alpha_get(data, image),
                                           eng_image_colorspace_get(data, image));
-#ifdef EVAS_CSERVE2
-             if (evas_cserve2_use_get())
-               {
-                  evas_cache2_image_close(&im->cache_entry);
-                  im = im2;
-                  break;
-               }
-#endif
              evas_cache_image_drop(&im->cache_entry);
             im = im2;
          }
@@ -853,15 +798,8 @@ static void
 eng_image_data_preload_request(void *data __UNUSED__, void *image, const void *target)
 {
    RGBA_Image *im = image;
-   if (!im) return ;
 
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        evas_cache2_image_preload_data(&im->cache_entry, target);
-        return;
-     }
-#endif
+   if (!im) return ;
    evas_cache_image_preload_data(&im->cache_entry, target);
 }
 
@@ -869,10 +807,6 @@ static void
 eng_image_data_preload_cancel(void *data __UNUSED__, void *image, const void *target)
 {
    RGBA_Image *im = image;
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     return;
-#endif
 
    if (!im) return ;
    evas_cache_image_preload_cancel(&im->cache_entry, target);
@@ -886,12 +820,12 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image,
    if (!image) return;
    im = image;
 #ifdef BUILD_PIPE_RENDER
-   if ((cpunum > 1))
-     {
-#ifdef EVAS_CSERVE2
-        if (evas_cserve2_use_get())
-          evas_cache2_image_load_data(&im->cache_entry);
+   if ((cpunum > 1)
+#ifdef EVAS_FRAME_QUEUING
+        && evas_common_frameq_enabled()
 #endif
+        )
+     {
         evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im), 
                                                   surface, context, smooth,
                                                   src_x, src_y, src_w, src_h,
@@ -904,20 +838,9 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image,
    else
 #endif
      {
-#if 0
-#ifdef EVAS_CSERVE2
-        if (evas_cserve2_use_get())
-          {
-             evas_cache2_image_load_data(&im->cache_entry);
-             goto image_loaded;
-          }
-#endif
-        if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
-          evas_cache_image_load_data(&im->cache_entry);
-        evas_common_image_colorspace_normalize(im);
-
-image_loaded:
-#endif
+//        if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
+//          evas_cache_image_load_data(&im->cache_entry);
+//        evas_common_image_colorspace_normalize(im);
         evas_common_rgba_image_scalecache_prepare(&im->cache_entry, surface, context, smooth,
                                                   src_x, src_y, src_w, src_h,
                                                   dst_x, dst_y, dst_w, dst_h);
@@ -980,7 +903,11 @@ eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *im
    else
      {
 #ifdef BUILD_PIPE_RENDER
-        if ((cpunum > 1))
+        if ((cpunum > 1)
+# ifdef EVAS_FRAME_QUEUING
+       && evas_common_frameq_enabled()
+# endif
+        )
           evas_common_pipe_map_draw(im, surface, context, npoints, p, smooth, level);
         else
 #endif
@@ -999,16 +926,6 @@ static void *
 eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
 {
    void *surface;
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        surface = evas_cache2_image_copied_data(evas_common_image_cache2_get(),
-                                                w, h, NULL, alpha,
-                                                EVAS_COLORSPACE_ARGB8888);
-        evas_cache2_image_pixels(surface);
-        return surface;
-     }
-#endif
    surface = evas_cache_image_copied_data(evas_common_image_cache_get(), 
                                           w, h, NULL, alpha, 
                                           EVAS_COLORSPACE_ARGB8888);
@@ -1019,13 +936,6 @@ eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
 static void
 eng_image_map_surface_free(void *data __UNUSED__, void *surface)
 {
-#ifdef EVAS_CSERVE2
-   if (evas_cserve2_use_get())
-     {
-        evas_cache2_image_unload_data(surface);
-        return;
-     }
-#endif
    evas_cache_image_drop(surface);
 }
 
@@ -1241,10 +1151,10 @@ eng_font_pen_coords_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_T
 }
 
 static Eina_Bool
-eng_font_text_props_info_create(void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t par_pos, size_t len, Evas_Text_Props_Mode mode)
+eng_font_text_props_info_create(void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t par_pos, size_t len)
 {
    return evas_common_text_props_content_create((RGBA_Font_Int *) fi, text,
-         text_props, par_props, par_pos, len, mode);
+         text_props, par_props, par_pos, len);
 }
 
 static int
@@ -1274,16 +1184,21 @@ eng_font_run_font_end_get(void *data __UNUSED__, Evas_Font_Set *font, Evas_Font_
 }
 
 static void
-eng_font_draw(void *data __UNUSED__, void *context, void *surface, Evas_Font_Set *font __UNUSED__, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, Evas_Text_Props *text_props)
+eng_font_draw(void *data __UNUSED__, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Evas_Text_Props *text_props)
 {
 #ifdef BUILD_PIPE_RENDER
-   if ((cpunum > 1))
-     evas_common_pipe_text_draw(surface, context, x, y, text_props);
+   if ((cpunum > 1)
+#ifdef EVAS_FRAME_QUEUING
+        && evas_common_frameq_enabled()
+#endif
+        )
+     evas_common_pipe_text_draw(surface, context, (RGBA_Font *) font, x, y,
+           text_props);
    else
 #endif   
      {
-        evas_common_font_draw_prepare(text_props);
-       evas_common_font_draw(surface, context, x, y, text_props);
+       evas_common_font_draw(surface, context, (RGBA_Font *) font, x, y,
+              text_props);
        evas_common_cpu_end_opt();
      }
 }