diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2018-02-19 11:32:23 +0200 |
---|---|---|
committer | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2018-03-22 13:37:10 +0000 |
commit | 14157a1a3e1d934e4892f469abc4e2cdf4e65f52 (patch) | |
tree | a1d6ef43200de331186fc24c74939f83b8005c1d /src/plugins/platforms/qnx | |
parent | 141582505f0132a1acb9f60de24b3d35552d8e5c (diff) |
Add env variable to set QNX screen debugging information
Enables different QNX Screen graphics system information
as overlay.
Following are valid options for the env variable:
* fps, posts, blits, updates, cpu_time, gpu_time, statistics
More info:
http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.screen/topic/group__screen__debugging_1Screen_Debug_Graph_Types.html
Change-Id: I8cbee44de31bb2aaf3892a063769f4740027242b
Reviewed-by: Adam Treat <adam.treat@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 38b61fd782..4a547aa158 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -63,6 +63,18 @@ QT_BEGIN_NAMESPACE +#define DECLARE_DEBUG_VAR(variable) \ + static bool debug_ ## variable() \ + { static bool value = qgetenv("QNX_SCREEN_DEBUG").contains(QT_STRINGIFY(variable)); return value; } +DECLARE_DEBUG_VAR(fps) +DECLARE_DEBUG_VAR(posts) +DECLARE_DEBUG_VAR(blits) +DECLARE_DEBUG_VAR(updates) +DECLARE_DEBUG_VAR(cpu_time) +DECLARE_DEBUG_VAR(gpu_time) +DECLARE_DEBUG_VAR(statistics) +#undef DECLARE_DEBUG_VAR + /*! \class QQnxWindow \brief The QQnxWindow is the base class of the various classes used as instances of @@ -211,6 +223,35 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW // it'll cause us not to join a group (the app will presumably join at some future time). if (windowGroup.isValid() && windowGroup.canConvert<QByteArray>()) joinWindowGroup(windowGroup.toByteArray()); + + int debug = 0; + if (Q_UNLIKELY(debug_fps())) { + debug |= SCREEN_DEBUG_GRAPH_FPS; + } + if (Q_UNLIKELY(debug_posts())) { + debug |= SCREEN_DEBUG_GRAPH_POSTS; + } + if (Q_UNLIKELY(debug_blits())) { + debug |= SCREEN_DEBUG_GRAPH_BLITS; + } + if (Q_UNLIKELY(debug_updates())) { + debug |= SCREEN_DEBUG_GRAPH_UPDATES; + } + if (Q_UNLIKELY(debug_cpu_time())) { + debug |= SCREEN_DEBUG_GRAPH_CPU_TIME; + } + if (Q_UNLIKELY(debug_gpu_time())) { + debug |= SCREEN_DEBUG_GRAPH_GPU_TIME; + } + if (Q_UNLIKELY(debug_statistics())) { + debug = SCREEN_DEBUG_STATISTICS; + } + + if (debug > 0) { + Q_SCREEN_CHECKERROR(screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_DEBUG, &debug), + "Could not set SCREEN_PROPERTY_DEBUG"); + qWindowDebug() << "window SCREEN_PROPERTY_DEBUG= " << debug; + } } QQnxWindow::~QQnxWindow() |