X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwm_layer_control.cpp;h=1d591f0a78c5935fb958d540cdb2f05e7589d613;hb=516f8db80ee3c9d935c9f42468d9bdd6a05b67de;hp=1da5a0185801075e13eff5832510fa151a97e8a4;hpb=359f7cd7b49d714bc7cce3fc702c353455a5f168;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp index 1da5a01..1d591f0 100644 --- a/src/wm_layer_control.cpp +++ b/src/wm_layer_control.cpp @@ -125,8 +125,11 @@ void LayerControl::createNewLayer(unsigned id) ilm_layerSetSourceRectangle(id, rct.x, rct.y, rct.w, rct.h); //ilm_layerSetDestinationRectangle(id, rct.x, rct.y, rct.w, rct.h); ilm_layerSetOpacity(id, 1.0); - ilm_layerSetVisibility(id, ILM_TRUE); + ilm_layerSetVisibility(id, ILM_FALSE); ilm_commitChanges(); + auto wm_layer = getWMLayer(id); + wm_layer->addLayer(id); + this->commitChange(); } unsigned LayerControl::getNewLayerID(const string& role, string* layer_name) @@ -138,12 +141,20 @@ unsigned LayerControl::getNewLayerID(const string& role, string* layer_name) if(ret != 0) { *layer_name = l->layerName(); + unsigned uid = l->getUuid(); + this->lid2wmlid[ret] = uid; break; } } return ret; } +shared_ptr LayerControl::getWMLayer(unsigned layer) +{ + unsigned uuid = this->lid2wmlid[layer]; + return this->wm_layers[uuid]; +} + struct rect LayerControl::getAreaSize(const std::string& area) { return area2size[area]; @@ -187,9 +198,10 @@ WMError LayerControl::updateLayer(LayerState& layer_state) WMError LayerControl::commitChange() { + HMI_INFO("Commit change"); WMError rc = WMError::SUCCESS; vector ivi_l_ids; - for(const auto& l : this->wm_layers) + for(auto& l : this->wm_layers) { auto state = l->getLayerState(); for(const auto& id : state.getIviIdList()) @@ -208,6 +220,7 @@ WMError LayerControl::commitChange() for(const auto& i : ivi_l_ids) { id_array[count] = i; + HMI_DEBUG("check render order %d", i); ++count; } @@ -217,6 +230,7 @@ WMError LayerControl::commitChange() this->undoUpdate(); rc = WMError::FAIL; } + ilm_commitChanges(); delete id_array; return rc; } @@ -250,8 +264,9 @@ WMError LayerControl::loadLayerSetting(const string &path) json_object *json_tmp = json_object_array_get_idx(json_cfg, i); HMI_DEBUG("> json_tmp dump:%s", json_object_get_string(json_tmp)); - this->wm_layers.emplace_back(std::make_shared(json_tmp)); + this->wm_layers.emplace_back(std::make_shared(json_tmp, i)); } + json_object_put(json_obj); return WMError::SUCCESS; } @@ -380,7 +395,6 @@ WMError LayerControl::visibilityChange(const WMAction& action) void LayerControl::dispatchCreateEvent(ilmObjectType object, unsigned id, bool created) { - this->cb.test(id); if (ILM_SURFACE == object) { if (created) @@ -393,6 +407,7 @@ void LayerControl::dispatchCreateEvent(ilmObjectType object, unsigned id, bool c this->cb.surfaceCreated(sp.creatorPid, id); ilm_surfaceAddNotification(id, surfaceCallback_static); ilm_surfaceSetSourceRectangle(id, 0, 0, sp.origSourceWidth, sp.origSourceHeight); + ilm_surfaceSetVisibility(id, ILM_TRUE); } else {