summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-12-16 14:50:35 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-12-17 13:47:26 +0000
commit879409fd0ffa2466dbd9f7274a4417b34ed18360 (patch)
tree496b0e097d4c4b25ec611084ccdff58009bfba0c
parente78ca787ae459f2769a6b0126dad4700408bfb46 (diff)
Use Q_CONSTRUCTOR_FUNCTION instead of doing the same manually
Use the macro we have that does exactly what we want without the boiler plate code. Change-Id: I25c67a71f83f91f50128c8a54033ee53ad28e88a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
-rw-r--r--src/gui/image/qimage_conversions.cpp11
-rw-r--r--src/gui/painting/qdrawhelper.cpp19
2 files changed, 7 insertions, 23 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index cbdcf49da7..cc79e73534 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -2967,15 +2967,6 @@ static void qInitImageConversions()
#endif
}
-class QImageConversionsInitializer {
-public:
- QImageConversionsInitializer()
- {
- qInitImageConversions();
- }
-};
-
-// Ensure initialization if this object file is linked.
-static QImageConversionsInitializer qImageConversionsInitializer;
+Q_CONSTRUCTOR_FUNCTION(qInitImageConversions);
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index bf7a50e227..87ceb9a89d 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -6323,8 +6323,13 @@ void qt_memfill32(quint32 *dest, quint32 color, int count)
template<QtPixelOrder> const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);
#endif
+extern void qInitBlendFunctions();
+
static void qInitDrawhelperFunctions()
{
+ // Set up basic blend function tables.
+ qInitBlendFunctions();
+
#ifdef __SSE2__
qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_sse2;
qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_sse2;
@@ -6518,19 +6523,7 @@ static void qInitDrawhelperFunctions()
#endif // QT_COMPILER_SUPPORTS_MIPS_DSP || QT_COMPILER_SUPPORTS_MIPS_DSPR2
}
-extern void qInitBlendFunctions();
-class DrawHelperInitializer {
-public:
- DrawHelperInitializer()
- {
- // Set up basic blend function tables.
- qInitBlendFunctions();
- // Set up architecture optimized methods for the current machine.
- qInitDrawhelperFunctions();
- }
-};
-
// Ensure initialization if this object file is linked.
-static DrawHelperInitializer drawHelperInitializer;
+Q_CONSTRUCTOR_FUNCTION(qInitDrawhelperFunctions);
QT_END_NAMESPACE