From 5d66b66df1bc205a9ce3d25cfaaa84c961fa7a29 Mon Sep 17 00:00:00 2001 From: Arvid Nilsson Date: Thu, 28 Nov 2013 15:29:40 +0100 Subject: Quick: Add experimental.viewport.devicePixelRatio This specifies a devicePixelRatio to be used by web content instead of the QScreen::devicePixelRatio(). This is necessary on non-iOS mobile devices to remain compatible with the mobile web which assumes devicePixelRatio is computed as the ratio of actual dpi to 160 dpi. Non-iOS mobile platforms may use different criteria to determine the QScreen::devicePixelRatio(), depending on the history of the platform, or simply leave it at 1.0. For QNX, this setting gets a reasonable default value so developers don't have to regularly use this experimental API. These changes were inspired by the Android Chromium port which uses a GetDpiScale() to accomplish the same in content/browser/android/content_view_core_impl.cc. Change-Id: I1bc8878a47dabcdb6986c4fe5c8c4ac230ae2514 Reviewed-by: Jocelyn Turcotte --- src/core/type_conversion.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/core/type_conversion.h') diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h index 0f0a8ab60..94e30d72b 100644 --- a/src/core/type_conversion.h +++ b/src/core/type_conversion.h @@ -93,6 +93,11 @@ inline QSize toQt(const gfx::Size &size) return QSize(size.width(), size.height()); } +inline gfx::SizeF toGfx(const QSizeF& size) +{ + return gfx::SizeF(size.width(), size.height()); +} + inline QSizeF toQt(const gfx::SizeF &size) { return QSizeF(size.width(), size.height()); -- cgit v1.2.3