summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-06-06 11:19:45 (GMT)
committerLiang Qi <liang.qi@nokia.com>2011-06-06 11:19:45 (GMT)
commit872da4c22ed2a82c7e2624b8aef8ebba6c1323d9 (patch)
treecd786e093b64b8685a5d49bd48778a9650ee241f /src/gui/painting
parent1a74ca1d05c7c819db89a82de613d73244b7a980 (diff)
parented2b7e6c592dcf24de2bf34a693f54b5dd569194 (diff)
downloadQt-872da4c22ed2a82c7e2624b8aef8ebba6c1323d9.zip
Qt-872da4c22ed2a82c7e2624b8aef8ebba6c1323d9.tar.gz
Qt-872da4c22ed2a82c7e2624b8aef8ebba6c1323d9.tar.bz2
Merge branch '4.7' into qt-4.8-from-4.7
Conflicts: src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontengine_ft.cpp src/s60installs/bwins/QtGuiu.def
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp10
-rw-r--r--src/gui/painting/qpainter.cpp9
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp8
3 files changed, 20 insertions, 7 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 5ce94f8..96be2b8 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3167,7 +3167,15 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
} else
#endif
{
- QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(fontEngine->glyphFormat) : d->glyphCacheType;
+ QFontEngineGlyphCache::Type glyphType;
+ if (fontEngine->glyphFormat >= 0) {
+ glyphType = QFontEngineGlyphCache::Type(fontEngine->glyphFormat);
+ } else if (s->matrix.type() > QTransform::TxTranslate
+ && d->glyphCacheType == QFontEngineGlyphCache::Raster_RGBMask) {
+ glyphType = QFontEngineGlyphCache::Raster_A8;
+ } else {
+ glyphType = d->glyphCacheType;
+ }
QImageTextureGlyphCache *cache =
static_cast<QImageTextureGlyphCache *>(fontEngine->glyphCache(0, glyphType, s->matrix));
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 17b7451..760fdca 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -2868,6 +2868,9 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op)
return;
}
+ if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip)
+ op = Qt::ReplaceClip;
+
d->state->clipRegion = rect;
d->state->clipOperation = op;
if (op == Qt::NoClip || op == Qt::ReplaceClip)
@@ -2923,6 +2926,9 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op)
return;
}
+ if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip)
+ op = Qt::ReplaceClip;
+
d->state->clipRegion = r;
d->state->clipOperation = op;
if (op == Qt::NoClip || op == Qt::ReplaceClip)
@@ -3328,6 +3334,9 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op)
return;
}
+ if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip)
+ op = Qt::ReplaceClip;
+
d->state->clipPath = path;
d->state->clipOperation = op;
if (op == Qt::NoClip || op == Qt::ReplaceClip)
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 53fefa4..dd56fbb 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -296,14 +296,10 @@ void QTextureGlyphCache::fillInPendingGlyphs()
QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const
{
#if defined(Q_WS_X11)
- if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) {
+ if (m_type != Raster_RGBMask && m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) {
QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None;
QImage::Format imageFormat = QImage::Format_Invalid;
switch (m_type) {
- case Raster_RGBMask:
- format = QFontEngineFT::Format_A32;
- imageFormat = QImage::Format_RGB32;
- break;
case Raster_A8:
format = QFontEngineFT::Format_A8;
imageFormat = QImage::Format_Indexed8;
@@ -386,7 +382,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
}
#endif
- if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
+ if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()),
qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(),
m_image.format());