* evas: Fix SDL map usage (raster edje map test is working :-) ).
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 17 Feb 2010 15:22:58 +0000 (15:22 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 17 Feb 2010 15:22:58 +0000 (15:22 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@46247 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/software_sdl/evas_engine.c

index 33d6f7f..dff1c23 100644 (file)
@@ -642,7 +642,8 @@ evas_engine_sdl_image_map4_draw(void *data __UNUSED__, void *context, void *surf
        _SDL_UPDATE_PIXELS(eim);
      }
 
-   evas_common_map4_rgba(eim->cache_entry.src, dst->cache_entry.src, context, p, smooth, level);
+   evas_common_map4_rgba((RGBA_Image*) eim->cache_entry.src,
+                        (RGBA_Image*) dst->cache_entry.src, context, p, smooth, level);
    evas_common_cpu_end_opt();
 
    if (mustlock_im)
@@ -652,15 +653,44 @@ evas_engine_sdl_image_map4_draw(void *data __UNUSED__, void *context, void *surf
      SDL_UnlockSurface(dst->surface);
 }
 
+static void *
+evas_engine_sdl_image_map_surface_new(void *data, int w, int h, int alpha)
+{
+   Render_Engine *re = (Render_Engine*) data;
+   void *surface;
+   DATA32 *pixels;
+
+   surface = evas_cache_engine_image_copied_data(re->cache,
+                                                w, h, NULL, alpha,
+                                                EVAS_COLORSPACE_ARGB8888,
+                                                NULL);
+   return surface;
+}
+
+static void
+evas_engine_sdl_image_map_surface_free(void *data __UNUSED__, void *surface)
+{
+   evas_cache_engine_image_drop(surface);
+}
+
 static void
 evas_engine_sdl_image_scale_hint_set(void *data __UNUSED__, void *image, int hint)
 {
+   SDL_Engine_Image_Entry *eim;
+
+   if (!image) return ;
+   eim = image;
+   eim->cache_entry.src->scale_hint = hint;
 }
 
 static int
 evas_engine_sdl_image_scale_hint_get(void *data __UNUSED__, void *image)
 {
-   return EVAS_IMAGE_SCALE_HINT_NONE;
+   SDL_Engine_Image_Entry *eim;
+
+   if (!image) return EVAS_IMAGE_SCALE_HINT_NONE;
+   eim = image;
+   return eim->cache_entry.src->scale_hint;
 }
 
 static void
@@ -895,6 +925,8 @@ static int module_open(Evas_Module *em)
    ORD(image_border_get);
    ORD(image_draw);
    ORD(image_map4_draw);
+   ORD(image_map_surface_new);
+   ORD(image_map_surface_free);
    ORD(image_comment_get);
    ORD(image_format_get);
    ORD(image_cache_flush);