diff options
author | Andreas Holzammer <andreas.holzammer@kdab.com> | 2014-01-15 13:53:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-16 20:39:00 +0100 |
commit | 5dee237022e84a378468c3839e4e7af13cb1246d (patch) | |
tree | 87faa55dc96e0ed7694a05e59961da1ee9b1d0dd | |
parent | 84be1bd4d3ed8d2d9e65301649bc841ea4197fe2 (diff) |
[QNX] Set Window usage
Set Window usage prior to use the framebuffer.
For OpenGL windows set OpenGL usage and for
normal painting set it to native usage.
Some QNX libscreen implementations don't set
usage automatically, so we must set this explicitly.
Task-number: QTBUG-35912
Change-Id: I5154c0bcf9c65ef6d47af6a1cf8f17765ccf51dd
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Vladimir Minenko <vminenko@rim.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
-rw-r--r-- | src/plugins/platforms/qnx/qqnxeglwindow.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index b57227a60b..984de67d7d 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -63,6 +63,13 @@ QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context, bool nee m_eglSurface(EGL_NO_SURFACE) { initWindow(); + + // Set window usage + const int val = SCREEN_USAGE_OPENGL_ES2; + const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val); + if (result != 0) + qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno); + m_requestedBufferSize = screen()->rootWindow() == this ? screen()->geometry().size() : window->geometry().size(); } diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index 1f974b268d..0d8daac0ee 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -60,6 +60,12 @@ QQnxRasterWindow::QQnxRasterWindow(QWindow *window, screen_context_t context, bo m_previousBufferIndex(-1) { initWindow(); + + // Set window usage + const int val = SCREEN_USAGE_NATIVE | SCREEN_USAGE_READ | SCREEN_USAGE_WRITE; + const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val); + if (result != 0) + qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno); } void QQnxRasterWindow::post(const QRegion &dirty) |