Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/12'
Browse files Browse the repository at this point in the history
* upstream/pull/12
  LayerManagerControl: remove surface create and destroy api's

  Reviewed-by: Emre Ucan <[email protected]>
  • Loading branch information
Eugen Friedrich committed Nov 18, 2016
2 parents 6bf6024 + 527379b commit 0ad95c6
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 0ad95c6

Please sign in to comment.