summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainterpath_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-02 12:33:57 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-09-03 12:13:09 (GMT)
commit4feb152405e96125b6be2807d515293e3f25ab1a (patch)
tree52b0be39e7f435db7f7e41ed73a2bc53e01f4c8e /src/gui/painting/qpainterpath_p.h
parentd4a4b01f2f08a9031d692344d0d264de472da25e (diff)
downloadQt-4feb152405e96125b6be2807d515293e3f25ab1a.zip
Qt-4feb152405e96125b6be2807d515293e3f25ab1a.tar.gz
Qt-4feb152405e96125b6be2807d515293e3f25ab1a.tar.bz2
Added trace graphics system for painting performance profiling.
When running an application with graphics system trace everything that gets painted to the window surface is proxied through a QPaintBuffer, which is then both streamed to a trace file and replayed on a raster window surface. The trace file can then be replayed with tools/qttracereplay to measure pure painting performance. Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/painting/qpainterpath_p.h')
-rw-r--r--src/gui/painting/qpainterpath_p.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index bb455cf..94be339 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -176,6 +176,42 @@ public:
};
+inline const QPainterPath QVectorPath::convertToPainterPath() const
+{
+ QPainterPath path;
+ path.ensureData();
+ QPainterPathData *data = path.d_func();
+ data->elements.reserve(m_count);
+ int index = 0;
+ data->elements[0].x = m_points[index++];
+ data->elements[0].y = m_points[index++];
+
+ if (m_elements) {
+ data->elements[0].type = m_elements[0];
+ for (int i=1; i<m_count; ++i) {
+ QPainterPath::Element element;
+ element.x = m_points[index++];
+ element.y = m_points[index++];
+ element.type = m_elements[i];
+ data->elements << element;
+ }
+ } else {
+ data->elements[0].type = QPainterPath::MoveToElement;
+ for (int i=1; i<m_count; ++i) {
+ QPainterPath::Element element;
+ element.x = m_points[index++];
+ element.y = m_points[index++];
+ element.type = QPainterPath::LineToElement;
+ data->elements << element;
+ }
+ }
+
+ if (m_hints & OddEvenFill)
+ data->fillRule = Qt::OddEvenFill;
+ else
+ data->fillRule = Qt::WindingFill;
+ return path;
+}
void Q_GUI_EXPORT qt_find_ellipse_coords(const QRectF &r, qreal angle, qreal length,
QPointF* startPoint, QPointF *endPoint);