From 6506e0a6eec67985432427c630b148e825184c5d Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 12 Dec 2011 12:57:08 +0100 Subject: Improved path filling performance in the raster paint engine. Convert bezier curves to polylines before rasterizing with gray raster. Change-Id: I353debd4338f2a3ce2fa1cfa1bff9dd2e36f05ab Reviewed-by: Gunnar Sletta --- src/gui/painting/qoutlinemapper_p.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/gui/painting/qoutlinemapper_p.h') diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h index 388858ca44..7bcf3166ca 100644 --- a/src/gui/painting/qoutlinemapper_p.h +++ b/src/gui/painting/qoutlinemapper_p.h @@ -73,6 +73,8 @@ const int QT_RASTER_COORD_LIMIT = 32767; //#define QT_DEBUG_CONVERT +Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale); + /******************************************************************************** * class QOutlineMapper * @@ -90,11 +92,9 @@ public: QOutlineMapper() : m_element_types(0), m_elements(0), - m_elements_dev(0), m_points(0), m_tags(0), m_contours(0), - m_polygon_dev(0), m_in_clip_elements(false), m_round_coords(false) { @@ -117,6 +117,10 @@ public: m_dx = m.dx(); m_dy = m.dy(); m_txop = m.type(); + + qreal scale; + qt_scaleForTransform(m, &scale); + m_curve_threshold = scale == 0 ? qreal(0.25) : (qreal(0.25) / scale); } void beginOutline(Qt::FillRule fillRule) @@ -126,7 +130,6 @@ public: #endif m_valid = true; m_elements.reset(); - m_elements_dev.reset(); m_element_types.reset(); m_points.reset(); m_tags.reset(); @@ -161,15 +164,7 @@ public: m_element_types << QPainterPath::LineToElement; } - inline void curveTo(const QPointF &cp1, const QPointF &cp2, const QPointF &ep) { -#ifdef QT_DEBUG_CONVERT - printf("QOutlineMapper::curveTo() (%f, %f)\n", ep.x(), ep.y()); -#endif - m_elements << cp1 << cp2 << ep; - m_element_types << QPainterPath::CurveToElement - << QPainterPath::CurveToDataElement - << QPainterPath::CurveToDataElement; - } + void curveTo(const QPointF &cp1, const QPointF &cp2, const QPointF &ep); inline void closeSubpath() { int element_count = m_elements.size(); @@ -209,14 +204,11 @@ public: public: QDataBuffer m_element_types; QDataBuffer m_elements; - QDataBuffer m_elements_dev; QDataBuffer m_points; QDataBuffer m_tags; QDataBuffer m_contours; QRect m_clip_rect; - QDataBuffer m_polygon_dev; - QRectF controlPointRect; // only valid after endOutline() QT_FT_Outline m_outline; @@ -235,6 +227,8 @@ public: qreal m_dx; qreal m_dy; + qreal m_curve_threshold; + bool m_valid; bool m_in_clip_elements; -- cgit v1.2.3 From 1fdfc2abfe1fa26b86028934d4853432e25b4655 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 5 Jan 2012 14:03:39 +1000 Subject: Update copyright year in license headers. Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern --- src/gui/painting/qoutlinemapper_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting/qoutlinemapper_p.h') diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h index 7bcf3166ca..ceb70f1a7b 100644 --- a/src/gui/painting/qoutlinemapper_p.h +++ b/src/gui/painting/qoutlinemapper_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -- cgit v1.2.3