Fixed outline / fill inconsistencies in raster paint engine.
We did coordinate rounding of the fill in the raster paint engine to match how drawLine_midpoint_i rendered lines. With the new cosmetic stroker in 4.8 this rounding is not needed anymore. Task-number: QTBUG-26013 Change-Id: Ibe86fa809276c8e7988d393a67e772d57b9a4799 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
72aaba336c
commit
b6acec1e5d
@ -226,13 +226,6 @@ void QOutlineMapper::endOutline()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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, m_elements.size());
|
controlPointRect = boundingRect(elements, m_elements.size());
|
||||||
|
|
||||||
#ifdef QT_DEBUG_CONVERT
|
#ifdef QT_DEBUG_CONVERT
|
||||||
|
@ -95,8 +95,7 @@ public:
|
|||||||
m_points(0),
|
m_points(0),
|
||||||
m_tags(0),
|
m_tags(0),
|
||||||
m_contours(0),
|
m_contours(0),
|
||||||
m_in_clip_elements(false),
|
m_in_clip_elements(false)
|
||||||
m_round_coords(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,8 +196,6 @@ public:
|
|||||||
QT_FT_Outline *convertPath(const QPainterPath &path);
|
QT_FT_Outline *convertPath(const QPainterPath &path);
|
||||||
QT_FT_Outline *convertPath(const QVectorPath &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(); }
|
inline QPainterPath::ElementType *elementTypes() const { return m_element_types.size() == 0 ? 0 : m_element_types.data(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -231,9 +228,6 @@ public:
|
|||||||
|
|
||||||
bool m_valid;
|
bool m_valid;
|
||||||
bool m_in_clip_elements;
|
bool m_in_clip_elements;
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_round_coords;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -1932,11 +1932,8 @@ void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly
|
|||||||
if (mode != PolylineMode) {
|
if (mode != PolylineMode) {
|
||||||
// Do the fill...
|
// Do the fill...
|
||||||
ensureBrush();
|
ensureBrush();
|
||||||
if (s->brushData.blend) {
|
if (s->brushData.blend)
|
||||||
d->outlineMapper->setCoordinateRounding(s->penData.blend && s->flags.fast_pen && s->lastPen.brush().isOpaque());
|
|
||||||
fillPolygon(points, pointCount, mode);
|
fillPolygon(points, pointCount, mode);
|
||||||
d->outlineMapper->setCoordinateRounding(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do the outline...
|
// Do the outline...
|
||||||
@ -1982,7 +1979,6 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
|
|||||||
if (s->brushData.blend) {
|
if (s->brushData.blend) {
|
||||||
// Compose polygon fill..,
|
// Compose polygon fill..,
|
||||||
ensureOutlineMapper();
|
ensureOutlineMapper();
|
||||||
d->outlineMapper->setCoordinateRounding(s->penData.blend != 0);
|
|
||||||
d->outlineMapper->beginOutline(mode == WindingMode ? Qt::WindingFill : Qt::OddEvenFill);
|
d->outlineMapper->beginOutline(mode == WindingMode ? Qt::WindingFill : Qt::OddEvenFill);
|
||||||
d->outlineMapper->moveTo(*points);
|
d->outlineMapper->moveTo(*points);
|
||||||
const QPoint *p = points;
|
const QPoint *p = points;
|
||||||
@ -1996,7 +1992,6 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
|
|||||||
ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
|
ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
|
||||||
&s->brushData);
|
&s->brushData);
|
||||||
d->rasterize(d->outlineMapper->outline(), brushBlend, &s->brushData, d->rasterBuffer.data());
|
d->rasterize(d->outlineMapper->outline(), brushBlend, &s->brushData, d->rasterBuffer.data());
|
||||||
d->outlineMapper->setCoordinateRounding(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user