diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-05 11:46:27 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-05 16:11:45 +0000 |
commit | 4fe9798db3e32aae45d79bef7c1c82e50933658a (patch) | |
tree | 9b714d4b4e5150bc81d26cb9e51ae4068206a585 /src/platformsupport/eglconvenience/qeglplatformcursor_p.h | |
parent | 87af240c86c6d99019fdf60ac5f4e688bac9229a (diff) |
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 <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcursor_p.h')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcursor_p.h | 21 |
1 files changed, 2 insertions, 19 deletions
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 |