summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2009-09-15 03:12:32 (GMT)
committerSarah Smith <sarah.j.smith@nokia.com>2009-09-15 03:12:32 (GMT)
commit227dd18f0e25ee522e5a4323e849590a314dd4cd (patch)
treec7712b9b55e4f05bccf77c92edc992c3068ddfb3 /src/gui/painting
parent02cc6a825227daf6f35f7bc17377a4a622f16391 (diff)
parentd94f6a35202d2d62671072b4ba78e75b07d630bd (diff)
downloadQt-227dd18f0e25ee522e5a4323e849590a314dd4cd.zip
Qt-227dd18f0e25ee522e5a4323e849590a314dd4cd.tar.gz
Qt-227dd18f0e25ee522e5a4323e849590a314dd4cd.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp21
-rw-r--r--src/gui/painting/qpaintengineex.cpp9
-rw-r--r--src/gui/painting/qpainter.cpp3
3 files changed, 22 insertions, 11 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 46a3362..bac0a76 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -114,7 +114,7 @@ extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); //
// #define QT_DEBUG_DRAW
#ifdef QT_DEBUG_DRAW
-void dumpClip(int width, int height, QClipData *clip);
+void dumpClip(int width, int height, const QClipData *clip);
#endif
#define QT_FAST_SPANS
@@ -495,7 +495,7 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
<< ") devType:" << device->devType()
<< "devRect:" << d->deviceRect;
if (d->baseClip) {
- dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), d->baseClip);
+ dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip);
}
#endif
@@ -534,7 +534,7 @@ bool QRasterPaintEngine::end()
Q_D(QRasterPaintEngine);
qDebug() << "QRasterPaintEngine::end devRect:" << d->deviceRect;
if (d->baseClip) {
- dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), d->baseClip);
+ dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip);
}
#endif
@@ -1181,6 +1181,11 @@ static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterP
d->solid_color_filler.clip = d->clip();
d->solid_color_filler.adjustSpanMethods();
+
+#ifdef QT_DEBUG_DRAW
+ dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->clip());
+#endif
+
}
@@ -1780,9 +1785,7 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
if (path.isEmpty())
return;
#ifdef QT_DEBUG_DRAW
- QRealRect vectorPathBounds = path.controlPointRect();
- QRectF rf(vectorPathBounds.x1, vectorPathBounds.y1,
- vectorPathBounds.x2 - vectorPathBounds.x1, vectorPathBounds.y2 - vectorPathBounds.y1);
+ QRectF rf = path.controlPointRect();
qDebug() << "QRasterPaintEngine::fill(): "
<< "size=" << path.elementCount()
<< ", hints=" << hex << path.hints()
@@ -6068,7 +6071,7 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
*/
#ifdef QT_DEBUG_DRAW
-void dumpClip(int width, int height, QClipData *clip)
+void dumpClip(int width, int height, const QClipData *clip)
{
QImage clipImg(width, height, QImage::Format_ARGB32_Premultiplied);
clipImg.fill(0xffff0000);
@@ -6078,8 +6081,10 @@ void dumpClip(int width, int height, QClipData *clip)
int y0 = height;
int y1 = 0;
+ ((QClipData *) clip)->spans(); // Force allocation of the spans structure...
+
for (int i = 0; i < clip->count; ++i) {
- QSpan *span = clip->spans() + i;
+ const QSpan *span = ((QClipData *) clip)->spans() + i;
for (int j = 0; j < span->len; ++j)
clipImg.setPixel(span->x + j, span->y, 0xffffff00);
x0 = qMin(x0, int(span->x));
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index e75240c..656f383 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -535,8 +535,13 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
void QPaintEngineEx::draw(const QVectorPath &path)
{
- fill(path, state()->brush);
- stroke(path, state()->pen);
+ const QBrush &brush = state()->brush;
+ if (qbrush_style(brush) != Qt::NoBrush)
+ fill(path, brush);
+
+ const QPen &pen = state()->pen;
+ if (qpen_style(pen) != Qt::NoPen && qbrush_style(qpen_brush(pen)) != Qt::NoBrush)
+ stroke(path, pen);
}
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index a9257c7..beda9d6 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -475,7 +475,8 @@ void QPainterPrivate::draw_helper(const QPainterPath &originalPath, DrawOperatio
p.end();
q->save();
- q->resetMatrix();
+ state->matrix = QTransform();
+ state->dirtyFlags |= QPaintEngine::DirtyTransform;
updateState(state);
engine->drawImage(absPathRect,
image,