From 4fe9798db3e32aae45d79bef7c1c82e50933658a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 5 Mar 2015 11:46:27 +0100 Subject: Optimize egl cursor update events Avoid invokeMethod on every cursor movement and use an event instead. This is more lightweight and efficient. Also, there is no need to have a separate QObject just for this. Change-Id: I65ae202943eeb1e30cf22926576f84198f2487f8 Reviewed-by: Andy Nichols --- .../eglconvenience/qeglplatformcursor_p.h | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/platformsupport/eglconvenience/qeglplatformcursor_p.h') diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h index 1c05a06b63..481bb3c74c 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h @@ -70,24 +70,6 @@ private: QEGLPlatformCursor *m_cursor; }; -class QEGLPlatformCursorUpdater : public QObject -{ - Q_OBJECT - -public: - QEGLPlatformCursorUpdater(QPlatformScreen *screen) - : m_screen(screen), m_active(false) { } - - void scheduleUpdate(const QPoint &pos, const QRegion &rgn); - -private slots: - void update(const QPoint &pos, const QRegion &rgn); - -private: - QPlatformScreen *m_screen; - bool m_active; -}; - class QEGLPlatformCursor : public QPlatformCursor, protected QOpenGLFunctions { Q_OBJECT @@ -109,6 +91,7 @@ public: void updateMouseStatus(); private: + bool event(QEvent *e) Q_DECL_OVERRIDE; #ifndef QT_NO_CURSOR bool setCurrentCursor(QCursor *cursor); #endif @@ -150,7 +133,7 @@ private: int m_textureCoordEntry; int m_textureEntry; QEGLPlatformCursorDeviceListener *m_deviceListener; - QEGLPlatformCursorUpdater m_updater; + bool m_updateRequested; }; QT_END_NAMESPACE -- cgit v1.2.3