Revert "Upstream merge"
[framework/uifw/evas.git] / src / modules / engines / gl_sdl / evas_engine.c
index bfbb120..46588d9 100644 (file)
@@ -1,8 +1,6 @@
-#include "evas_common.h"
+#include "evas_common.h" /* Also includes international specific stuff */
 #include "evas_engine.h"
 
-#include <dlfcn.h>      /* dlopen,dlclose,etc */
-
 static void*                     _sdl_output_setup     (int w, int h, int fullscreen, int noframe);
                 
 int _evas_engine_GL_SDL_log_dom = -1;
@@ -97,7 +95,7 @@ eng_output_resize(void *data, int w, int h)
          }
      }
 
-   evas_gl_common_context_resize(re->gl_context, w, h);
+   evas_gl_common_context_resize(re->gl_context, w, h, re->gl_context->rot);
 }
 
 static void
@@ -114,7 +112,7 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
    Render_Engine *re;
 
    re = (Render_Engine *)data;
-   evas_gl_common_context_resize(re->gl_context, re->w, re->h);
+   evas_gl_common_context_resize(re->gl_context, re->w, re->h, re->gl_context->rot);
    /* smple bounding box */
    if (!re->draw.redraw)
      {
@@ -175,6 +173,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
 
    re = (Render_Engine *)data;
    evas_gl_common_context_flush(re->gl_context);
+   evas_gl_common_context_newframe(re->gl_context);
    /* get the upate rect surface - return engine data as dummy */
    if (!re->draw.redraw)
      {
@@ -341,363 +340,6 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x,
    evas_gl_common_poly_draw(re->gl_context, polygon, x, y);
 }
 
-static void
-eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__)
-{
-   evas_common_gradient2_color_np_stop_insert(gradient, r, g, b, a, pos);
-}
-
-static void
-eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
-{
-   evas_common_gradient2_clear(gradient);
-}
-
-static void
-eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__)
-{
-   evas_common_gradient2_fill_transform_set(gradient, transform);
-}
-
-static void
-eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
-{
-   evas_common_gradient2_fill_spread_set(gradient, spread);
-}
-
-static void *
-eng_gradient2_linear_new(void *data __UNUSED__)
-{
-   return evas_common_gradient2_linear_new();
-}
-
-static void
-eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__)
-{
-   evas_common_gradient2_free(linear_gradient);
-}
-
-static void
-eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__)
-{
-   evas_common_gradient2_linear_fill_set(linear_gradient, x0, y0, x1, y1);
-}
-
-static int
-eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
-
-   if (!dc || !gr || !gr->type.geometer)  return 0;
-   return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
-            gr->type.geometer->has_mask(gr, dc->render_op));
-}
-
-static int
-eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-
-   if (!dc || !linear_gradient)  return 0;
-   return 1;
-}
-
-static void
-eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
-   int  len;
-   
-   if (!dc || !gr || !gr->type.geometer)  return;
-   gr->type.geometer->geom_update(gr);
-   len = gr->type.geometer->get_map_len(gr);
-   evas_common_gradient2_map(dc, gr, len);
-}
-
-static void
-eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
-{
-}
-
-static void
-eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
-{
-   Render_Engine *re;
-
-   re = (Render_Engine *)data;
-   re->gl_context->dc = context;
-     {
-        Evas_GL_Image *gim;
-        RGBA_Image *im;
-        RGBA_Draw_Context *dc = context;
-        int op = dc->render_op, cuse = dc->clip.use;
-        
-        im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
-        im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
-        
-        dc->render_op = _EVAS_RENDER_FILL;
-        dc->clip.use = 0;
-        
-        // draw to buf, copy to tex, draw tex
-        evas_common_gradient2_draw(im, dc, 0, 0, w, h, linear_gradient);
-
-        gim = evas_gl_common_image_new_from_data(re->gl_context, w, h,
-                                                 im->image.data, 1,
-                                                 EVAS_COLORSPACE_ARGB8888);
-        dc->render_op = op;
-        dc->clip.use = cuse;
-        evas_gl_common_image_draw(re->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
-        evas_cache_image_drop(&im->cache_entry);
-        evas_gl_common_image_free(gim);
-     }
-}
-
-static void *
-eng_gradient2_radial_new(void *data __UNUSED__)
-{
-   return evas_common_gradient2_radial_new();
-}
-
-static void
-eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__)
-{
-   evas_common_gradient2_free(radial_gradient);
-}
-
-static void
-eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__)
-{
-   evas_common_gradient2_radial_fill_set(radial_gradient, cx, cy, rx, ry);
-}
-
-static int
-eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
-   
-   if (!dc || !gr || !gr->type.geometer)  return 0;
-   return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
-            gr->type.geometer->has_mask(gr, dc->render_op));
-}
-
-static int
-eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   
-   if (!dc || !radial_gradient)  return 0;
-   return 1;
-}
-
-static void
-eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
-   int  len;
-   
-   if (!dc || !gr || !gr->type.geometer)  return;
-   gr->type.geometer->geom_update(gr);
-   len = gr->type.geometer->get_map_len(gr);
-   evas_common_gradient2_map(dc, gr, len);
-}
-
-static void
-eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
-{
-}
-
-static void
-eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
-{
-   Render_Engine *re;
-
-   re = (Render_Engine *)data;
-   re->gl_context->dc = context;
-     {
-        Evas_GL_Image *gim;
-        RGBA_Image *im;
-        RGBA_Draw_Context *dc = context;
-        int op = dc->render_op, cuse = dc->clip.use;
-        
-        im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
-        im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
-        
-        dc->render_op = _EVAS_RENDER_FILL;
-        dc->clip.use = 0;
-        
-        // draw to buf, copy to tex, draw tex
-        evas_common_gradient2_draw(im, dc, 0, 0, w, h, radial_gradient);
-
-        gim = evas_gl_common_image_new_from_data(re->gl_context, w, h,
-                                                 im->image.data, 1,
-                                                 EVAS_COLORSPACE_ARGB8888);
-        dc->render_op = op;
-        dc->clip.use = cuse;
-        evas_gl_common_image_draw(re->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
-        evas_cache_image_drop(&im->cache_entry);
-        evas_gl_common_image_free(gim);
-     }
-}
-
-static void *
-eng_gradient_new(void *data __UNUSED__)
-{
-   return evas_common_gradient_new();
-}
-
-static void
-eng_gradient_free(void *data __UNUSED__, void *gradient)
-{
-   evas_common_gradient_free(gradient);
-}
-
-static void
-eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta)
-{
-   evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
-}
-
-static void
-eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta)
-{
-   evas_common_gradient_alpha_stop_add(gradient, a, delta);
-}
-
-static void
-eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha)
-{
-   evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
-}
-
-static void
-eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len)
-{
-   evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
-}
-
-static void
-eng_gradient_clear(void *data __UNUSED__, void *gradient)
-{
-   evas_common_gradient_clear(gradient);
-}
-
-static void
-eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h)
-{
-   evas_common_gradient_fill_set(gradient, x, y, w, h);
-}
-
-static void
-eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle)
-{
-   evas_common_gradient_fill_angle_set(gradient, angle);
-}
-
-static void
-eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
-{
-   evas_common_gradient_fill_spread_set(gradient, spread);
-}
-
-static void
-eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle)
-{
-   evas_common_gradient_map_angle_set(gradient, angle);
-}
-
-static void
-eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset)
-{
-   evas_common_gradient_map_offset_set(gradient, offset);
-}
-
-static void
-eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction)
-{
-   evas_common_gradient_map_direction_set(gradient, direction);
-}
-
-static void
-eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params)
-{
-   evas_common_gradient_type_set(gradient, name, params);
-}
-
-static int
-eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
-   
-   if (!dc || !gr || !gr->type.geometer)  return 0;
-   return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
-            gr->type.geometer->has_mask(gr, dc->render_op));
-}
-
-static int
-eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   
-   if (!dc || !gradient)  return 0;
-   return 1;
-}
-
-static void
-eng_gradient_render_pre(void *data, void *context, void *gradient)
-{
-   RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
-   RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
-   int  len;
-   
-   if (!dc || !gr || !gr->type.geometer)  return;
-   gr->type.geometer->geom_set(gr);
-   len = gr->type.geometer->get_map_len(gr);
-   evas_common_gradient_map(dc, gr, len);
-}
-
-static void
-eng_gradient_render_post(void *data __UNUSED__, void *gradient)
-{
-}
-
-static void
-eng_gradient_draw(void *data, void *context, void *surface __UNUSED__, void *gradient, int x, int y, int w, int h)
-{
-   Render_Engine *re;
-
-   re = (Render_Engine *)data;
-   re->gl_context->dc = context;
-     {
-        Evas_GL_Image *gim;
-        RGBA_Image *im;
-        RGBA_Draw_Context *dc = context;
-        int op = dc->render_op, cuse = dc->clip.use;
-        
-        im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
-        im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
-        
-        dc->render_op = _EVAS_RENDER_FILL;
-        dc->clip.use = 0;
-        
-        // draw to buf, copy to tex, draw tex
-        evas_common_gradient_draw(im, dc, 0, 0, w, h, gradient);
-
-        gim = evas_gl_common_image_new_from_data(re->gl_context, w, h,
-                                                 im->image.data, 1,
-                                                 EVAS_COLORSPACE_ARGB8888);
-        dc->render_op = op;
-        dc->clip.use = cuse;
-        evas_gl_common_image_draw(re->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
-        evas_cache_image_drop(&im->cache_entry);
-        evas_gl_common_image_free(gim);
-     }
-}
-
 static int
 eng_image_alpha_get(void *data, void *image)
 {
@@ -823,6 +465,9 @@ eng_image_colorspace_set(void *data, void *image, int cspace)
        break;
       case EVAS_COLORSPACE_YCBCR422P601_PL:
       case EVAS_COLORSPACE_YCBCR422P709_PL:
+      case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
         if (im->tex) evas_gl_common_texture_free(im->tex);
         im->tex = NULL;
        if (im->cs.data)
@@ -868,9 +513,10 @@ _native_free_cb(void *data, void *image)
 {
 }
 
-static void
+static void *
 eng_image_native_set(void *data, void *image, void *native)
 {
+   return NULL;
 }
 
 static void *
@@ -953,9 +599,18 @@ eng_image_size_set(void *data, void *image, int w, int h)
         return image;
      }
    im_old = image;
-   if ((eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P601_PL) ||
-       (eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P709_PL))
-     w &= ~0x1;
+
+   switch (eng_image_colorspace_get(data, image))
+     {
+      case EVAS_COLORSPACE_YCBCR422P601_PL:
+      case EVAS_COLORSPACE_YCBCR422P709_PL:
+      case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+         w &= ~0x1;
+         break;
+     }
+
    if ((im_old) && (im_old->im->cache_entry.w == w) && (im_old->im->cache_entry.h == h))
      return image;
    if (im_old)
@@ -992,24 +647,27 @@ eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h)
 }
 
 static void *
-eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err)
 {
    Render_Engine *re;
    Evas_GL_Image *im;
-
+   int error;
+   
    re = (Render_Engine *)data;
    if (!image)
      {
        *image_data = NULL;
+        if (err) *err = EVAS_LOAD_ERROR_GENERIC;
        return NULL;
      }
    im = image;
    if (im->native.data)
      {
         *image_data = NULL;
+        if (err) *err = EVAS_LOAD_ERROR_NONE;
         return im;
      }
-   evas_cache_image_load_data(&im->im->cache_entry);
+   error = evas_cache_image_load_data(&im->im->cache_entry);
    switch (im->cs.space)
      {
       case EVAS_COLORSPACE_ARGB8888:
@@ -1025,7 +683,8 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
                  if (!im_new)
                    {
                       *image_data = NULL;
-                      return im;
+                       if (err) *err = error;
+                       return im;
                    }
                  evas_gl_common_image_free(im);
                  im = im_new;
@@ -1037,12 +696,16 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
        break;
       case EVAS_COLORSPACE_YCBCR422P601_PL:
       case EVAS_COLORSPACE_YCBCR422P709_PL:
+      case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
        *image_data = im->cs.data;
        break;
       default:
        abort();
        break;
      }
+   if (err) *err = error;
    return im;
 }
 
@@ -1075,6 +738,9 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
         break;
       case EVAS_COLORSPACE_YCBCR422P601_PL:
       case EVAS_COLORSPACE_YCBCR422P709_PL:
+      case EVAS_COLORSPACE_YCBCR422601_PL:
+      case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+      case EVAS_COLORSPACE_YCBCR420TM12601_PL:
         if (image_data != im->cs.data)
          {
             if (im->cs.data)
@@ -1140,14 +806,14 @@ eng_image_scale_hint_set(void *data __UNUSED__, void *image, int hint)
 }
 
 static void
-eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
+eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level)
 {
    Render_Engine *re;
    
    re = (Render_Engine *)data;
    evas_gl_common_context_target_surface_set(re->gl_context, surface);
    re->gl_context->dc = context;
-   evas_gl_common_image_map4_draw(re->gl_context, image, p, smooth, level);
+   evas_gl_common_image_map_draw(re->gl_context, image, npoints, p, smooth, level);
 }
 
 static void *
@@ -1172,7 +838,7 @@ eng_image_scale_hint_get(void *data __UNUSED__, void *image)
 }
 
 static void
-eng_font_draw(void *data, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const char *text)
+eng_font_draw(void *data, 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 *intl_props)
 {
    Render_Engine *re;
 
@@ -1192,7 +858,8 @@ eng_font_draw(void *data, void *context, void *surface, void *font, int x, int y
                                              evas_gl_font_texture_new,
                                              evas_gl_font_texture_free,
                                              evas_gl_font_texture_draw);
-       evas_common_font_draw(im, context, font, x, y, text);
+       evas_common_font_draw(im, context, (RGBA_Font *) font, x, y,
+              intl_props);
        evas_common_draw_context_font_ext_set(context,
                                              NULL,
                                              NULL,
@@ -1209,16 +876,29 @@ eng_canvas_alpha_get(void *data __UNUSED__, void *info __UNUSED__)
 }
 
 static int
+eng_image_load_error_get(void *data __UNUSED__, void *image)
+{
+   Evas_GL_Image *im;
+   
+   if (!image) return EVAS_LOAD_ERROR_NONE;
+   im = image;
+   return im->im->cache_entry.load_error;
+}
+
+
+static int
 module_open(Evas_Module *em)
 {
    if (!em) return 0;
+   if (!evas_gl_common_module_open()) return 0;
    /* get whatever engine module we inherit from */
    if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
    if (_evas_engine_GL_SDL_log_dom < 0)
-     _evas_engine_GL_SDL_log_dom = eina_log_domain_register("EvasEngineGLSDL", EVAS_DEFAULT_LOG_COLOR);
+     _evas_engine_GL_SDL_log_dom = eina_log_domain_register
+       ("evas-gl_sdl", EVAS_DEFAULT_LOG_COLOR);
    if (_evas_engine_GL_SDL_log_dom < 0)
      {
-        EINA_LOG_ERR("Impossible to create a log domain for GL SDL engine.\n");
+        EINA_LOG_ERR("Can not create a module log domain.");
         return 0;
      }
    /* store it for later use */
@@ -1248,46 +928,6 @@ module_open(Evas_Module *em)
    ORD(polygon_points_clear);
    ORD(polygon_draw);
 
-   ORD(gradient2_color_np_stop_insert);
-   ORD(gradient2_clear);
-   ORD(gradient2_fill_transform_set);
-   ORD(gradient2_fill_spread_set);
-   ORD(gradient2_linear_new);
-   ORD(gradient2_linear_free);
-   ORD(gradient2_linear_fill_set);
-   ORD(gradient2_linear_is_opaque);
-   ORD(gradient2_linear_is_visible);
-   ORD(gradient2_linear_render_pre);
-   ORD(gradient2_linear_render_post);
-   ORD(gradient2_linear_draw);
-   ORD(gradient2_radial_new);
-   ORD(gradient2_radial_free);
-   ORD(gradient2_radial_fill_set);
-   ORD(gradient2_radial_is_opaque);
-   ORD(gradient2_radial_is_visible);
-   ORD(gradient2_radial_render_pre);
-   ORD(gradient2_radial_render_post);
-   ORD(gradient2_radial_draw);
-
-   ORD(gradient_new);
-   ORD(gradient_free);
-   ORD(gradient_color_stop_add);
-   ORD(gradient_alpha_stop_add);
-   ORD(gradient_color_data_set);
-   ORD(gradient_alpha_data_set);
-   ORD(gradient_clear);
-   ORD(gradient_fill_set);
-   ORD(gradient_fill_angle_set);
-   ORD(gradient_fill_spread_set);
-   ORD(gradient_angle_set);
-   ORD(gradient_offset_set);
-   ORD(gradient_direction_set);
-   ORD(gradient_type_set);
-   ORD(gradient_is_opaque);
-   ORD(gradient_is_visible);
-   ORD(gradient_render_pre);
-   ORD(gradient_render_post);
-   ORD(gradient_draw);
    ORD(image_load);
    ORD(image_new_from_data);
    ORD(image_new_from_copied_data);
@@ -1310,14 +950,39 @@ module_open(Evas_Module *em)
    ORD(image_colorspace_get);
    ORD(image_native_set);
    ORD(image_native_get);
+#if 0 // filtering disabled
+//   ORD(image_draw_filtered);
+//   ORD(image_filtered_get);
+//   ORD(image_filtered_save);
+//   ORD(image_filtered_free);
+#endif
    ORD(font_draw);
    
    ORD(image_scale_hint_set);
    ORD(image_scale_hint_get);
    
-   ORD(image_map4_draw);
+   ORD(image_map_draw);
    ORD(image_map_surface_new);
    ORD(image_map_surface_free);
+
+//   ORD(image_content_hint_set);
+//   ORD(image_content_hint_get);
+   
+//   ORD(image_cache_flush);
+//   ORD(image_cache_set);
+//   ORD(image_cache_get);
+   
+//   ORD(gl_surface_create);
+//   ORD(gl_surface_destroy);
+//   ORD(gl_context_create);
+//   ORD(gl_context_destroy);
+//   ORD(gl_make_current);
+//   ORD(gl_proc_address_get);
+//   ORD(gl_native_surface_get);
+   
+//   ORD(gl_api_get);
+   
+   ORD(image_load_error_get);
    
    /* now advertise out own api */
    em->functions = (void *)(&func);
@@ -1328,6 +993,7 @@ static void
 module_close(Evas_Module *em)
 {
     eina_log_domain_unregister(_evas_engine_GL_SDL_log_dom);
+    evas_gl_common_module_close();
 }
 
 static Evas_Module_Api evas_modapi =
@@ -1364,7 +1030,6 @@ _sdl_output_setup         (int w, int h, int fullscreen, int noframe)
    evas_common_convert_init();
    evas_common_scale_init();
    evas_common_rectangle_init();
-   evas_common_gradient_init();
    evas_common_polygon_init();
    evas_common_line_init();
    evas_common_font_init();
@@ -1392,16 +1057,12 @@ _sdl_output_setup               (int w, int h, int fullscreen, int noframe)
 
    if (!surface)
      {
-        CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
-       CRIT("SDL: %s\n", SDL_GetError());
+        CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed. %s", w, h, SDL_GetError());
        SDL_Quit();
         exit(-1);
      }
 
-   fprintf(stderr, "Screen Depth : %d\n", SDL_GetVideoSurface()->format->BitsPerPixel);
-   fprintf(stderr, "Vendor       : %s\n", glGetString(GL_VENDOR));
-   fprintf(stderr, "Renderer     : %s\n", glGetString(GL_RENDERER));
-   fprintf(stderr, "Version      : %s\n", glGetString(GL_VERSION));
+   INF("Screen Depth: %d, Vendor: '%s', Renderer: '%s', Version: '%s'", SDL_GetVideoSurface()->format->BitsPerPixel, glGetString(GL_VENDOR), glGetString(GL_RENDERER), glGetString(GL_VERSION));
 
    re->gl_context = evas_gl_common_context_new();
    if (!re->gl_context)
@@ -1410,7 +1071,7 @@ _sdl_output_setup         (int w, int h, int fullscreen, int noframe)
        return NULL;
      }
    evas_gl_common_context_use(re->gl_context);
-   evas_gl_common_context_resize(re->gl_context, w, h);
+   evas_gl_common_context_resize(re->gl_context, w, h, re->gl_context->rot);
 
    /* End GL Initialization */
    re->w = w;