summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-12 02:38:41 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-12 02:38:41 (GMT)
commitc23a5c09d6b8896f4b61164a2dc61ce6ac3f5edb (patch)
treea6806b2eb0f443eba9ce4f96cc9f508e5530b62d /src
parent01245bcabf97dfdfdd23a2ec075b8de3e78bdeb2 (diff)
parent2f389a95f5b9e4c7130aa333586d803b639bf259 (diff)
downloadQt-c23a5c09d6b8896f4b61164a2dc61ce6ac3f5edb.zip
Qt-c23a5c09d6b8896f4b61164a2dc61ce6ac3f5edb.tar.gz
Qt-c23a5c09d6b8896f4b61164a2dc61ce6ac3f5edb.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: Add functional Graphics View benchmarks. Make QCUPSSupport::printerHasPPD() clean up after itself. document the slowness of QPixmap::hasAlpha() Speed up custom bitmap brushes on X11 without Xrender support.
Diffstat (limited to 'src')
-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))