From: kakaroto Date: Mon, 23 Jul 2012 11:58:37 +0000 (+0000) Subject: Evas: Update gl_sdl, gl_cocoa, directfb and software_16_sdl engines to use the new... X-Git-Tag: submit/trunk/20120815.174732~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=179b2c8fbd54e64e2169d42a1ae5c4b9c6ffc55d;p=profile%2Fivi%2Fevas.git Evas: Update gl_sdl, gl_cocoa, directfb and software_16_sdl engines to use the new function prototype of image_map_draw The arguments for image_map_draw changed, and these engines were receiving the wrong data. In the case of gl_cocoa and gl_sdl, the gl_common would receive a pointer for 'npoints' and would call abort() because npoints is not 4. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@74321 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/engines/directfb/evas_engine.c b/src/modules/engines/directfb/evas_engine.c index 41386b2..a6dce6a 100644 --- a/src/modules/engines/directfb/evas_engine.c +++ b/src/modules/engines/directfb/evas_engine.c @@ -1554,7 +1554,7 @@ evas_engine_dfb_image_draw(void *data, void *context, void *surface, void *image #endif static void -evas_engine_dfb_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level) +evas_engine_dfb_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level) { Render_Engine *re = (Render_Engine*) data; DirectFB_Engine_Image_Entry *deie = image; @@ -1573,7 +1573,7 @@ evas_engine_dfb_image_map_draw(void *data __UNUSED__, void *context, void *surfa if (!_dfb_lock_and_sync_image(deie->surface, src, DSLF_READ)) goto error_src; - evas_common_map_rgba(src, dst, context, 4, p, smooth, level); + evas_common_map_rgba(src, dst, context, 4, &m->pts[0], smooth, level); evas_common_cpu_end_opt(); screen->Unlock(screen); diff --git a/src/modules/engines/gl_cocoa/evas_engine.c b/src/modules/engines/gl_cocoa/evas_engine.c index 32d8bf6..245de0f 100644 --- a/src/modules/engines/gl_cocoa/evas_engine.c +++ b/src/modules/engines/gl_cocoa/evas_engine.c @@ -918,7 +918,7 @@ eng_image_scale_hint_get(void *data __UNUSED__, void *image) } static void -eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level) +eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level) { Evas_GL_Image *gim = image; Render_Engine *re; @@ -928,42 +928,42 @@ eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *im eng_window_use(re->win); evas_gl_common_context_target_surface_set(re->win->gl_context, surface); re->win->gl_context->dc = context; - if (npoints != 4) + if (m->count != 4) { - // FIXME: nash - you didnt fix this + // FIXME: nash - you didn't fix this abort(); } - if ((p[0].x == p[3].x) && - (p[1].x == p[2].x) && - (p[0].y == p[1].y) && - (p[3].y == p[2].y) && - (p[0].x <= p[1].x) && - (p[0].y <= p[2].y) && - (p[0].u == 0) && - (p[0].v == 0) && - (p[1].u == (gim->w << FP)) && - (p[1].v == 0) && - (p[2].u == (gim->w << FP)) && - (p[2].v == (gim->h << FP)) && - (p[3].u == 0) && - (p[3].v == (gim->h << FP)) && - (p[0].col == 0xffffffff) && - (p[1].col == 0xffffffff) && - (p[2].col == 0xffffffff) && - (p[3].col == 0xffffffff)) + if ((m->pts[0].x == m->pts[3].x) && + (m->pts[1].x == m->pts[2].x) && + (m->pts[0].y == m->pts[1].y) && + (m->pts[3].y == m->pts[2].y) && + (m->pts[0].x <= m->pts[1].x) && + (m->pts[0].y <= m->pts[2].y) && + (m->pts[0].u == 0) && + (m->pts[0].v == 0) && + (m->pts[1].u == (gim->w << FP)) && + (m->pts[1].v == 0) && + (m->pts[2].u == (gim->w << FP)) && + (m->pts[2].v == (gim->h << FP)) && + (m->pts[3].u == 0) && + (m->pts[3].v == (gim->h << FP)) && + (m->pts[0].col == 0xffffffff) && + (m->pts[1].col == 0xffffffff) && + (m->pts[2].col == 0xffffffff) && + (m->pts[3].col == 0xffffffff)) { int dx, dy, dw, dh; - - dx = p[0].x >> FP; - dy = p[0].y >> FP; - dw = (p[2].x >> FP) - dx; - dh = (p[2].y >> FP) - dy; + + dx = m->pts[0].x >> FP; + dy = m->pts[0].y >> FP; + dw = (m->pts[2].x >> FP) - dx; + dh = (m->pts[2].y >> FP) - dy; eng_image_draw(data, context, surface, image, 0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth); } else { - evas_gl_common_image_map_draw(re->win->gl_context, image, npoints, p, + evas_gl_common_image_map_draw(re->win->gl_context, image, m->count, &m->pts[0], smooth, level); } } diff --git a/src/modules/engines/gl_sdl/evas_engine.c b/src/modules/engines/gl_sdl/evas_engine.c index f822f3a..b8ed520 100644 --- a/src/modules/engines/gl_sdl/evas_engine.c +++ b/src/modules/engines/gl_sdl/evas_engine.c @@ -810,14 +810,52 @@ eng_image_scale_hint_set(void *data __UNUSED__, void *image, int hint) } static void -eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level) +eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level) { + Evas_GL_Image *gim = image; 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_map_draw(re->gl_context, image, npoints, p, smooth, level); + if (m->count != 4) + { + // FIXME: nash - you didn't fix this + abort(); + } + if ((m->pts[0].x == m->pts[3].x) && + (m->pts[1].x == m->pts[2].x) && + (m->pts[0].y == m->pts[1].y) && + (m->pts[3].y == m->pts[2].y) && + (m->pts[0].x <= m->pts[1].x) && + (m->pts[0].y <= m->pts[2].y) && + (m->pts[0].u == 0) && + (m->pts[0].v == 0) && + (m->pts[1].u == (gim->w << FP)) && + (m->pts[1].v == 0) && + (m->pts[2].u == (gim->w << FP)) && + (m->pts[2].v == (gim->h << FP)) && + (m->pts[3].u == 0) && + (m->pts[3].v == (gim->h << FP)) && + (m->pts[0].col == 0xffffffff) && + (m->pts[1].col == 0xffffffff) && + (m->pts[2].col == 0xffffffff) && + (m->pts[3].col == 0xffffffff)) + { + int dx, dy, dw, dh; + + dx = m->pts[0].x >> FP; + dy = m->pts[0].y >> FP; + dw = (m->pts[2].x >> FP) - dx; + dh = (m->pts[2].y >> FP) - dy; + eng_image_draw(data, context, surface, image, + 0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth); + } + else + { + evas_gl_common_image_map_draw(re->gl_context, image, m->count, &m->pts[0], + smooth, level); + } } static void * diff --git a/src/modules/engines/software_16_sdl/evas_engine.c b/src/modules/engines/software_16_sdl/evas_engine.c index d94b5a0..bdd731a 100644 --- a/src/modules/engines/software_16_sdl/evas_engine.c +++ b/src/modules/engines/software_16_sdl/evas_engine.c @@ -842,7 +842,7 @@ evas_engine_sdl16_image_draw(void *data __UNUSED__, void *context, void *surface } static void -evas_engine_sdl16_image_map_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *image __UNUSED__, int npoints __UNUSED__, RGBA_Map_Point *p __UNUSED__, int smooth __UNUSED__, int level __UNUSED__) +evas_engine_sdl16_image_map_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *image __UNUSED__, RGBA_Map *m __UNUSED__, int smooth __UNUSED__, int level __UNUSED__) { }