aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-06-18 19:25:31 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-06-18 19:25:31 +0900
commitc06c6004c9a9ca6d0e5a45461bfd3730b584422c (patch)
tree3cc034f90b2ba22ef1558a4d6379a22df9696570 /src
parent76a933a557531b92d2802c4fbae8205bb8d68faf (diff)
Remove unnecesarry member variable: role2surfaceid_
Change-Id: Ia90c9f903e818ab9791648627206f39483be9fdc Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/app.cpp20
-rw-r--r--src/app.hpp1
2 files changed, 8 insertions, 13 deletions
diff --git a/src/app.cpp b/src/app.cpp
index d5fa3b4..c611501 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -813,9 +813,6 @@ result<int> App::api_request_surface(char const *drawing_name) {
HMI_DEBUG("wm", "Set main_surface id to %u", id);
}
- // Set map of (role, surface_id)
- this->role2surfaceid_[role] = id;
-
// Set map of (role, drawing_name)
this->role2drawingname_[role] = std::string(drawing_name);
@@ -1047,22 +1044,21 @@ void App::setSurfaceSize(const char* role, const char* area) {
compositor::rect size = this->lm_.getAreaSize(area);
// Set destination to the display rectangle
- int surface_id = this->role2surfaceid_[role];
-
- if (!this->controller->surface_exists(surface_id)) {
+ auto const &surface_id = this->lookup_id(role);
+ if (!this->controller->surface_exists(*surface_id)) {
// Block until all pending request are processed by wayland display server
// because waiting for the surface of new app is created
this->display->roundtrip();
}
- auto &s = this->controller->surfaces[surface_id];
+ auto &s = this->controller->surfaces[*surface_id];
s->set_destination_rectangle(size.x, size.y, size.w, size.h);
this->layout_commit();
// Update area information
- this->area_info[surface_id].x = size.x;
- this->area_info[surface_id].y = size.y;
- this->area_info[surface_id].w = size.w;
- this->area_info[surface_id].h = size.h;
+ this->area_info[*surface_id].x = size.x;
+ this->area_info[*surface_id].y = size.y;
+ this->area_info[*surface_id].w = size.w;
+ this->area_info[*surface_id].h = size.h;
HMI_DEBUG("wm", "Surface rect { %d, %d, %d, %d }",
size.x, size.y, size.w, size.h);
@@ -1072,7 +1068,7 @@ void App::setSurfaceSize(const char* role, const char* area) {
size.x, size.y, size.w, size.h);
// Enqueue flushDraw event
- this->enqueue_flushdraw(surface_id);
+ this->enqueue_flushdraw(*surface_id);
}
void App::setAccelPedalPos(double val) {
diff --git a/src/app.hpp b/src/app.hpp
index 68214b3..207a7e5 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -255,7 +255,6 @@ private:
PolicyManager pm_;
LayoutManager lm_;
- std::unordered_map<std::string, int> role2surfaceid_;
std::unordered_map<std::string, std::string> drawingname2role_;
std::unordered_map<std::string, std::string> role2drawingname_;
std::unordered_map<int, int> appid2role_;