Skip to content

Commit

Permalink
Ecore-evas: Add support for gl-psl1ght engine
Browse files Browse the repository at this point in the history
  • Loading branch information
kakaroto committed Sep 13, 2012
1 parent bd4b5d6 commit 1e52d66
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 6 deletions.
13 changes: 12 additions & 1 deletion ecore/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ want_ecore_evas_software_sdl="no"
want_ecore_evas_gl_sdl="no"
want_ecore_evas_gl_cocoa="no"
want_ecore_evas_psl1ght="no"
want_ecore_evas_gl_psl1ght="no"
want_ecore_evas_directfb="no"
want_ecore_evas_fb="no"
want_ecore_evas_software_16_wince="no"
Expand Down Expand Up @@ -476,6 +477,7 @@ case "$host_vendor" in
requirements_ecore_sdl="escape ${requirements_ecore_sdl}"
want_ecore_psl1ght="yes"
want_ecore_evas_psl1ght="yes"
want_ecore_evas_gl_psl1ght="yes"
;;
esac

Expand Down Expand Up @@ -560,7 +562,7 @@ requirements_ecore_input_evas="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_eco
requirements_ecore_ipc="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_ipc}"
requirements_ecore_cocoa="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_cocoa}"
requirements_ecore_sdl="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_sdl}"
requirements_ecore_psl1ght="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_sdl}"
requirements_ecore_psl1ght="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_psl1ght}"
requirements_ecore_win32="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_win32}"
requirements_ecore_wince="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_wince}"
requirements_ecore_x="ecore >= 1.6.99 eina >= 1.6.99 ${requirements_ecore_x}"
Expand Down Expand Up @@ -1960,6 +1962,14 @@ ECORE_EVAS_CHECK_MODULE([psl1ght],
[${have_ecore_psl1ght}],
[requirements_ecore_evas="ecore-psl1ght >= 1.6.99 ${requirements_ecore_evas}"])

# ecore_evas_gl_psl1ght

ECORE_EVAS_CHECK_MODULE([gl-psl1ght],
[${want_ecore_evas_gl_psl1ght}],
[GL_PSL1GHT],
[${have_ecore_psl1ght}],
[requirements_ecore_evas="ecore-psl1ght >= 1.6.99 ${requirements_ecore_evas}"])

### WAYLAND

ecore_wayland_deps="no"
Expand Down Expand Up @@ -2240,6 +2250,7 @@ if test "x${have_ecore_evas}" = "xyes" ; then
echo " OpenGL Cocoa...............: $have_ecore_evas_opengl_cocoa"
echo " DirectFB...................: $have_ecore_evas_directfb"
echo " PSL1GHT....................: $have_ecore_evas_psl1ght"
echo " RSXGL PSL1GHT..............: $have_ecore_evas_gl_psl1ght"
echo " Software Framebuffer.......: $have_ecore_evas_fb"
echo " Software 8bit grayscale XCB: $have_ecore_evas_software_8_x11"
echo " Software 16bit X11.........: $have_ecore_evas_software_16_x11"
Expand Down
5 changes: 4 additions & 1 deletion ecore/src/lib/ecore_evas/Ecore_Evas.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ extern "C" {
#define HAVE_ECORE_EVAS_WINCE 1
#define HAVE_ECORE_EVAS_EWS 1
#define HAVE_ECORE_EVAS_PSL1GHT 1
#define HAVE_ECORE_EVAS_GL_PSL1GHT 1
#define HAVE_ECORE_EVAS_WAYLAND_SHM 1
#define HAVE_ECORE_EVAS_WAYLAND_EGL 1

Expand Down Expand Up @@ -127,7 +128,8 @@ typedef enum _Ecore_Evas_Engine_Type
ECORE_EVAS_ENGINE_EWS,
ECORE_EVAS_ENGINE_PSL1GHT,
ECORE_EVAS_ENGINE_WAYLAND_SHM,
ECORE_EVAS_ENGINE_WAYLAND_EGL
ECORE_EVAS_ENGINE_WAYLAND_EGL,
ECORE_EVAS_ENGINE_GL_PSL1GHT
} Ecore_Evas_Engine_Type;

typedef enum _Ecore_Evas_Avoid_Damage_Type
Expand Down Expand Up @@ -1179,6 +1181,7 @@ EAPI Ecore_Evas *ecore_evas_cocoa_new(Ecore_Cocoa_Window *parent,
int h);

EAPI Ecore_Evas *ecore_evas_psl1ght_new(const char* name, int w, int h);
EAPI Ecore_Evas *ecore_evas_gl_psl1ght_new(const char* name, int w, int h);


/* generic manipulation calls */
Expand Down
25 changes: 25 additions & 0 deletions ecore/src/lib/ecore_evas/ecore_evas.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
return EINA_TRUE;
#else
return EINA_FALSE;
#endif
case ECORE_EVAS_ENGINE_GL_PSL1GHT:
#ifdef BUILD_ECORE_EVAS_GL_PSL1GHT
return EINA_TRUE;
#else
return EINA_FALSE;
#endif
case ECORE_EVAS_ENGINE_WAYLAND_SHM:
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
Expand Down Expand Up @@ -601,6 +607,22 @@ _ecore_evas_constructor_psl1ght(int x __UNUSED__, int y __UNUSED__, int w, int h
}
#endif

#ifdef BUILD_ECORE_EVAS_GL_PSL1GHT
static Ecore_Evas *
_ecore_evas_constructor_gl_psl1ght(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
{
Ecore_Evas *ee;
char *name = NULL;

_ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
ee = ecore_evas_gl_psl1ght_new(name, w, h);
free(name);

if (ee) ecore_evas_move(ee, x, y);
return ee;
}
#endif

#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
static Ecore_Evas *
_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
Expand Down Expand Up @@ -770,6 +792,9 @@ static const struct ecore_evas_engine _engines[] = {
#endif

/* PS3 support */
#ifdef BUILD_ECORE_EVAS_PSL1GHT
{"gl_psl1ght", _ecore_evas_constructor_gl_psl1ght},
#endif
#ifdef BUILD_ECORE_EVAS_PSL1GHT
{"psl1ght", _ecore_evas_constructor_psl1ght},
#endif
Expand Down
28 changes: 24 additions & 4 deletions ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static Ecore_Event_Handler *ecore_evas_event_handlers[5] = {
};

static const char *ecore_evas_psl1ght_default = "EFL PSL1GHT";
static const char *ecore_evas_gl_psl1ght_default = "EFL RSXGL PSL1GHT";
static int _ecore_evas_fps_debug = 0;
static Ecore_Poller *ecore_evas_event;

Expand Down Expand Up @@ -409,8 +410,8 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
NULL // screen_dpi_get
};

EAPI Ecore_Evas *
ecore_evas_psl1ght_new(const char *name, int w, int h)
static Ecore_Evas *
_ecore_evas_psl1ght_new(const char *name, const char *engine, int w, int h)
{
void *einfo;
Ecore_Evas *ee;
Expand All @@ -425,7 +426,7 @@ ecore_evas_psl1ght_new(const char *name, int w, int h)

ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_psl1ght_engine_func;

ee->driver = "psl1ght";
ee->driver = engine;
if (name) ee->name = strdup(name);

if (w < 1) w = 1;
Expand All @@ -449,7 +450,7 @@ ecore_evas_psl1ght_new(const char *name, int w, int h)
/* init evas here */
ee->evas = evas_new();
evas_data_attach_set(ee->evas, ee);
evas_output_method_set(ee->evas, evas_render_method_lookup("psl1ght"));
evas_output_method_set(ee->evas, evas_render_method_lookup(engine));

evas_output_size_set(ee->evas, w, h);
evas_output_viewport_set(ee->evas, 0, 0, w, h);
Expand Down Expand Up @@ -503,6 +504,18 @@ ecore_evas_psl1ght_new(const char *name, int w, int h)
return ee;
}

EAPI Ecore_Evas *
ecore_evas_psl1ght_new(const char *name, int w, int h)
{
return _ecore_evas_psl1ght_new (name, "psl1ght", w, h);
}

EAPI Ecore_Evas *
ecore_evas_gl_psl1ght_new(const char *name, int w, int h)
{
return _ecore_evas_psl1ght_new (name, "gl_psl1ght", w, h);
}

#else /* BUILD_ECORE_EVAS_PSL1GHT */

EAPI Ecore_Evas *
Expand All @@ -512,4 +525,11 @@ ecore_evas_psl1ght_new(const char *name __UNUSED__, int w __UNUSED__, int h __UN
return NULL;
}

EAPI Ecore_Evas *
ecore_evas_gl_psl1ght_new(const char *name __UNUSED__, int w __UNUSED__, int h __UNUSED__)
{
ERR("OUTCH !");
return NULL;
}

#endif /* BUILD_ECORE_EVAS_PSL1GHT */

0 comments on commit 1e52d66

Please sign in to comment.