diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-04 12:08:39 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-04 13:27:55 +0100 |
commit | c49043ea9bfaca57e1203c0959bc646bd861845e (patch) | |
tree | 73ff59ac6b88534e58c3e538b450b4ccf678a755 | |
parent | d147b99f753aab42f29cd069b5f028e3f354751e (diff) |
Use static_assert to "protected" QMatrix4x4 accessor
The size in qtbase had changed but this went by unnoticed because it
only failed at runtime and in the CI the first failing build had
assertions disabled.
Change-Id: I8891d0a1d0d306629b23eba042ce367cfdb64dfa
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 5310e76dae..f9e6ba03a8 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -138,6 +138,7 @@ struct QMatrix4x4_Accessor static bool isScale(const QMatrix4x4 &m) { return ((const QMatrix4x4_Accessor &) m).flagBits <= 0x2; } static bool is2DSafe(const QMatrix4x4 &m) { return ((const QMatrix4x4_Accessor &) m).flagBits < 0x8; } }; +Q_STATIC_ASSERT(sizeof(QMatrix4x4_Accessor) == sizeof(QMatrix4x4)); const float OPAQUE_LIMIT = 0.999f; @@ -480,8 +481,6 @@ Updater::Updater(Renderer *r) m_roots.add(0); m_combined_matrix_stack.add(&m_identityMatrix); m_rootMatrices.add(m_identityMatrix); - - Q_ASSERT(sizeof(QMatrix4x4_Accessor) == sizeof(QMatrix4x4)); } void Updater::updateStates(QSGNode *n) |