summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainterpath_p.h
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-02-01 05:53:18 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-02-01 05:53:18 (GMT)
commit4915439de467d1119a46af66ea08dbe161d2f336 (patch)
tree450a989691b5a892b07d5edbe5cf88ba78d388a0 /src/gui/painting/qpainterpath_p.h
parent5bda4e27bbe3fde98bd5c628fada76dfccadad0e (diff)
parent4d1c8407c1ac16b6288c3aa0f7c2118d2748f348 (diff)
downloadQt-4915439de467d1119a46af66ea08dbe161d2f336.zip
Qt-4915439de467d1119a46af66ea08dbe161d2f336.tar.gz
Qt-4915439de467d1119a46af66ea08dbe161d2f336.tar.bz2
Merge commit 'origin/4.6' into oslo1-master
Conflicts: doc/src/deployment/deployment.qdoc doc/src/getting-started/installation.qdoc examples/assistant/simpletextviewer/findfiledialog.cpp examples/assistant/simpletextviewer/findfiledialog.h examples/assistant/simpletextviewer/mainwindow.cpp examples/webkit/fancybrowser/main.cpp src/corelib/global/qglobal.h src/gui/dialogs/qfiledialog_win.cpp src/plugins/qpluginbase.pri src/qbase.pri tests/auto/selftests/expected_cmptest.txt tests/auto/selftests/expected_crashes_3.txt tests/auto/selftests/expected_longstring.txt tests/auto/selftests/expected_maxwarnings.txt tests/auto/selftests/expected_skip.txt tools/assistant/compat/config.cpp tools/assistant/compat/config.h tools/assistant/compat/docuparser.cpp tools/assistant/compat/docuparser.h tools/assistant/compat/fontsettingsdialog.cpp tools/assistant/compat/helpdialog.cpp tools/assistant/compat/helpdialog.h tools/assistant/compat/helpdialog.ui tools/assistant/compat/helpwindow.cpp tools/assistant/compat/helpwindow.h tools/assistant/compat/index.cpp tools/assistant/compat/index.h tools/assistant/compat/lib/qassistantclient.cpp tools/assistant/compat/lib/qassistantclient.h tools/assistant/compat/main.cpp tools/assistant/compat/mainwindow.cpp tools/assistant/compat/mainwindow.h tools/assistant/compat/mainwindow.ui tools/assistant/compat/profile.cpp tools/assistant/compat/profile.h tools/assistant/compat/tabbedbrowser.cpp tools/assistant/compat/tabbedbrowser.h tools/assistant/compat/tabbedbrowser.ui tools/assistant/compat/topicchooser.cpp tools/assistant/compat/topicchooser.ui tools/assistant/lib/qhelpsearchquerywidget.cpp tools/assistant/tools/assistant/centralwidget.cpp tools/assistant/tools/assistant/doc/assistant.qdocconf tools/assistant/tools/assistant/helpviewer.cpp tools/linguist/lupdate/main.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
Diffstat (limited to 'src/gui/painting/qpainterpath_p.h')
-rw-r--r--src/gui/painting/qpainterpath_p.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index 54b9392..43f548f 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -97,6 +97,7 @@ public:
flags(0)
{
int ptsPos = 0;
+ bool isLines = true;
for (int i=0; i<path.size(); ++i) {
const QPainterPath::Element &e = path.at(i);
elements[i] = e.type;
@@ -104,6 +105,11 @@ public:
points[ptsPos++] = e.y;
if (e.type == QPainterPath::CurveToElement)
flags |= QVectorPath::CurvedShapeMask;
+
+ // This is to check if the path contains only alternating lineTo/moveTo,
+ // in which case we can set the LinesHint in the path. MoveTo is 0 and
+ // LineTo is 1 so the i%2 gets us what we want cheaply.
+ isLines = isLines && e.type == (QPainterPath::ElementType) (i%2);
}
if (fillRule == Qt::WindingFill)
@@ -111,8 +117,14 @@ public:
else
flags |= QVectorPath::OddEvenFill;
- if (!convex)
- flags |= QVectorPath::NonConvexShapeMask;
+ if (isLines)
+ flags |= QVectorPath::LinesShapeMask;
+ else {
+ flags |= QVectorPath::AreaShapeMask;
+ if (!convex)
+ flags |= QVectorPath::NonConvexShapeMask;
+ }
+
}
QVarLengthArray<QPainterPath::ElementType> elements;
QVarLengthArray<qreal> points;