From 8710c900d65ddc484fd404ee17d0ed8188dec5b5 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 25 May 2012 16:30:00 -0700 Subject: eglfs: allow cursor to be created without a context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/platforms/eglfs/qeglfsscreen.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/plugins/platforms/eglfs/qeglfsscreen.cpp') 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(this); - // cursor requires a gl context - if (!m_platformContext) - that->createAndSetPlatformContext(); - that->m_cursor = new QEglFSCursor(that); - } return m_cursor; } -- cgit v1.2.3