From d690b141064541d6fcc2a9608308f39435a89213 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 19 May 2011 09:27:19 +0200 Subject: Revert "Fix how subpixel positions are intepreted in an aliased grid." This reverts commit 69fc9e594e6d5da87bff42707973683f84b67c93. Conflicts: src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qrasterizer.cpp (cherry picked from commit f8e85838c5531b56c2175cbdb9c24db426f7fd89) Change-Id: I4f936404000e6fa88887d0fbe3fbde92c8edd259 Reviewed-on: http://codereview.qt.nokia.com/603 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qoutlinemapper.cpp | 9 +++++++ src/gui/painting/qoutlinemapper_p.h | 8 ++++++- src/gui/painting/qpaintengine_raster.cpp | 40 ++++++++++++++++++++++---------- src/gui/painting/qrasterizer.cpp | 4 ++-- 4 files changed, 46 insertions(+), 15 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp index 7c17c1b46e..8b607b28b8 100644 --- a/src/gui/painting/qoutlinemapper.cpp +++ b/src/gui/painting/qoutlinemapper.cpp @@ -47,6 +47,8 @@ QT_BEGIN_NAMESPACE +static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; + #define qreal_to_fixed_26_6(f) (int(f * 64)) @@ -214,6 +216,13 @@ void QOutlineMapper::endOutline() elements = m_elements_dev.data(); } + if (m_round_coords) { + // round coordinates to match outlines drawn with drawLine_midpoint_i + for (int i = 0; i < m_elements.size(); ++i) + elements[i] = QPointF(qFloor(elements[i].x() + aliasedCoordinateDelta), + qFloor(elements[i].y() + aliasedCoordinateDelta)); + } + controlPointRect = boundingRect(elements, element_count); #ifdef QT_DEBUG_CONVERT diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h index 1432d6fc4b..388858ca44 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_in_clip_elements(false) + m_in_clip_elements(false), + m_round_coords(false) { } @@ -201,6 +202,8 @@ public: QT_FT_Outline *convertPath(const QPainterPath &path); QT_FT_Outline *convertPath(const QVectorPath &path); + void setCoordinateRounding(bool coordinateRounding) { m_round_coords = coordinateRounding; } + inline QPainterPath::ElementType *elementTypes() const { return m_element_types.size() == 0 ? 0 : m_element_types.data(); } public: @@ -234,6 +237,9 @@ public: bool m_valid; bool m_in_clip_elements; + +private: + bool m_round_coords; }; QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index e2ce35af64..135db20e27 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -127,6 +127,9 @@ void dumpClip(int width, int height, const QClipData *clip); // 4 pixels. #define int_dim(pos, dim) (int(pos+dim) - int(pos)) +// use the same rounding as in qrasterizer.cpp (6 bit fixed point) +static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; + #ifdef Q_WS_WIN extern bool qt_cleartype_enabled; #endif @@ -1666,10 +1669,10 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) static inline QRect toNormalizedFillRect(const QRectF &rect) { - int x1 = qRound(rect.x()); - int y1 = qRound(rect.y()); - int x2 = qRound(rect.right()); - int y2 = qRound(rect.bottom()); + int x1 = qRound(rect.x() + aliasedCoordinateDelta); + int y1 = qRound(rect.y() + aliasedCoordinateDelta); + int x2 = qRound(rect.right() + aliasedCoordinateDelta); + int y2 = qRound(rect.bottom() + aliasedCoordinateDelta); if (x2 < x1) qSwap(x1, x2); @@ -1939,7 +1942,9 @@ void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly // Do the fill... ensureBrush(); if (s->brushData.blend) { + d->outlineMapper->setCoordinateRounding(s->penData.blend && s->flags.fast_pen && s->lastPen.brush().isOpaque()); fillPolygon(points, pointCount, mode); + d->outlineMapper->setCoordinateRounding(false); } } @@ -1986,6 +1991,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg if (s->brushData.blend) { // Compose polygon fill.., ensureOutlineMapper(); + d->outlineMapper->setCoordinateRounding(s->penData.blend != 0); d->outlineMapper->beginOutline(mode == WindingMode ? Qt::WindingFill : Qt::OddEvenFill); d->outlineMapper->moveTo(*points); const QPoint *p = points; @@ -1999,6 +2005,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect, &s->brushData); d->rasterize(d->outlineMapper->outline(), brushBlend, &s->brushData, d->rasterBuffer.data()); + d->outlineMapper->setCoordinateRounding(false); } } @@ -2248,7 +2255,10 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe int sr_b = qCeil(sr.bottom()) - 1; if (s->matrix.type() <= QTransform::TxScale && !s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) { + // as fillRect will apply the aliased coordinate delta we need to + // subtract it here as we don't use it for image drawing QTransform old = s->matrix; + s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); // Do whatever fillRect() does, but without premultiplying the color if it's already premultiplied. QRgb color = img.pixel(sr_l, sr_t); @@ -2392,9 +2402,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe d->initializeRasterizer(&d->image_filler_xform); d->rasterizer->setAntialiased(s->flags.antialiased); + const QPointF offs = s->flags.antialiased ? QPointF() : QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta); + const QRectF &rect = r.normalized(); - const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f); - const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f); + const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f) - offs; + const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f) - offs; if (s->flags.tx_noshear) d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width()); @@ -2403,12 +2415,13 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe return; } #endif + const qreal offs = s->flags.antialiased ? qreal(0) : aliasedCoordinateDelta; QPainterPath path; path.addRect(r); QTransform m = s->matrix; s->matrix = QTransform(m.m11(), m.m12(), m.m13(), m.m21(), m.m22(), m.m23(), - m.m31(), m.m32(), m.m33()); + m.m31() - offs, m.m32() - offs, m.m33()); fillPath(path, &d->image_filler_xform); s->matrix = m; } else { @@ -2860,6 +2873,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, rightShift = 3; // divide by 8 int margin = cache->glyphMargin(); + const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta); const uchar *bits = image.bits(); for (int i=0; isetFontScale(matrix.m11()); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); + const QFixed aliasDelta = QFixed::fromReal(aliasedCoordinateDelta); for (int i=0; igetCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize); - const int x = qFloor(positions[i].x + tmetrics.HorizBearingX()); - const int y = qFloor(positions[i].y - tmetrics.HorizBearingY()); + const int x = qFloor(positions[i].x + metrics.x + aliasDelta); + const int y = qFloor(positions[i].y + metrics.y + aliasDelta); alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight); } @@ -3086,7 +3101,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte || (fontEngine->type() == QFontEngine::Proxy && !(static_cast(fontEngine)->drawAsOutline())) )) { - fontEngine->draw(this, qFloor(p.x()), qFloor(p.y()), ti); + fontEngine->draw(this, qFloor(p.x() + aliasedCoordinateDelta), qFloor(p.y() + aliasedCoordinateDelta), ti); return; } #endif // Q_WS_QWS @@ -3109,6 +3124,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte for(int i = 0; i < glyphs.size(); i++) { QImage img = fontEngine->alphaMapForGlyph(glyphs[i]); glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[i]); + // ### hm, perhaps an QFixed offs = QFixed::fromReal(aliasedCoordinateDelta) is needed here? alphaPenBlt(img.bits(), img.bytesPerLine(), img.depth(), qRound(positions[i].x + metrics.x), qRound(positions[i].y + metrics.y), diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 6c5edbc44d..1d3f581b88 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -62,8 +62,8 @@ typedef int Q16Dot16; #define SPAN_BUFFER_SIZE 256 -#define COORD_ROUNDING 0 // 0: round up, 1: round down -#define COORD_OFFSET 0 // 26.6, 32 is half a pixel +#define COORD_ROUNDING 1 // 0: round up, 1: round down +#define COORD_OFFSET 32 // 26.6, 32 is half a pixel static inline QT_FT_Vector PointToVector(const QPointF &p) { -- cgit v1.2.3 From 048d840ca2d365c8c60f47ae72d04d6a2a97c379 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 19 May 2011 16:05:02 +0200 Subject: Compilation fix of f8e8583 (cherry picked from commit 7cfd06ee22a875d7658ce6668b418e6f8c6f6480) Change-Id: Iaaed01590874fbcc439f06c17a63f0343d49a9bb Reviewed-on: http://codereview.qt.nokia.com/605 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qpaintengine_raster.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 135db20e27..fa7ca8505d 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2921,6 +2921,7 @@ void QRasterPaintEngine::drawGlyphsS60(const QPointF &p, const QTextItemInt &ti) if (matrix.type() == QTransform::TxScale) fe->setFontScale(matrix.m11()); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); + const QFixed aliasDelta = QFixed::fromReal(aliasedCoordinateDelta); for (int i=0; igetCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize); - const int x = qFloor(positions[i].x + metrics.x + aliasDelta); - const int y = qFloor(positions[i].y + metrics.y + aliasDelta); + const int x = qFloor(positions[i].x + tmetrics.HorizBearingX() + aliasDelta); + const int y = qFloor(positions[i].y - tmetrics.HorizBearingY() + aliasDelta); alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight); } -- cgit v1.2.3 From ad0ecae41cb66bdcaad15a4059cb3c27f6f6bbeb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 19 May 2011 23:19:47 +0200 Subject: Fix smaller bugs in the stroker Calculating the continuation point for closed contours was not taking transformations and the half pixel offset into account. (cherry picked from commit 31e9c098f3c9321eebf1ac3e4c44a2d18d3816b8) Change-Id: I735d8e58fc3cf64668f546d5f42892d420d58e84 Reviewed-on: http://codereview.qt.nokia.com/607 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qcosmeticstroker.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index d694b4b9a8..47a1359288 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -409,10 +409,11 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal if (clipLine(rx1, ry1, rx2, ry2)) return; - int x1 = toF26Dot6(rx1); - int y1 = toF26Dot6(ry1); - int x2 = toF26Dot6(rx2); - int y2 = toF26Dot6(ry2); + const int half = 32; + int x1 = toF26Dot6(rx1) + half; + int y1 = toF26Dot6(ry1) + half; + int x2 = toF26Dot6(rx2) + half; + int y2 = toF26Dot6(ry2) + half; int dx = qAbs(x2 - x1); int dy = qAbs(y2 - y1); @@ -424,6 +425,7 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal swapped = true; qSwap(y1, y2); qSwap(x1, x2); + --x1; --x2; --y1; --y2; } int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); int x = x1 << 10; @@ -455,6 +457,7 @@ void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal swapped = true; qSwap(x1, x2); qSwap(y1, y2); + --x1; --x2; --y1; --y2; } int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); int y = y1 << 10; @@ -525,7 +528,9 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) const QPainterPath::ElementType *e = subPath(type, end, points, &closed); if (closed) { const qreal *p = points + 2*(e-type); - calculateLastPoint(p[-4], p[-3], p[-2], p[-1]); + QPointF p1 = QPointF(p[-4], p[-3]) * state->matrix; + QPointF p2 = QPointF(p[-2], p[-1]) * state->matrix; + calculateLastPoint(p1.x(), p1.y(), p2.x(), p2.y()); } int caps = (!closed & drawCaps) ? CapBegin : NoCaps; // qDebug() << "closed =" << closed << capString(caps); @@ -577,8 +582,10 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) // handle closed path case bool closed = path.hasImplicitClose() || (points[0] == end[-2] && points[1] == end[-1]); int caps = (!closed & drawCaps) ? CapBegin : NoCaps; - if (closed) - calculateLastPoint(end[-2], end[-1], points[0], points[1]); + if (closed) { + QPointF p2 = QPointF(end[-2], end[-1]) * state->matrix; + calculateLastPoint(p2.x(), p2.y(), p.x(), p.y()); + } points += 2; while (points < end) { -- cgit v1.2.3 From bc7f43cd0294d8e1c9f05a3595615573a73028d5 Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 31 May 2011 11:51:10 +0200 Subject: Still use midpoint rendering of aliased ellipses 37c329a removed this, but it is required to get correct fills, particularly for small radii Reviewed-by: gunnar (cherry picked from commit 9d0104d3da01e262d2178c864b4ba94f620eaa3b) Change-Id: I41a5093f3cf725aee3abffde4d871566f0f8151e Reviewed-on: http://codereview.qt.nokia.com/608 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qpaintengine_raster.cpp | 160 +++++++++++++++++++++++++++++++ src/gui/painting/qpaintengine_raster_p.h | 1 + 2 files changed, 161 insertions(+) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index fa7ca8505d..9db6c4f571 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -160,6 +160,10 @@ enum LineDrawMode { LineDrawIncludeLastPixel }; +static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, + ProcessSpans pen_func, ProcessSpans brush_func, + QSpanData *pen_data, QSpanData *brush_data); + struct QRasterFloatPoint { qreal x; qreal y; @@ -3030,6 +3034,19 @@ QRasterPaintEnginePrivate::getBrushFunc(const QRectF &rect, return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend; } +inline ProcessSpans +QRasterPaintEnginePrivate::getPenFunc(const QRectF &rect, + const QSpanData *data) const +{ + Q_Q(const QRasterPaintEngine); + const QRasterPaintEngineState *s = q->state(); + + if (!s->flags.fast_pen && s->matrix.type() > QTransform::TxTranslate) + return data->blend; + const int penWidth = s->flags.fast_pen ? 1 : qCeil(s->lastPen.widthF()); + return isUnclipped(rect, penWidth) ? data->unclipped_blend : data->blend; +} + /*! \reimp */ @@ -3314,6 +3331,30 @@ void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount) */ void QRasterPaintEngine::drawEllipse(const QRectF &rect) { + Q_D(QRasterPaintEngine); + QRasterPaintEngineState *s = state(); + + ensurePen(); + if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen) + || (qpen_style(s->lastPen) == Qt::NoPen)) + && !s->flags.antialiased + && qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT + && !rect.isEmpty() + && s->matrix.type() <= QTransform::TxScale) // no shear + { + ensureBrush(); + const QRectF r = s->matrix.mapRect(rect); + ProcessSpans penBlend = d->getPenFunc(r, &s->penData); + ProcessSpans brushBlend = d->getBrushFunc(r, &s->brushData); + const QRect brect = QRect(int(r.x()), int(r.y()), + int_dim(r.x(), r.width()), + int_dim(r.y(), r.height())); + if (brect == r) { + drawEllipse_midpoint_i(brect, d->deviceRect, penBlend, brushBlend, + &s->penData, &s->brushData); + return; + } + } QPaintEngineEx::drawEllipse(rect); } @@ -4998,6 +5039,125 @@ void QSpanData::initTexture(const QImage *image, int alpha, QTextureData::Type _ adjustSpanMethods(); } +/*! + \internal + \a x and \a y is relative to the midpoint of \a rect. +*/ +static inline void drawEllipsePoints(int x, int y, int length, + const QRect &rect, + const QRect &clip, + ProcessSpans pen_func, ProcessSpans brush_func, + QSpanData *pen_data, QSpanData *brush_data) +{ + if (length == 0) + return; + + QT_FT_Span outline[4]; + const int midx = rect.x() + (rect.width() + 1) / 2; + const int midy = rect.y() + (rect.height() + 1) / 2; + + x = x + midx; + y = midy - y; + + // topleft + outline[0].x = midx + (midx - x) - (length - 1) - (rect.width() & 0x1); + outline[0].len = qMin(length, x - outline[0].x); + outline[0].y = y; + outline[0].coverage = 255; + + // topright + outline[1].x = x; + outline[1].len = length; + outline[1].y = y; + outline[1].coverage = 255; + + // bottomleft + outline[2].x = outline[0].x; + outline[2].len = outline[0].len; + outline[2].y = midy + (midy - y) - (rect.height() & 0x1); + outline[2].coverage = 255; + + // bottomright + outline[3].x = x; + outline[3].len = length; + outline[3].y = outline[2].y; + outline[3].coverage = 255; + + if (brush_func && outline[0].x + outline[0].len < outline[1].x) { + QT_FT_Span fill[2]; + + // top fill + fill[0].x = outline[0].x + outline[0].len - 1; + fill[0].len = qMax(0, outline[1].x - fill[0].x); + fill[0].y = outline[1].y; + fill[0].coverage = 255; + + // bottom fill + fill[1].x = outline[2].x + outline[2].len - 1; + fill[1].len = qMax(0, outline[3].x - fill[1].x); + fill[1].y = outline[3].y; + fill[1].coverage = 255; + + int n = (fill[0].y >= fill[1].y ? 1 : 2); + n = qt_intersect_spans(fill, n, clip); + if (n > 0) + brush_func(n, fill, brush_data); + } + if (pen_func) { + int n = (outline[1].y >= outline[2].y ? 2 : 4); + n = qt_intersect_spans(outline, n, clip); + if (n > 0) + pen_func(n, outline, pen_data); + } +} + +/*! + \internal + Draws an ellipse using the integer point midpoint algorithm. +*/ +static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, + ProcessSpans pen_func, ProcessSpans brush_func, + QSpanData *pen_data, QSpanData *brush_data) +{ + const qreal a = qreal(rect.width()) / 2; + const qreal b = qreal(rect.height()) / 2; + qreal d = b*b - (a*a*b) + 0.25*a*a; + + int x = 0; + int y = (rect.height() + 1) / 2; + int startx = x; + + // region 1 + while (a*a*(2*y - 1) > 2*b*b*(x + 1)) { + if (d < 0) { // select E + d += b*b*(2*x + 3); + ++x; + } else { // select SE + d += b*b*(2*x + 3) + a*a*(-2*y + 2); + drawEllipsePoints(startx, y, x - startx + 1, rect, clip, + pen_func, brush_func, pen_data, brush_data); + startx = ++x; + --y; + } + } + drawEllipsePoints(startx, y, x - startx + 1, rect, clip, + pen_func, brush_func, pen_data, brush_data); + + // region 2 + d = b*b*(x + 0.5)*(x + 0.5) + a*a*((y - 1)*(y - 1) - b*b); + const int miny = rect.height() & 0x1; + while (y > miny) { + if (d < 0) { // select SE + d += b*b*(2*x + 2) + a*a*(-2*y + 3); + ++x; + } else { // select S + d += a*a*(-2*y + 3); + } + --y; + drawEllipsePoints(x, y, 1, rect, clip, + pen_func, brush_func, pen_data, brush_data); + } +} /*! \fn void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount) diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 2bf25f9d40..8774fda4e3 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -327,6 +327,7 @@ public: bool isUnclipped_normalized(const QRect &rect) const; bool isUnclipped(const QRect &rect, int penWidth) const; bool isUnclipped(const QRectF &rect, int penWidth) const; + ProcessSpans getPenFunc(const QRectF &rect, const QSpanData *data) const; ProcessSpans getBrushFunc(const QRect &rect, const QSpanData *data) const; ProcessSpans getBrushFunc(const QRectF &rect, const QSpanData *data) const; -- cgit v1.2.3 From f1c49cd12d707901192648b41b4fc0d76660acd8 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 2 Jun 2011 15:29:11 +0200 Subject: Fix problem with cosmetic stroking of cubic beziers The new algorithm would fail if the start and end point were identical. (cherry picked from commit 43ce5bab32e0d28366317be99df5e6df70787826) Change-Id: I44c42b190db95b831fd04492e4afe3555fb3db50 Reviewed-on: http://codereview.qt.nokia.com/610 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qcosmeticstroker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 47a1359288..cdc0978ed7 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -663,8 +663,8 @@ void QCosmeticStroker::renderCubicSubdivision(QCosmeticStroker::PointF *points, qreal dy = points[3].y - points[0].y; qreal len = ((qreal).25) * (qAbs(dx) + qAbs(dy)); - if (qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) > len || - qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) > len) { + if (qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) >= len || + qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) >= len) { splitCubic(points); --level; -- cgit v1.2.3 From a964e56228d147c1acf748e4fe69004593d38c2d Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Mon, 27 Jun 2011 13:34:46 +0200 Subject: Change references to affine example. Because of the merge of demos and examples all references to all demos have to be updated. This is the update for the affine example. Change-Id: I83f24010162a73e11786587365c6f10b51d4bf4b Reviewed-on: http://codereview.qt.nokia.com/774 Reviewed-by: Qt Sanity Bot Reviewed-by: David Boddie --- src/gui/painting/qmatrix.cpp | 2 +- src/gui/painting/qpainter.cpp | 6 +++--- src/gui/painting/qtransform.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index 6209e66a7b..7bb2324a2f 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -177,7 +177,7 @@ QT_BEGIN_NAMESPACE \endtable \sa QPainter, QTransform, {Coordinate System}, - {demos/affine}{Affine Transformations Demo}, {Transformations Example} + {painting/affine}{Affine Transformations Example}, {Transformations Example} */ diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b13ca94b30..73addd2679 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1223,7 +1223,7 @@ void QPainterPrivate::updateState(QPainterState *newState) rotate it clockwise and translate() to translate it (i.e. adding a given offset to the points). You can also twist the coordinate system around the origin using the shear() function. See the \l - {demos/affine}{Affine Transformations} demo for a visualization of + {painting/affine}{Affine Transformations} example for a visualization of a sheared coordinate system. See also the \l {painting/transformations}{Transformations} @@ -1234,9 +1234,9 @@ void QPainterPrivate::updateState(QPainterState *newState) \table 100% \row \o - \bold {Affine Transformations Demo} + \bold {Affine Transformations Example} - The \l {demos/affine}{Affine Transformations} demo show Qt's + The \l {painting/affine}{Affine Transformations} example shows Qt's ability to perform affine transformations on painting operations. The demo also allows the user to experiment with the transformation operations and see the results immediately. diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 4d7b3391a6..e42eec6f96 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -223,8 +223,8 @@ QT_BEGIN_NAMESPACE \snippet doc/src/snippets/transform/main.cpp 2 \endtable - \sa QPainter, {Coordinate System}, {demos/affine}{Affine - Transformations Demo}, {Transformations Example} + \sa QPainter, {Coordinate System}, {painting/affine}{Affine + Transformations Example}, {Transformations Example} */ /*! -- cgit v1.2.3 From 73df041f6c7f8c5f8d22fbaacb661d1f5d4cf5d6 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 28 Jun 2011 14:02:37 +0200 Subject: Remove code with no consquence Change-Id: Ic048be26cd4ffe1094e4badd34a0df233aa9b5d5 Reviewed-on: http://codereview.qt.nokia.com/832 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/gui/painting/qpaintengine_raster.cpp | 31 ------------------------------- src/gui/painting/qpaintengine_raster_p.h | 4 ---- 2 files changed, 35 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 9db6c4f571..c1b749ad01 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -483,10 +483,6 @@ bool QRasterPaintEngine::begin(QPaintDevice *device) } #endif -#if defined(Q_WS_WIN) - d->isPlain45DegreeRotation = true; -#endif - if (d->mono_surface) d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono; #if defined(Q_WS_WIN) @@ -590,33 +586,6 @@ void QRasterPaintEngine::updateMatrix(const QTransform &matrix) s->flags.tx_noshear = qt_scaleForTransform(s->matrix, &s->txscale); ensureOutlineMapper(); - -#ifdef Q_WS_WIN - Q_D(QRasterPaintEngine); - d->isPlain45DegreeRotation = false; - if (txop >= QTransform::TxRotate) { - d->isPlain45DegreeRotation = - (qFuzzyIsNull(matrix.m11()) - && qFuzzyIsNull(matrix.m12() - qreal(1)) - && qFuzzyIsNull(matrix.m21() + qreal(1)) - && qFuzzyIsNull(matrix.m22()) - ) - || - (qFuzzyIsNull(matrix.m11() + qreal(1)) - && qFuzzyIsNull(matrix.m12()) - && qFuzzyIsNull(matrix.m21()) - && qFuzzyIsNull(matrix.m22() + qreal(1)) - ) - || - (qFuzzyIsNull(matrix.m11()) - && qFuzzyIsNull(matrix.m12() + qreal(1)) - && qFuzzyIsNull(matrix.m21() - qreal(1)) - && qFuzzyIsNull(matrix.m22()) - ) - ; - } -#endif - } diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 8774fda4e3..f9d388d14e 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -374,10 +374,6 @@ public: uint mono_surface : 1; uint outlinemapper_xform_dirty : 1; -#ifdef Q_WS_WIN - uint isPlain45DegreeRotation : 1; -#endif - QScopedPointer rasterizer; }; -- cgit v1.2.3 From 01b72952c38b9193138eabdab6bdab632cd75ebd Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 28 Jun 2011 15:08:12 +0200 Subject: Remove QPainter::UniteClip Change-Id: I5413cb5e2cbb53998bb40f27b9bbc16342caafe6 Reviewed-on: http://codereview.qt.nokia.com/837 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/painting/qpaintengine_mac.cpp | 5 ----- src/gui/painting/qpaintengine_raster.cpp | 19 ++----------------- src/gui/painting/qpaintengine_x11.cpp | 5 ----- src/gui/painting/qpainter.cpp | 19 ++++--------------- src/gui/painting/qprintengine_win.cpp | 3 +-- 5 files changed, 7 insertions(+), 44 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index 802c455ab8..0d459a5d89 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -798,9 +798,6 @@ QCoreGraphicsPaintEngine::updateClipPath(const QPainterPath &p, Qt::ClipOperatio } else if(op == Qt::IntersectClip) { d->current.clip = d->current.clip.intersected(clipRegion); d->setClip(&d->current.clip); - } else if(op == Qt::UniteClip) { - d->current.clip = d->current.clip.united(clipRegion); - d->setClip(&d->current.clip); } } } @@ -822,8 +819,6 @@ QCoreGraphicsPaintEngine::updateClipRegion(const QRegion &clipRegion, Qt::ClipOp d->current.clip = d->current.clip.intersected(clipRegion); else if(op == Qt::ReplaceClip) d->current.clip = clipRegion; - else if(op == Qt::UniteClip) - d->current.clip = d->current.clip.united(clipRegion); d->setClip(&d->current.clip); } } diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index c1b749ad01..e1802e6552 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1162,8 +1162,7 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) const QPainterPath::ElementType *types = path.elements(); // There are some cases that are not supported by clip(QRect) - if (op != Qt::UniteClip && (op != Qt::IntersectClip || !s->clip - || s->clip->hasRectClip || s->clip->hasRegionClip)) { + if (op != Qt::IntersectClip || !s->clip || s->clip->hasRectClip || s->clip->hasRegionClip) { if (s->matrix.type() <= QTransform::TxScale && ((path.shape() == QVectorPath::RectangleHint) || (isRect(points, path.elementCount()) @@ -1206,18 +1205,6 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) newClip->fixup(); - if (op == Qt::UniteClip) { - // merge clips - QClipData *result = new QClipData(d->rasterBuffer->height()); - QClipData *current = s->clip ? s->clip : new QClipData(d->rasterBuffer->height()); - qt_merge_clip(current, newClip, result); - result->fixup(); - delete newClip; - if (!s->clip) - delete current; - newClip = result; - } - if (s->flags.has_clip_ownership) delete s->clip; @@ -1243,7 +1230,7 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) if (op == Qt::NoClip) { qrasterpaintengine_state_setNoClip(s); - } else if (op == Qt::UniteClip || s->matrix.type() > QTransform::TxScale) { + } else if (s->matrix.type() > QTransform::TxScale) { QPaintEngineEx::clip(rect, op); return; @@ -1328,7 +1315,6 @@ void QRasterPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) if (op == Qt::NoClip) { qrasterpaintengine_state_setNoClip(s); } else if (s->matrix.type() > QTransform::TxScale - || op == Qt::UniteClip || (op == Qt::IntersectClip && !clip->hasRectClip && !clip->hasRegionClip) || (op == Qt::ReplaceClip && !baseClip->hasRectClip && !baseClip->hasRegionClip)) { QPaintEngineEx::clip(region, op); @@ -4450,7 +4436,6 @@ static void qt_span_clip(int count, const QSpan *spans, void *userData) } break; - case Qt::UniteClip: case Qt::ReplaceClip: clipData->newClip->appendSpans(spans, count); break; diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 994986b0d6..5f613ee001 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -2078,11 +2078,6 @@ void QX11PaintEngine::updateClipRegion_dev(const QRegion &clipRegion, Qt::ClipOp else d->crgn = clipRegion; break; - case Qt::UniteClip: - d->crgn |= clipRegion; - if (!sysClip.isEmpty()) - d->crgn = d->crgn.intersected(sysClip); - break; default: break; } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 73addd2679..83bdc5cb30 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2576,8 +2576,6 @@ QRegion QPainter::clipRegion() const } if (info.operation == Qt::IntersectClip) region &= info.region * matrix; - else if (info.operation == Qt::UniteClip) - region |= info.region * matrix; else if (info.operation == Qt::NoClip) { lastWasNothing = true; region = QRegion(); @@ -2597,9 +2595,6 @@ QRegion QPainter::clipRegion() const if (info.operation == Qt::IntersectClip) { region &= QRegion((info.path * matrix).toFillPolygon().toPolygon(), info.path.fillRule()); - } else if (info.operation == Qt::UniteClip) { - region |= QRegion((info.path * matrix).toFillPolygon().toPolygon(), - info.path.fillRule()); } else if (info.operation == Qt::NoClip) { lastWasNothing = true; region = QRegion(); @@ -2623,8 +2618,6 @@ QRegion QPainter::clipRegion() const region &= matrix.mapRect(info.rect); else region &= matrix.map(QRegion(info.rect)); - } else if (info.operation == Qt::UniteClip) { - region |= QRegion(info.rect) * matrix; } else if (info.operation == Qt::NoClip) { lastWasNothing = true; region = QRegion(); @@ -2647,8 +2640,6 @@ QRegion QPainter::clipRegion() const region &= matrix.mapRect(info.rectf.toRect()); else region &= matrix.map(QRegion(info.rectf.toRect())); - } else if (info.operation == Qt::UniteClip) { - region |= QRegion(info.rectf.toRect()) * matrix; } else if (info.operation == Qt::NoClip) { lastWasNothing = true; region = QRegion(); @@ -2759,8 +2750,6 @@ QRectF QPainter::clipBoundingRect() const bounds = r; else if (info.operation == Qt::IntersectClip) bounds &= r; - else if (info.operation == Qt::UniteClip) - bounds |= r; } @@ -2789,7 +2778,7 @@ void QPainter::setClipRect(const QRectF &rect, Qt::ClipOperation op) Q_D(QPainter); if (d->extended) { - if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) + if ((!d->state->clipEnabled && op != Qt::NoClip)) op = Qt::ReplaceClip; if (!d->engine) { @@ -2847,7 +2836,7 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) return; } - if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) + if ((!d->state->clipEnabled && op != Qt::NoClip)) op = Qt::ReplaceClip; if (d->extended) { @@ -2902,7 +2891,7 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) return; } - if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) + if ((!d->state->clipEnabled && op != Qt::NoClip)) op = Qt::ReplaceClip; if (d->extended) { @@ -3307,7 +3296,7 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) return; } - if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) + if ((!d->state->clipEnabled && op != Qt::NoClip)) op = Qt::ReplaceClip; if (d->extended) { diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index ebce404c3c..5ba33c043c 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -586,8 +586,7 @@ void QWin32PrintEngine::updateClipPath(const QPainterPath &clipPath, Qt::ClipOpe const int ops[] = { -1, // Qt::NoClip, covered above RGN_COPY, // Qt::ReplaceClip - RGN_AND, // Qt::IntersectClip - RGN_OR // Qt::UniteClip + RGN_AND // Qt::IntersectClip }; Q_ASSERT(op > 0 && unsigned(op) <= sizeof(ops) / sizeof(int)); SelectClipPath(d->hdc, ops[op]); -- cgit v1.2.3 From df515ded6096a3c24df7bc9307a12790a6f474e1 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 3 Jun 2011 15:38:44 +0200 Subject: Doc: Fixed qdoc warnings. Change-Id: I7b4e9ef513b82a82d2365c9256d09520a44ad10d Reviewed-on: http://codereview.qt.nokia.com/324 Reviewed-by: Qt Sanity Bot Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qpainter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 83bdc5cb30..82e552481c 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5773,6 +5773,8 @@ void QPainter::drawImage(const QRectF &targetRect, const QImage &image, const QR } /*! + \fn void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphs) + Draws the glyphs represented by \a glyphs at \a position. The \a position gives the edge of the baseline for the string of glyphs. The glyphs will be retrieved from the font selected on \a glyphs and at offsets given by the positions in \a glyphs. -- cgit v1.2.3 From 640c5d8a992f4ac6f9068aea9ec51a99a40dfc16 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Wed, 29 Jun 2011 12:15:06 +0200 Subject: Move the composition example in the docs. Change-Id: I63e906e78de75466b9c9bf99d553691c8335f9b2 Reviewed-on: http://codereview.qt.nokia.com/903 Reviewed-by: Qt Sanity Bot Reviewed-by: Kevin Wright --- src/gui/painting/qpainter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 82e552481c..8b556ca7c1 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1320,8 +1320,8 @@ void QPainterPrivate::updateState(QPainterState *newState) \o \bold {Composition Modes Demo} - The \l {demos/composition}{Composition Modes} demo, available in - Qt's demo directory, allows you to experiment with the various + The \l {painting/composition}{Composition Modes} example, available in + Qt's examples directory, allows you to experiment with the various composition modes and see the results immediately. \endtable -- cgit v1.2.3 From 1da4753bd944baf0758bf758001bf6449ec8da7f Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 4 Jul 2011 10:37:56 +0200 Subject: Doc: Fixing typo (cherry picked from commit 0a9652c93170ab9520869e9e231eba1834b47abc) Conflicts: tests/auto/mediaobject/tst_mediaobject.cpp tests/auto/q3accel/tst_q3accel.cpp tests/auto/q3checklistitem/tst_q3checklistitem.cpp tests/auto/q3dns/tst_q3dns.cpp tests/auto/q3popupmenu/tst_q3popupmenu.cpp tools/linguist/tests/tst_lupdate.cpp Change-Id: I118829afb27ab082f9656139102f74f9ab5f7ac4 Reviewed-on: http://codereview.qt.nokia.com/1035 Reviewed-by: Casper van Donderen Reviewed-by: David Boddie --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 8b556ca7c1..b57f6d77d7 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2728,7 +2728,7 @@ QRectF QPainter::clipBoundingRect() const } // Accumulate the bounding box in device space. This is not 100% - // precise, but it fits within the guarantee and it is resonably + // precise, but it fits within the guarantee and it is reasonably // fast. QRectF bounds; for (int i=0; istate->clipInfo.size(); ++i) { -- cgit v1.2.3 From 1734cb55c5049ae7bead9ed5474f067ee6536e4f Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 30 Jun 2011 09:42:52 +0200 Subject: Move some other examples around in the docs. Change-Id: Ib50600ff9fd3d807b82a152abd7d587196d5b5e3 Reviewed-on: http://codereview.qt.nokia.com/932 Reviewed-by: Qt Sanity Bot Reviewed-by: David Boddie --- src/gui/painting/qbrush.cpp | 14 +++++++------- src/gui/painting/qpainter.cpp | 10 +++++----- src/gui/painting/qpainterpath.cpp | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 79c4c4e4e4..8599cb1d75 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -1307,7 +1307,7 @@ QDataStream &operator>>(QDataStream &s, QBrush &b) {coordinate mode} use coordinateMode(). - \sa {demos/gradients}{The Gradients Demo}, QBrush + \sa {painting/gradients}{The Gradients Example}, QBrush */ /*! @@ -1617,8 +1617,8 @@ bool QGradient::operator==(const QGradient &gradient) returns the final stop point of the gradient, and the start() function returning the start point of the gradient. - \sa QRadialGradient, QConicalGradient, {demos/gradients}{The - Gradients Demo} + \sa QRadialGradient, QConicalGradient, {painting/gradients}{The + Gradients Example} */ @@ -1803,8 +1803,8 @@ void QLinearGradient::setFinalStop(const QPointF &stop) radius() functions returning the gradient's center, focal point and radius respectively. - \sa QLinearGradient, QConicalGradient, {demos/gradients}{The - Gradients Demo} + \sa QLinearGradient, QConicalGradient, {painting/gradients}{The + Gradients Example} */ static QPointF qt_radial_gradient_adapt_focal_point(const QPointF ¢er, @@ -2173,8 +2173,8 @@ void QRadialGradient::setFocalPoint(const QPointF &focalPoint) gradient can be specified through its radius or final stop points, respectively. - \sa QLinearGradient, QRadialGradient, {demos/gradients}{The - Gradients Demo} + \sa QLinearGradient, QRadialGradient, {painting/gradients}{The + Gradients Example} */ diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b57f6d77d7..d5a0dd7f40 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1119,9 +1119,9 @@ void QPainterPrivate::updateState(QPainterState *newState) function that draws the outline of the given path (i.e. strokes the path). - See also the \l {demos/deform}{Vector Deformation} demo which + See also the \l {painting/deform}{Vector Deformation} example which shows how to use advanced vector techniques to draw text using a - QPainterPath, the \l {demos/gradients}{Gradients} demo which shows + QPainterPath, the \l {painting/gradients}{Gradients} example which shows the different types of gradients that are available in Qt, and the \l {demos/pathstroke}{Path Stroking} demo which shows Qt's built-in dash patterns and shows how custom patterns can be used to extend @@ -1129,8 +1129,8 @@ void QPainterPrivate::updateState(QPainterState *newState) \table \header - \o \l {demos/deform}{Vector Deformation} - \o \l {demos/gradients}{Gradients} + \o \l {painting/deform}{Vector Deformation} + \o \l {painting/gradients}{Gradients} \o \l {demos/pathstroke}{Path Stroking} \row \o \inlineimage qpainter-vectordeformation.png @@ -3413,7 +3413,7 @@ void QPainter::fillPath(const QPainterPath &path, const QBrush &brush) \endtable \sa {painting/painterpaths}{the Painter Paths - example},{demos/deform}{the Vector Deformation demo} + example},{painting/deform}{the Vector Deformation example} */ void QPainter::drawPath(const QPainterPath &path) { diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index c238578199..8bb599f9f0 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -305,19 +305,19 @@ static void qt_debug_path(const QPainterPath &path) \section1 Examples Qt provides the \l {painting/painterpaths}{Painter Paths Example} - and the \l {demos/deform}{Vector Deformation Demo} which are - located in Qt's example and demo directories respectively. + and the \l {painting/deform}{Vector Deformation example} which are + located in Qt's example directory. The \l {painting/painterpaths}{Painter Paths Example} shows how painter paths can be used to build complex shapes for rendering and lets the user experiment with the filling and stroking. The - \l {demos/deform}{Vector Deformation Demo} shows how to use + \l {painting/deform}{Vector Deformation Example} shows how to use QPainterPath to draw text. \table \header \o \l {painting/painterpaths}{Painter Paths Example} - \o \l {demos/deform}{Vector Deformation Demo} + \o \l {painting/deform}{Vector Deformation Example} \row \o \inlineimage qpainterpath-example.png \o \inlineimage qpainterpath-demo.png -- cgit v1.2.3 From 1631be8176d51ae67cdf1627c3fdf459e2e0937b Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Fri, 1 Jul 2011 14:59:19 +0200 Subject: Update the documentation after moving examples. Change-Id: I7aa52785979df9eddd7b91e62abd0ef10adc74b7 Reviewed-on: http://codereview.qt.nokia.com/1031 Reviewed-by: Qt Sanity Bot Reviewed-by: David Boddie --- src/gui/painting/qpainter.cpp | 4 ++-- src/gui/painting/qpen.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index d5a0dd7f40..6a4c7db7f0 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1123,7 +1123,7 @@ void QPainterPrivate::updateState(QPainterState *newState) shows how to use advanced vector techniques to draw text using a QPainterPath, the \l {painting/gradients}{Gradients} example which shows the different types of gradients that are available in Qt, and the \l - {demos/pathstroke}{Path Stroking} demo which shows Qt's built-in + {painting/pathstroke}{Path Stroking} example which shows Qt's built-in dash patterns and shows how custom patterns can be used to extend the range of available patterns. @@ -1131,7 +1131,7 @@ void QPainterPrivate::updateState(QPainterState *newState) \header \o \l {painting/deform}{Vector Deformation} \o \l {painting/gradients}{Gradients} - \o \l {demos/pathstroke}{Path Stroking} + \o \l {painting/pathstroke}{Path Stroking} \row \o \inlineimage qpainter-vectordeformation.png \o \inlineimage qpainter-gradients.png diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index cc652d84f2..7185f0d346 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -214,14 +214,14 @@ typedef QPenPrivate QPenData; \table 100% \row \o \inlineimage qpen-demo.png - \o \bold {\l {demos/pathstroke}{The Path Stroking Demo}} + \o \bold {\l {painting/pathstroke}{The Path Stroking Example}} - The Path Stroking demo shows Qt's built-in dash patterns and shows + The Path Stroking example shows Qt's built-in dash patterns and shows how custom patterns can be used to extend the range of available patterns. \endtable - \sa QPainter, QBrush, {demos/pathstroke}{Path Stroking Demo}, + \sa QPainter, QBrush, {painting/pathstroke}{Path Stroking Example}, {Scribble Example} */ -- cgit v1.2.3