From 443b9523b2e82352be9261d65f55bff9b0a5e4de Mon Sep 17 00:00:00 2001 From: Tadao Tanikawa Date: Wed, 16 May 2018 09:48:31 +0000 Subject: Enable scaling to fit various screen resolutions Since the AGL HomeScreen of CES2018 assumes that the screen resolution is 1080x1920px, the graphics of it partially corrupted with others. To fix this issue, now the AGL window manager automatically scales size of HomeScreen to fit the resolution of the display. By default, this scaling keeps HomeScreen's original aspect rate (9:16). To ignore it, set the environment variable, 'HMI_SCALING_IGNORE_ASPECT'. (E.g. set it in any file under /etc/afm/unit.env.d/) Bug-AGL: SPEC-1138 Change-Id: Id11a07560fe254712aaab42018bfb4d1d87ad1df Signed-off-by: Tadao Tanikawa --- src/layers.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/layers.cpp') diff --git a/src/layers.cpp b/src/layers.cpp index 04f944d..8698e83 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -24,6 +24,9 @@ namespace wm { +const int default_main_width = 1080; +const int default_main_height = 1920; + using json = nlohmann::json; layer::layer(nlohmann::json const &j) { @@ -104,6 +107,8 @@ struct result to_layer_map(nlohmann::json const &j) { auto msi = j.find("main_surface"); if (msi != j.end()) { stl.main_surface_name = msi->value("surface_role", ""); + stl.main_surface_width = msi->value("width", default_main_width); + stl.main_surface_height = msi->value("height", default_main_height); stl.main_surface = -1; } -- cgit 1.2.3-korg