summaryrefslogtreecommitdiff
path: root/ivi-layermanagement-examples
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>2014-03-04 14:27:37 +0900
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>2014-03-04 17:19:11 +0900
commit984d7844a07102900b7690b5e37d6d0d3dbba17b (patch)
tree1d661be5e73a5b279f802a741bdbda34f27c0c4d /ivi-layermanagement-examples
parent30f6e581c544d40a6b457614759b29a5fd4c4923 (diff)
downloadwayland-ivi-extension-984d7844a07102900b7690b5e37d6d0d3dbba17b.tar.gz
Suppoting only ivi-application to get ivi_surface, not supporting wl_shell.
-The ivi-application protocol is sufficient for ivi style shell. -Removing layer creation. This means creating a Layer and add surface of MockNavigation to the layer by e.g. LayerManagerControl to visible it. Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Diffstat (limited to 'ivi-layermanagement-examples')
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/include/OpenGLES2App.h4
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp39
-rw-r--r--ivi-layermanagement-examples/EGLWLMockNavigation/src/main.cpp12
3 files changed, 12 insertions, 43 deletions
diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/include/OpenGLES2App.h b/ivi-layermanagement-examples/EGLWLMockNavigation/include/OpenGLES2App.h
index 2f50a7f..fbc69a6 100644
--- a/ivi-layermanagement-examples/EGLWLMockNavigation/include/OpenGLES2App.h
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/include/OpenGLES2App.h
@@ -29,12 +29,9 @@
struct SurfaceConfiguration
{
- unsigned int layerId;
unsigned int surfaceId;
unsigned int surfaceWidth;
unsigned int surfaceHeight;
- unsigned int surfacePosX;
- unsigned int surfacePosY;
float opacity;
bool nosky;
};
@@ -103,7 +100,6 @@ public:
protected:
WLContextStruct m_wlContextStruct;
- t_ilm_layer m_layerId;
t_ilm_surface m_surfaceId;
};
diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp b/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp
index abc170b..3aec32c 100644
--- a/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp
@@ -122,7 +122,6 @@ OpenGLES2App::OpenGLES2App(float fps, float animationSpeed, SurfaceConfiguration
: m_framesPerSecond(fps)
, m_animationSpeed(animationSpeed)
, m_timerIntervalInMs(1000.0 / m_framesPerSecond)
-, m_layerId(0)
, m_surfaceId(0)
{
createWLContext(config);
@@ -153,7 +152,6 @@ OpenGLES2App::~OpenGLES2App()
destroyWLContext();
ilm_surfaceRemove(m_surfaceId);
- ilm_layerRemove(m_layerId);
ilm_destroy();
}
@@ -213,17 +211,16 @@ bool OpenGLES2App::createWLContext(SurfaceConfiguration* config)
destroyWLContext();
}
- m_wlContextStruct.wlShellSurface = wl_shell_get_shell_surface(m_wlContextStruct.wlShell,
- m_wlContextStruct.wlSurface);
- if (NULL == m_wlContextStruct.wlShellSurface)
- {
- cout << "Error: wl_shell_get_shell_surface() failed.\n";
- destroyWLContext();
+ if (m_wlContextStruct.wlShell) {
+ m_wlContextStruct.wlShellSurface = wl_shell_get_shell_surface(m_wlContextStruct.wlShell,
+ m_wlContextStruct.wlSurface);
}
- wl_shell_surface_add_listener(
- reinterpret_cast<struct wl_shell_surface*>(m_wlContextStruct.wlShellSurface),
- &shellSurfaceListener, &m_wlContextStruct);
+ if (m_wlContextStruct.wlShellSurface) {
+ wl_shell_surface_add_listener(
+ reinterpret_cast<struct wl_shell_surface*>(m_wlContextStruct.wlShellSurface),
+ &shellSurfaceListener, &m_wlContextStruct);
+ }
m_wlContextStruct.wlNativeWindow = wl_egl_window_create(m_wlContextStruct.wlSurface, width, height);
if (NULL == m_wlContextStruct.wlNativeWindow)
@@ -232,8 +229,10 @@ bool OpenGLES2App::createWLContext(SurfaceConfiguration* config)
destroyWLContext();
}
- wl_shell_surface_set_title(m_wlContextStruct.wlShellSurface, "mocknavi");
- wl_shell_surface_set_toplevel(m_wlContextStruct.wlShellSurface);
+ if (m_wlContextStruct.wlShellSurface) {
+ wl_shell_surface_set_title(m_wlContextStruct.wlShellSurface, "mocknavi");
+ wl_shell_surface_set_toplevel(m_wlContextStruct.wlShellSurface);
+ }
return result;
}
@@ -324,12 +323,9 @@ ilmErrorTypes OpenGLES2App::setupLayerMangement(SurfaceConfiguration* config)
ilmErrorTypes error = ILM_FAILED;
// register surfaces to layermanager
- t_ilm_layer layerid = (t_ilm_layer)config->layerId;//LAYER_EXAMPLE_GLES_APPLICATIONS;
t_ilm_surface surfaceid = (t_ilm_surface)config->surfaceId;//SURFACE_EXAMPLE_EGLX11_APPLICATION;
int width = config->surfaceWidth;
int height = config->surfaceHeight;
- int posX = config->surfacePosX;
- int posY = config->surfacePosY;
float opacity = config->opacity;
if (config->nosky)
@@ -341,12 +337,6 @@ ilmErrorTypes OpenGLES2App::setupLayerMangement(SurfaceConfiguration* config)
glClearColor(0.2f, 0.2f, 0.5f, 1.0f);
}
- ilm_layerCreateWithDimension(&layerid, width, height);
- ilm_layerSetSourceRectangle(layerid, 0, 0, width, height);
- ilm_layerSetDestinationRectangle(layerid, posX, posY, width, height);
- ilm_layerSetVisibility(layerid, ILM_TRUE);
- ilm_layerSetOpacity(layerid, opacity);
-
ilm_surfaceCreate((t_ilm_nativehandle)m_wlContextStruct.wlSurface, width, height,
ILM_PIXELFORMAT_RGBA_8888, &surfaceid);
@@ -360,15 +350,10 @@ ilmErrorTypes OpenGLES2App::setupLayerMangement(SurfaceConfiguration* config)
cout << "Set surface " << surfaceid << " opacity " << opacity << "\n";
ilm_surfaceSetOpacity(surfaceid, opacity);
- cout << "add surface " << surfaceid << " to layer " << layerid << "\n";
- error = ilm_layerAddSurface(layerid, surfaceid);
- ilm_displaySetRenderOrder(0, &layerid, 1);
-
cout << "commit\n";
error = ilm_commitChanges();
m_surfaceId = surfaceid;
- m_layerId = layerid;
return error;
}
diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/src/main.cpp b/ivi-layermanagement-examples/EGLWLMockNavigation/src/main.cpp
index 751fd69..0a6260f 100644
--- a/ivi-layermanagement-examples/EGLWLMockNavigation/src/main.cpp
+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/src/main.cpp
@@ -26,12 +26,9 @@ using std::cout;
#define DEFAULT_FPS 30.0
#define DEFAULT_ANIM 1.0
-#define DEFAULT_LAYER LAYER_EXAMPLE_GLES_APPLICATIONS
#define DEFAULT_SURFACE SURFACE_EXAMPLE_EGLX11_APPLICATION
#define DEFAULT_WIDTH 800
#define DEFAULT_HEIGHT 480
-#define DEFAULT_POS_X 0
-#define DEFAULT_POS_Y 0
#define DEFAULT_OPACITY 1.0
#define DEFAULT_NOSKY false
#define DEFAULT_HELP false
@@ -41,11 +38,8 @@ int main (int argc, const char * argv[])
FloatArgument fps("fps", DEFAULT_FPS, argc, argv);
FloatArgument animSpeed("anim", DEFAULT_ANIM, argc, argv);
UnsignedIntArgument surfaceId("surface", DEFAULT_SURFACE, argc, argv);
- UnsignedIntArgument layerId("layer", DEFAULT_LAYER, argc, argv);
IntArgument width("width", DEFAULT_WIDTH, argc, argv);
IntArgument height("height", DEFAULT_HEIGHT, argc, argv);
- IntArgument posx("posx", DEFAULT_POS_X, argc, argv);
- IntArgument posy("posy", DEFAULT_POS_Y, argc, argv);
FloatArgument opacity("opacity", DEFAULT_OPACITY, argc, argv);
BoolArgument nosky("nosky", DEFAULT_NOSKY, argc, argv);
BoolArgument help("help", DEFAULT_HELP, argc, argv);
@@ -59,22 +53,16 @@ int main (int argc, const char * argv[])
<< " -anim x set animation speed (default " << DEFAULT_ANIM << ")\n"
<< " -nosky do not render sky, background transparent (default " << DEFAULT_NOSKY << ")\n"
<< " -surface x render to surface id x (default " << DEFAULT_SURFACE << ")\n"
- << " -layer x add surface to layer x (default " << DEFAULT_LAYER << ")\n"
<< " -width x set surface width to x (default " << DEFAULT_WIDTH << ")\n"
<< " -height x set surface height to x (default " << DEFAULT_HEIGHT << ")\n"
- << " -posx x set surface x position on layer to x (default " << DEFAULT_POS_X << ")\n"
- << " -posy x set surface y position on layer to x (default " << DEFAULT_POS_Y << ")\n"
<< " -opacity x set opacity of surface to x (default " << DEFAULT_OPACITY << ")\n\n";
}
else
{
SurfaceConfiguration config;
- config.layerId = layerId.get();
config.surfaceId = surfaceId.get();
config.surfaceWidth = width.get();
config.surfaceHeight = height.get();
- config.surfacePosX = posx.get();
- config.surfacePosY = posy.get();
config.opacity = opacity.get();
config.nosky = nosky.get();