summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-10-05 00:10:04 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-10-05 00:10:04 (GMT)
commitd2eb1ed680353dc326b68119c384d0f09d4aae62 (patch)
treecac4b62d51bd6732ab48527d71843496636a8844 /src/gui/painting
parentc7bf2d79f37ac302dad9a5782645bd3f465bb47d (diff)
parentc1f9978c9d61bcbdb2f280185a3abdea13d7f532 (diff)
downloadQt-d2eb1ed680353dc326b68119c384d0f09d4aae62.zip
Qt-d2eb1ed680353dc326b68119c384d0f09d4aae62.tar.gz
Qt-d2eb1ed680353dc326b68119c384d0f09d4aae62.tar.bz2
Merge commit 'c1f9978c9d61bcbdb2f280185a3abdea13d7f532' into master-from-4.7
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qgrayraster.c4
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp2
-rw-r--r--src/gui/painting/qrasterdefs_p.h2
-rw-r--r--src/gui/painting/qstroker.cpp9
-rw-r--r--src/gui/painting/qstroker_p.h3
6 files changed, 13 insertions, 9 deletions
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index d0e25a9..ec9ebeb 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -325,6 +325,7 @@
{
void* buffer;
long buffer_size;
+ long buffer_allocated_size;
int band_size;
void* memory;
PWorker worker;
@@ -1791,7 +1792,7 @@
// If raster object and raster buffer are allocated, but
// raster size isn't of the minimum size, indicate out of
// memory.
- if (raster && raster->buffer && raster->buffer_size < MINIMUM_POOL_SIZE )
+ if (raster->buffer_allocated_size < MINIMUM_POOL_SIZE )
return ErrRaster_OutOfMemory;
/* return immediately if the outline is empty */
@@ -1930,6 +1931,7 @@
rast->buffer_size = 0;
rast->worker = NULL;
}
+ rast->buffer_allocated_size = pool_size;
}
}
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 1e857e4..c1e3d66 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -517,7 +517,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());
d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform());
} else {
- d->activeStroker->setCurveThresholdFromTransform(state()->matrix);
+ d->activeStroker->setCurveThresholdFromTransform(QTransform());
d->activeStroker->begin(d->strokeHandler);
if (types) {
while (points < lastPoint) {
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 1402b44..b0ca6ed 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -6311,7 +6311,7 @@ void QPainter::drawText(const QRectF &r, int flags, const QString &str, QRectF *
By default, QPainter draws text anti-aliased.
- \note The y-position is used as the baseline of the font.
+ \note The y-position is used as the top of the font.
\sa Qt::AlignmentFlag, Qt::TextFlag
*/
diff --git a/src/gui/painting/qrasterdefs_p.h b/src/gui/painting/qrasterdefs_p.h
index 4131e4b..f6339ed 100644
--- a/src/gui/painting/qrasterdefs_p.h
+++ b/src/gui/painting/qrasterdefs_p.h
@@ -100,7 +100,7 @@ QT_FT_BEGIN_HEADER
/* distances in integer font units, or 16,16, or 26.6 fixed float */
/* pixel coordinates. */
/* */
- typedef signed long QT_FT_Pos;
+ typedef signed int QT_FT_Pos;
/*************************************************************************/
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 9cff339..9decf41 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -190,6 +190,7 @@ static inline qreal adapted_angle_on_x(const QLineF &line)
QStrokerOps::QStrokerOps()
: m_elements(0)
, m_curveThreshold(qt_real_to_fixed(0.25))
+ , m_dashThreshold(qt_real_to_fixed(0.25))
, m_customData(0)
, m_moveTo(0)
, m_lineTo(0)
@@ -243,7 +244,7 @@ void QStrokerOps::strokePath(const QPainterPath &path, void *customData, const Q
if (path.isEmpty())
return;
- setCurveThresholdFromTransform(matrix);
+ setCurveThresholdFromTransform(QTransform());
begin(customData);
int count = path.elementCount();
if (matrix.isIdentity()) {
@@ -315,7 +316,7 @@ void QStrokerOps::strokePolygon(const QPointF *points, int pointCount, bool impl
if (!pointCount)
return;
- setCurveThresholdFromTransform(matrix);
+ setCurveThresholdFromTransform(QTransform());
begin(data);
if (matrix.isIdentity()) {
moveTo(qt_real_to_fixed(points[0].x()), qt_real_to_fixed(points[0].y()));
@@ -356,7 +357,7 @@ void QStrokerOps::strokeEllipse(const QRectF &rect, void *data, const QTransform
}
}
- setCurveThresholdFromTransform(matrix);
+ setCurveThresholdFromTransform(QTransform());
begin(data);
moveTo(qt_real_to_fixed(start.x()), qt_real_to_fixed(start.y()));
for (int i=0; i<12; i+=3) {
@@ -1142,7 +1143,7 @@ void QDashStroker::processCurrentSubpath()
QPainterPath dashPath;
- QSubpathFlatIterator it(&m_elements, m_curveThreshold);
+ QSubpathFlatIterator it(&m_elements, m_dashThreshold);
qfixed2d prev = it.next();
bool clipping = !m_clip_rect.isEmpty();
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index d646135..5607a8e 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -168,7 +168,7 @@ public:
{
qreal scale;
qt_scaleForTransform(transform, &scale);
- setCurveThreshold(scale == 0 ? qreal(0.5) : (qreal(0.5) / scale));
+ m_dashThreshold = scale == 0 ? qreal(0.5) : (qreal(0.5) / scale);
}
void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
@@ -184,6 +184,7 @@ protected:
QRectF m_clip_rect;
qfixed m_curveThreshold;
+ qfixed m_dashThreshold;
void *m_customData;
qStrokerMoveToHook m_moveTo;