diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-05-25 16:30:00 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-31 09:25:56 +0200 |
commit | 8710c900d65ddc484fd404ee17d0ed8188dec5b5 (patch) | |
tree | d722be361d5625115112b4d546b0f8760c4bdd13 /src/plugins/platforms/eglfs/qeglfsscreen.cpp | |
parent | 47462ffd68023efd5497d50e02c56ed571b838c5 (diff) |
eglfs: allow cursor to be created without a context
Textures are now created and uploaded on demand on first render()
call where we are guaranteed to have a current GL context.
Change-Id: I352c876dd1d8b7ed73536de21fa2880cdc6bdb60
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsscreen.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsscreen.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index cf39aa353d..b29981f5bf 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -122,6 +122,10 @@ QEglFSScreen::QEglFSScreen() swapInterval = 1; } eglSwapInterval(m_dpy, swapInterval); + + static int hideCursor = qgetenv("QT_QPA_EGLFS_HIDECURSOR").toInt(); + if (!hideCursor) + m_cursor = new QEglFSCursor(this); } QEglFSScreen::~QEglFSScreen() @@ -216,17 +220,6 @@ QImage::Format QEglFSScreen::format() const QPlatformCursor *QEglFSScreen::cursor() const { - static int hideCursor = qgetenv("QT_QPA_EGLFS_HIDECURSOR").toInt(); - if (hideCursor) - return 0; - - if (!m_cursor) { - QEglFSScreen *that = const_cast<QEglFSScreen *>(this); - // cursor requires a gl context - if (!m_platformContext) - that->createAndSetPlatformContext(); - that->m_cursor = new QEglFSCursor(that); - } return m_cursor; } |