Skip to content

Commit

Permalink
[QNX] Set Window usage
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Vladimir Minenko <[email protected]>
Reviewed-by: Giuseppe D'Angelo <[email protected]>
Reviewed-by: Rafael Roquetto <[email protected]>
  • Loading branch information
aholza authored and The Qt Project committed Jan 16, 2014
1 parent 84be1bd commit 5dee237
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugins/platforms/qnx/qqnxeglwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/platforms/qnx/qqnxrasterwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5dee237

Please sign in to comment.