forked from enlightenment/efl
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. SVN revision: 74321
This commit is contained in:
parent
de6cfa77b3
commit
cedbafac14
|
@ -1554,7 +1554,7 @@ evas_engine_dfb_image_draw(void *data, void *context, void *surface, void *image
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
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;
|
Render_Engine *re = (Render_Engine*) data;
|
||||||
DirectFB_Engine_Image_Entry *deie = image;
|
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))
|
if (!_dfb_lock_and_sync_image(deie->surface, src, DSLF_READ))
|
||||||
goto error_src;
|
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();
|
evas_common_cpu_end_opt();
|
||||||
|
|
||||||
screen->Unlock(screen);
|
screen->Unlock(screen);
|
||||||
|
|
|
@ -918,7 +918,7 @@ eng_image_scale_hint_get(void *data __UNUSED__, void *image)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
Evas_GL_Image *gim = image;
|
||||||
Render_Engine *re;
|
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);
|
eng_window_use(re->win);
|
||||||
evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
|
evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
|
||||||
re->win->gl_context->dc = context;
|
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();
|
abort();
|
||||||
}
|
}
|
||||||
if ((p[0].x == p[3].x) &&
|
if ((m->pts[0].x == m->pts[3].x) &&
|
||||||
(p[1].x == p[2].x) &&
|
(m->pts[1].x == m->pts[2].x) &&
|
||||||
(p[0].y == p[1].y) &&
|
(m->pts[0].y == m->pts[1].y) &&
|
||||||
(p[3].y == p[2].y) &&
|
(m->pts[3].y == m->pts[2].y) &&
|
||||||
(p[0].x <= p[1].x) &&
|
(m->pts[0].x <= m->pts[1].x) &&
|
||||||
(p[0].y <= p[2].y) &&
|
(m->pts[0].y <= m->pts[2].y) &&
|
||||||
(p[0].u == 0) &&
|
(m->pts[0].u == 0) &&
|
||||||
(p[0].v == 0) &&
|
(m->pts[0].v == 0) &&
|
||||||
(p[1].u == (gim->w << FP)) &&
|
(m->pts[1].u == (gim->w << FP)) &&
|
||||||
(p[1].v == 0) &&
|
(m->pts[1].v == 0) &&
|
||||||
(p[2].u == (gim->w << FP)) &&
|
(m->pts[2].u == (gim->w << FP)) &&
|
||||||
(p[2].v == (gim->h << FP)) &&
|
(m->pts[2].v == (gim->h << FP)) &&
|
||||||
(p[3].u == 0) &&
|
(m->pts[3].u == 0) &&
|
||||||
(p[3].v == (gim->h << FP)) &&
|
(m->pts[3].v == (gim->h << FP)) &&
|
||||||
(p[0].col == 0xffffffff) &&
|
(m->pts[0].col == 0xffffffff) &&
|
||||||
(p[1].col == 0xffffffff) &&
|
(m->pts[1].col == 0xffffffff) &&
|
||||||
(p[2].col == 0xffffffff) &&
|
(m->pts[2].col == 0xffffffff) &&
|
||||||
(p[3].col == 0xffffffff))
|
(m->pts[3].col == 0xffffffff))
|
||||||
{
|
{
|
||||||
int dx, dy, dw, dh;
|
int dx, dy, dw, dh;
|
||||||
|
|
||||||
dx = p[0].x >> FP;
|
dx = m->pts[0].x >> FP;
|
||||||
dy = p[0].y >> FP;
|
dy = m->pts[0].y >> FP;
|
||||||
dw = (p[2].x >> FP) - dx;
|
dw = (m->pts[2].x >> FP) - dx;
|
||||||
dh = (p[2].y >> FP) - dy;
|
dh = (m->pts[2].y >> FP) - dy;
|
||||||
eng_image_draw(data, context, surface, image,
|
eng_image_draw(data, context, surface, image,
|
||||||
0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth);
|
0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth);
|
||||||
}
|
}
|
||||||
else
|
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);
|
smooth, level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -810,14 +810,52 @@ eng_image_scale_hint_set(void *data __UNUSED__, void *image, int hint)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
Render_Engine *re;
|
||||||
|
|
||||||
re = (Render_Engine *)data;
|
re = (Render_Engine *)data;
|
||||||
evas_gl_common_context_target_surface_set(re->gl_context, surface);
|
evas_gl_common_context_target_surface_set(re->gl_context, surface);
|
||||||
re->gl_context->dc = context;
|
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 *
|
static void *
|
||||||
|
|
|
@ -842,7 +842,7 @@ evas_engine_sdl16_image_draw(void *data __UNUSED__, void *context, void *surface
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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__)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue