diff options
author | Friedemann Kleint <[email protected]> | 2023-02-03 11:52:19 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2023-02-09 13:02:01 +0100 |
commit | 9268c2db58125fa482b1168bd340da53b75fb1a8 (patch) | |
tree | 9faf65aa3b500a8ff22722aaaea52099d7959bc3 /src/quick/scenegraph/adaptations/software | |
parent | 58935a5cdc0037750bca089cea211769e36591e6 (diff) |
QtQuick/Render loops: Fix conflicting WM_ constants
Change them to be inline variables of the class.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Icb6e94d30e0120968bc9f65029b1b234f5c4cc28
Reviewed-by: Laszlo Agocs <[email protected]>
Reviewed-by: Amir Masoud Abdol <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software')
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp index 54bcdf9b49..5c5bc8d626 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp @@ -29,23 +29,6 @@ QT_BEGIN_NAMESPACE -// Passed from the RL to the RT when a window is removed obscured and should be -// removed from the render loop. -const QEvent::Type WM_Obscure = QEvent::Type(QEvent::User + 1); - -// Passed from the RL to RT when GUI has been locked, waiting for sync. -const QEvent::Type WM_RequestSync = QEvent::Type(QEvent::User + 2); - -// Passed by the RL to the RT to maybe release resource if no windows are -// rendering. -const QEvent::Type WM_TryRelease = QEvent::Type(QEvent::User + 4); - -// Passed by the RL to the RT when a QQuickWindow::grabWindow() is called. -const QEvent::Type WM_Grab = QEvent::Type(QEvent::User + 5); - -// Passed by the window when there is a render job to run. -const QEvent::Type WM_PostJob = QEvent::Type(QEvent::User + 6); - class QSGSoftwareWindowEvent : public QEvent { public: @@ -57,7 +40,7 @@ class QSGSoftwareTryReleaseEvent : public QSGSoftwareWindowEvent { public: QSGSoftwareTryReleaseEvent(QQuickWindow *win, bool destroy) - : QSGSoftwareWindowEvent(win, WM_TryRelease), destroying(destroy) { } + : QSGSoftwareWindowEvent(win, QEvent::Type(WM_TryRelease)), destroying(destroy) { } bool destroying; }; @@ -65,7 +48,7 @@ class QSGSoftwareSyncEvent : public QSGSoftwareWindowEvent { public: QSGSoftwareSyncEvent(QQuickWindow *c, bool inExpose, bool force) - : QSGSoftwareWindowEvent(c, WM_RequestSync) + : QSGSoftwareWindowEvent(c, QEvent::Type(WM_RequestSync)) , size(c->size()) , dpr(c->effectiveDevicePixelRatio()) , syncInExpose(inExpose) @@ -80,7 +63,7 @@ class QSGSoftwareGrabEvent : public QSGSoftwareWindowEvent { public: QSGSoftwareGrabEvent(QQuickWindow *c, QImage *result) - : QSGSoftwareWindowEvent(c, WM_Grab), image(result) { } + : QSGSoftwareWindowEvent(c, QEvent::Type(WM_Grab)), image(result) { } QImage *image; }; @@ -88,7 +71,7 @@ class QSGSoftwareJobEvent : public QSGSoftwareWindowEvent { public: QSGSoftwareJobEvent(QQuickWindow *c, QRunnable *postedJob) - : QSGSoftwareWindowEvent(c, WM_PostJob), job(postedJob) { } + : QSGSoftwareWindowEvent(c, QEvent::Type(WM_PostJob)), job(postedJob) { } ~QSGSoftwareJobEvent() { delete job; } QRunnable *job; }; @@ -851,7 +834,7 @@ void QSGSoftwareThreadedRenderLoop::handleObscurity(QSGSoftwareThreadedRenderLoo if (w->thread->isRunning()) { w->thread->mutex.lock(); - w->thread->postEvent(new QSGSoftwareWindowEvent(w->window, WM_Obscure)); + w->thread->postEvent(new QSGSoftwareWindowEvent(w->window, QEvent::Type(WM_Obscure))); w->thread->waitCondition.wait(&w->thread->mutex); w->thread->mutex.unlock(); } |