diff options
author | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2018-07-31 01:33:02 +0000 |
---|---|---|
committer | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2018-08-02 06:45:12 +0000 |
commit | 744df8b7c6ccb4e2254e452eec82f5d0703417cf (patch) | |
tree | 59f1987bf66688a154bc81d2eae5723e18c66ae1 /src/qlibwindowmanager.cpp | |
parent | cddefc7651d54fd99d4b1c1c17834f604de01b88 (diff) |
Add an interface to scalable rendering with multiple resolutionguppy_6.90.0guppy/6.90.0flounder_5.99.6flounder_5.99.5flounder_5.99.4flounder_5.99.3flounder/5.99.6flounder/5.99.5flounder/5.99.4flounder/5.99.36.90.05.99.65.99.55.99.45.99.3
To support rendering which fits screen resolution,
new class AGLScreenInfo is introduced to get 'scale_factor'
from AGL HMI framework.
If AGL HMI framework doesn't support multi-resolution,
scale is set 1.0 for backward compatibility.
Bug-AGL: SPEC-1611
Change-Id: I1dc4dd13c17ae66a706b6fd8ef937fbaab937c9e
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Diffstat (limited to 'src/qlibwindowmanager.cpp')
-rw-r--r-- | src/qlibwindowmanager.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/qlibwindowmanager.cpp b/src/qlibwindowmanager.cpp index b264c94..df17f47 100644 --- a/src/qlibwindowmanager.cpp +++ b/src/qlibwindowmanager.cpp @@ -28,7 +28,37 @@ using namespace std; int QLibWindowmanager::init(int port, const QString &token) { string ctoken = token.toStdString(); - return this->wm->init(port, ctoken.c_str()); + int ret_init = this->wm->init(port, ctoken.c_str()); + + // initialize dpyinfo + json_object *obj = json_object_new_object(); + + int ret = this->wm->getDisplayInfo(obj); + + this->screen_info = new AGLScreenInfoPrivate; + + if (!ret) { + json_object *j_val; + if (json_object_object_get_ex(obj, "width_pixel", &j_val)) { + this->screen_info->set_width_dp(json_object_get_double(j_val)); + } + if (json_object_object_get_ex(obj, "height_pixel", &j_val)) { + this->screen_info->set_height_dp(json_object_get_double(j_val)); + } + if (json_object_object_get_ex(obj, "width_mm", &j_val)) { + this->screen_info->set_width_mm(json_object_get_double(j_val)); + } + if (json_object_object_get_ex(obj, "height_mm", &j_val)) { + this->screen_info->set_height_mm(json_object_get_double(j_val)); + } + if (json_object_object_get_ex(obj, "scale", &j_val)) { + this->screen_info->set_scale_factor(json_object_get_double(j_val)); + } + } + + json_object_put(obj); + + return ret_init; } int QLibWindowmanager::requestSurface(const QString &label) { @@ -120,7 +150,7 @@ void QLibWindowmanager::slotActivateSurface(){ } QLibWindowmanager::QLibWindowmanager(QObject *parent) - :QObject(parent), isActive(false) + :QObject(parent), isActive(false), screen_info(nullptr) { wm = new LibWindowmanager(); } |