diff -r b72c6db6890b -r 5dc02b23752f src/gui/painting/qpaintengineex.cpp --- a/src/gui/painting/qpaintengineex.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/src/gui/painting/qpaintengineex.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -149,6 +149,7 @@ struct StrokeHandler { + StrokeHandler(int reserve) : pts(reserve), types(reserve) {} QDataBuffer pts; QDataBuffer types; }; @@ -394,7 +395,7 @@ return; if (!d->strokeHandler) { - d->strokeHandler = new StrokeHandler; + d->strokeHandler = new StrokeHandler(path.elementCount()+4); d->stroker.setMoveToHook(qpaintengineex_moveTo); d->stroker.setLineToHook(qpaintengineex_lineTo); d->stroker.setCubicToHook(qpaintengineex_cubicTo); @@ -460,6 +461,7 @@ // change the current transform. Normal transformed, // non-cosmetic pens will be transformed as part of fill // later, so they are also covered here.. + d->activeStroker->setCurveThresholdFromTransform(state()->matrix); d->activeStroker->begin(d->strokeHandler); if (types) { while (points < lastPoint) { @@ -517,6 +519,7 @@ QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath()); d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform()); } else { + d->activeStroker->setCurveThresholdFromTransform(state()->matrix); d->activeStroker->begin(d->strokeHandler); if (types) { while (points < lastPoint) { @@ -607,11 +610,11 @@ { qreal right = r.x() + r.width(); qreal bottom = r.y() + r.height(); - qreal pts[] = { r.x(), r.y(), - right, r.y(), + qreal pts[] = { qreal(r.x()), qreal(r.y()), + right, qreal(r.y()), right, bottom, - r.x(), bottom, - r.x(), r.y() }; + qreal(r.x()), bottom, + qreal(r.x()), qreal(r.y()) }; QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint); clip(vp, op); } @@ -711,11 +714,11 @@ // ### Is there a one off here? qreal right = r.x() + r.width(); qreal bottom = r.y() + r.height(); - qreal pts[] = { r.x(), r.y(), - right, r.y(), + qreal pts[] = { qreal(r.x()), qreal(r.y()), + right, qreal(r.y()), right, bottom, - r.x(), bottom, - r.x(), r.y() }; + qreal(r.x()), bottom, + qreal(r.x()), qreal(r.y()) }; QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint); draw(vp); } @@ -893,7 +896,7 @@ for (int i=0; iopacity; QTransform oldTransform = state()->matrix; - for (int i = 0; i < dataCount; ++i) { + for (int i = 0; i < fragmentCount; ++i) { QTransform transform = oldTransform; - transform.translate(drawingData[i].point.x(), drawingData[i].point.y()); - transform.rotate(drawingData[i].rotation); - state()->opacity = oldOpacity * drawingData[i].opacity; + transform.translate(fragments[i].x, fragments[i].y); + transform.rotate(fragments[i].rotation); + state()->opacity = oldOpacity * fragments[i].opacity; state()->matrix = transform; opacityChanged(); transformChanged(); - qreal w = drawingData[i].scaleX * drawingData[i].source.width(); - qreal h = drawingData[i].scaleY * drawingData[i].source.height(); - drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, drawingData[i].source); + qreal w = fragments[i].scaleX * fragments[i].width; + qreal h = fragments[i].scaleY * fragments[i].height; + QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop, + fragments[i].width, fragments[i].height); + drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect); } state()->opacity = oldOpacity;