summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-17 02:03:53 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-17 02:03:53 (GMT)
commitdc5543f5595870209e8122d13d070694b5e0eb39 (patch)
tree09fe74aa408e9d2fc9198df71dc032e0680fe4b7 /src/gui/painting
parent30c8d1e3dccc83499ac3d76284cfb2e8d860808a (diff)
parent0842309e6e04d34c027374d0793dc60d3ec6e28b (diff)
downloadQt-dc5543f5595870209e8122d13d070694b5e0eb39.zip
Qt-dc5543f5595870209e8122d13d070694b5e0eb39.tar.gz
Qt-dc5543f5595870209e8122d13d070694b5e0eb39.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix crash on Mac OS X when drawing text with Qt::TextBypassShaping set Fixed infinite recursion when drawing very large painter paths. Fixed full-rule on clipped painter paths. Removed unnecessary lines of code. Fixed problem with wrong size hints when items were removed.
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qoutlinemapper.cpp12
-rw-r--r--src/gui/painting/qoutlinemapper_p.h4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp11
-rw-r--r--src/gui/painting/qpaintengineex.cpp4
4 files changed, 18 insertions, 13 deletions
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index 1b01960..bf03545 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -234,12 +234,12 @@ void QOutlineMapper::endOutline()
// Check for out of dev bounds...
- const bool do_clip = (controlPointRect.left() < -QT_RASTER_COORD_LIMIT
+ const bool do_clip = !m_in_clip_elements && ((controlPointRect.left() < -QT_RASTER_COORD_LIMIT
|| controlPointRect.right() > QT_RASTER_COORD_LIMIT
|| controlPointRect.top() < -QT_RASTER_COORD_LIMIT
|| controlPointRect.bottom() > QT_RASTER_COORD_LIMIT
|| controlPointRect.width() > QT_RASTER_COORD_LIMIT
- || controlPointRect.height() > QT_RASTER_COORD_LIMIT);
+ || controlPointRect.height() > QT_RASTER_COORD_LIMIT));
if (do_clip) {
clipElements(elements, elementTypes(), element_count);
@@ -353,7 +353,13 @@ void QOutlineMapper::clipElements(const QPointF *elements,
// instead of going through convenience functionallity, but since
// this part of code hardly every used, it shouldn't matter.
+ m_in_clip_elements = true;
+
QPainterPath path;
+
+ if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
+ path.setFillRule(Qt::WindingFill);
+
if (types) {
for (int i=0; i<element_count; ++i) {
switch (types[i]) {
@@ -389,6 +395,8 @@ void QOutlineMapper::clipElements(const QPointF *elements,
else
convertPath(clippedPath);
m_txop = old_txop;
+
+ m_in_clip_elements = false;
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h
index 39b7593..f64d03b 100644
--- a/src/gui/painting/qoutlinemapper_p.h
+++ b/src/gui/painting/qoutlinemapper_p.h
@@ -95,7 +95,8 @@ public:
m_tags(0),
m_contours(0),
m_polygon_dev(0),
- m_round_coords(false)
+ m_round_coords(false),
+ m_in_clip_elements(false)
{
}
@@ -235,6 +236,7 @@ public:
qreal m_dy;
bool m_valid;
+ bool m_in_clip_elements;
private:
bool m_round_coords;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index f10f12f..a212718 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -459,13 +459,12 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
QRasterPaintEngineState *s = state();
ensureOutlineMapper();
- d->outlineMapper->m_clip_rect = d->deviceRect.adjusted(-10, -10, 10, 10);
-
- // This is the upp
- QRect bounds(-QT_RASTER_COORD_LIMIT, -QT_RASTER_COORD_LIMIT,
- QT_RASTER_COORD_LIMIT*2 - 1, QT_RASTER_COORD_LIMIT * 2 - 1);
- d->outlineMapper->m_clip_rect = bounds.intersected(d->outlineMapper->m_clip_rect);
+ d->outlineMapper->m_clip_rect = d->deviceRect;
+ if (d->outlineMapper->m_clip_rect.width() > QT_RASTER_COORD_LIMIT)
+ d->outlineMapper->m_clip_rect.setWidth(QT_RASTER_COORD_LIMIT);
+ if (d->outlineMapper->m_clip_rect.height() > QT_RASTER_COORD_LIMIT)
+ d->outlineMapper->m_clip_rect.setHeight(QT_RASTER_COORD_LIMIT);
d->rasterizer->setClipRect(d->deviceRect);
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index ff82d59..e0746fb 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -494,11 +494,9 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
} else {
d->activeStroker->moveTo(points[0], points[1]);
points += 2;
- ++types;
while (points < lastPoint) {
d->activeStroker->lineTo(points[0], points[1]);
points += 2;
- ++types;
}
if (path.hasImplicitClose())
d->activeStroker->lineTo(path.points()[0], path.points()[1]);
@@ -561,12 +559,10 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
QPointF p = ((QPointF *)points)[0] * state()->matrix;
d->activeStroker->moveTo(p.x(), p.y());
points += 2;
- ++types;
while (points < lastPoint) {
QPointF p = ((QPointF *)points)[0] * state()->matrix;
d->activeStroker->lineTo(p.x(), p.y());
points += 2;
- ++types;
}
if (path.hasImplicitClose())
d->activeStroker->lineTo(p.x(), p.y());