Skip to content

Commit

Permalink
LayerManagerControl: remove surface create and destroy api's
Browse files Browse the repository at this point in the history
api's never worked and would even cause exception in LayerManagerControl tool
surface can only be created with native content and native content is
wayland-surface which is only available in the client.
So it does not make any sense to provide this functionality to external tool.
For surface destroy it is very similar issue, we can only destroy surfaces
which were created in the same client, but this is never the case by using
LayerManagerControl- every call will create new connection and therefore new client

Signed-off-by: Eugen Friedrich <[email protected]>
  • Loading branch information
Eugen Friedrich committed Nov 18, 2016
1 parent cabf707 commit 527379b
Showing 1 changed file with 4 additions and 38 deletions.
42 changes: 4 additions & 38 deletions ivi-layermanagement-examples/LayerManagerControl/src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,52 +621,18 @@ COMMAND("create layer <layerid> <width> <height>")
}

//=============================================================================
COMMAND("create surface <surfaceid> <nativehandle> <width> <height> <pixelformat>")
COMMAND("destroy layer <id>")
//=============================================================================
{
unsigned int surfaceid = input->getUint("surfaceid");
unsigned int nativeHandle = input->getUint("nativehandle");
unsigned int width = input->getUint("width");
unsigned int height = input->getUint("height");
e_ilmPixelFormat pixelformat = (e_ilmPixelFormat)input->getUint("pixelformat");
unsigned int layerid = input->getUint("id");

ilmErrorTypes callResult = ilm_surfaceCreate(nativeHandle, width, height, pixelformat, &surfaceid);
ilmErrorTypes callResult = ilm_layerRemove(layerid);
if (ILM_SUCCESS != callResult)
{
cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
cout << "Failed to create surface with ID " << surfaceid << "\n";
cout << "Failed to remove layer with ID " << layerid << "\n";
return;
}
}

//=============================================================================
COMMAND("destroy layer|surface <id>")
//=============================================================================
{
if (input->contains("layer"))
{
unsigned int layerid = input->getUint("id");

ilmErrorTypes callResult = ilm_layerRemove(layerid);
if (ILM_SUCCESS != callResult)
{
cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
cout << "Failed to remove layer with ID " << layerid << "\n";
return;
}
}
else if (input->contains("surface"))
{
unsigned int surfaceid = input->getUint("id");

ilmErrorTypes callResult = ilm_surfaceRemove(surfaceid);
if (ILM_SUCCESS != callResult)
{
cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
cout << "Failed to remove surface with ID " << surfaceid << "\n";
return;
}
}

ilm_commitChanges();
}
Expand Down

0 comments on commit 527379b

Please sign in to comment.