summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainterpath_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qpainterpath_p.h')
-rw-r--r--src/gui/painting/qpainterpath_p.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index 54c182dcc7..54b9392dc7 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -81,8 +81,8 @@ class QVectorPathConverter;
class QVectorPathConverter
{
public:
- QVectorPathConverter(const QVector<QPainterPath::Element> &path, uint fillRule)
- : pathData(path, fillRule),
+ QVectorPathConverter(const QVector<QPainterPath::Element> &path, uint fillRule, bool convex)
+ : pathData(path, fillRule, convex),
path(pathData.points.data(), path.size(),
pathData.elements.data(), pathData.flags) {}
@@ -91,7 +91,7 @@ public:
}
struct QVectorPathData {
- QVectorPathData(const QVector<QPainterPath::Element> &path, uint fillRule)
+ QVectorPathData(const QVector<QPainterPath::Element> &path, uint fillRule, bool convex)
: elements(path.size()),
points(path.size() * 2),
flags(0)
@@ -103,7 +103,7 @@ public:
points[ptsPos++] = e.x;
points[ptsPos++] = e.y;
if (e.type == QPainterPath::CurveToElement)
- flags |= QVectorPath::CurvedShapeHint;
+ flags |= QVectorPath::CurvedShapeMask;
}
if (fillRule == Qt::WindingFill)
@@ -111,6 +111,8 @@ public:
else
flags |= QVectorPath::OddEvenFill;
+ if (!convex)
+ flags |= QVectorPath::NonConvexShapeMask;
}
QVarLengthArray<QPainterPath::ElementType> elements;
QVarLengthArray<qreal> points;
@@ -128,19 +130,24 @@ class QPainterPathData : public QPainterPathPrivate
{
public:
QPainterPathData() :
- cStart(0), fillRule(Qt::OddEvenFill),
- dirtyBounds(false), dirtyControlBounds(false),
+ cStart(0),
+ fillRule(Qt::OddEvenFill),
+ dirtyBounds(false),
+ dirtyControlBounds(false),
pathConverter(0)
{
ref = 1;
require_moveTo = false;
+ convex = false;
}
QPainterPathData(const QPainterPathData &other) :
QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule),
- dirtyBounds(other.dirtyBounds), bounds(other.bounds),
- dirtyControlBounds(other.dirtyControlBounds),
+ bounds(other.bounds),
controlBounds(other.controlBounds),
+ dirtyBounds(other.dirtyBounds),
+ dirtyControlBounds(other.dirtyControlBounds),
+ convex(other.convex),
pathConverter(0)
{
ref = 1;
@@ -158,20 +165,21 @@ public:
const QVectorPath &vectorPath() {
if (!pathConverter)
- pathConverter = new QVectorPathConverter(elements, fillRule);
+ pathConverter = new QVectorPathConverter(elements, fillRule, convex);
return pathConverter->path;
}
int cStart;
Qt::FillRule fillRule;
- bool require_moveTo;
-
- bool dirtyBounds;
QRectF bounds;
- bool dirtyControlBounds;
QRectF controlBounds;
+ uint require_moveTo : 1;
+ uint dirtyBounds : 1;
+ uint dirtyControlBounds : 1;
+ uint convex : 1;
+
QVectorPathConverter *pathConverter;
};