summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-11 14:54:15 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-11 14:54:15 (GMT)
commit5906f4dc55e52b233200f7196f4ce7094f764f6a (patch)
tree549603bf9ff404a5e046e06d27cee2ccbd944569
parent1e75074df0424f652c0ad1f28ef822a6a4b7d9f6 (diff)
parentd9a6d2e28e4a38ff1242e5e9b1d2225844a51a00 (diff)
downloadQt-5906f4dc55e52b233200f7196f4ce7094f764f6a.zip
Qt-5906f4dc55e52b233200f7196f4ce7094f764f6a.tar.gz
Qt-5906f4dc55e52b233200f7196f4ce7094f764f6a.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make QCUPSSupport::printerHasPPD() clean up after itself. document the slowness of QPixmap::hasAlpha() Speed up custom bitmap brushes on X11 without Xrender support.
-rw-r--r--src/gui/image/qpixmap.cpp9
-rw-r--r--src/gui/painting/qcups.cpp4
-rw-r--r--src/gui/painting/qpainter.cpp7
3 files changed, 12 insertions, 8 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index d1e5c40..1df7946 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1670,10 +1670,9 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
\o
The hasAlphaChannel() returns true if the pixmap has a format that
- respects the alpha channel, otherwise returns false, while the
- hasAlpha() function returns true if the pixmap has an alpha
- channel \e or a mask (otherwise false). The mask() function returns
- the mask as a QBitmap object, which can be set using setMask().
+ respects the alpha channel, otherwise returns false. The hasAlpha(),
+ setMask() and mask() functions are legacy and should not be used.
+ They are potentially very slow.
The createHeuristicMask() function creates and returns a 1-bpp
heuristic mask (i.e. a QBitmap) for this pixmap. It works by
@@ -1760,6 +1759,8 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
Returns true if this pixmap has an alpha channel, \e or has a
mask, otherwise returns false.
+ \warning This is potentially an expensive operation.
+
\sa hasAlphaChannel(), mask()
*/
bool QPixmap::hasAlpha() const
diff --git a/src/gui/painting/qcups.cpp b/src/gui/painting/qcups.cpp
index 7903762..ac41692 100644
--- a/src/gui/painting/qcups.cpp
+++ b/src/gui/painting/qcups.cpp
@@ -342,7 +342,9 @@ bool QCUPSSupport::printerHasPPD(const char *printerName)
{
if (!isAvailable())
return false;
- return _cupsGetPPD(printerName) != 0;
+ const char *ppdFile = _cupsGetPPD(printerName);
+ unlink(ppdFile);
+ return (ppdFile != 0);
}
QString QCUPSSupport::unicodeString(const char *s)
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 3bcaf8c..075c457 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -708,13 +708,14 @@ void QPainterPrivate::updateEmulationSpecifier(QPainterState *s)
bool penTextureAlpha = false;
if (penBrush.style() == Qt::TexturePattern)
penTextureAlpha = qHasPixmapTexture(penBrush)
- ? penBrush.texture().hasAlpha()
+ ? (penBrush.texture().depth() > 1) && penBrush.texture().hasAlpha()
: penBrush.textureImage().hasAlphaChannel();
bool brushTextureAlpha = false;
- if (s->brush.style() == Qt::TexturePattern)
+ if (s->brush.style() == Qt::TexturePattern) {
brushTextureAlpha = qHasPixmapTexture(s->brush)
- ? s->brush.texture().hasAlpha()
+ ? (s->brush.texture().depth() > 1) && s->brush.texture().hasAlpha()
: s->brush.textureImage().hasAlphaChannel();
+ }
if (((penBrush.style() == Qt::TexturePattern && penTextureAlpha)
|| (s->brush.style() == Qt::TexturePattern && brushTextureAlpha))
&& !engine->hasFeature(QPaintEngine::MaskedBrush))