aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-01-15 17:17:41 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-01-16 11:36:39 +0000
commit196c691ebce3a48c6479162f3084790b6d0af8b8 (patch)
tree51d345da5896628450938ecf2c73ac97bbe6a99d /src/imports
parent4f48a54fdcc78416070c6846d8df4aacf36194a7 (diff)
QQuickShapePrivate: use header init, order storage by type
Header initialization makes it more clear that initialization is being done properly (and in fact a couple of these were not). Ordering by type allows compilers to pack the bools and enums into a bitfield. (Unfortunately explicit bitfields aren't syntactically compatible with header initialization, so we leave it up to the compiler to make this optimization on its own, since Shape is not intended to be used in large numbers anyway.) Change-Id: I68b1f5dec59bc2c487ab37bd3495eca19736bc21 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/shapes/qquickshape.cpp6
-rw-r--r--src/imports/shapes/qquickshape_p_p.h18
2 files changed, 9 insertions, 15 deletions
diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp
index c749357cc5..518f7a08cf 100644
--- a/src/imports/shapes/qquickshape.cpp
+++ b/src/imports/shapes/qquickshape.cpp
@@ -631,12 +631,6 @@ void QQuickShapePath::resetFillGradient()
*/
QQuickShapePrivate::QQuickShapePrivate()
- : spChanged(false),
- rendererType(QQuickShape::UnknownRenderer),
- async(false),
- status(QQuickShape::Null),
- renderer(nullptr),
- enableVendorExts(true)
{
}
diff --git a/src/imports/shapes/qquickshape_p_p.h b/src/imports/shapes/qquickshape_p_p.h
index f43831516a..eb7fdc3bc8 100644
--- a/src/imports/shapes/qquickshape_p_p.h
+++ b/src/imports/shapes/qquickshape_p_p.h
@@ -170,17 +170,17 @@ public:
static void asyncShapeReady(void *data);
- bool spChanged;
- QQuickShape::RendererType rendererType;
- bool async;
- QQuickShape::Status status;
- QQuickAbstractPathRenderer *renderer;
QVector<QQuickShapePath *> sp;
- bool enableVendorExts;
- bool syncTimingActive = false;
- int syncTimingTotalDirty;
- int syncTimeCounter = 0;
QElapsedTimer syncTimer;
+ QQuickAbstractPathRenderer *renderer = nullptr;
+ int syncTimingTotalDirty = 0;
+ int syncTimeCounter = 0;
+ QQuickShape::Status status = QQuickShape::Null;
+ QQuickShape::RendererType rendererType = QQuickShape::UnknownRenderer;
+ bool spChanged = false;
+ bool async = false;
+ bool enableVendorExts = true;
+ bool syncTimingActive = false;
};
#if QT_CONFIG(opengl)