diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-02-11 12:26:22 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2010-02-11 12:29:33 (GMT) |
commit | 52a65fde8e97f1f6dc26192058fadc1d2275983a (patch) | |
tree | 7cc1b139187156a01f20c2e296b1a9b1aae9fb03 /src | |
parent | b9907e309885b4b8ce280c721231a56a583b51d0 (diff) | |
download | Qt-52a65fde8e97f1f6dc26192058fadc1d2275983a.zip Qt-52a65fde8e97f1f6dc26192058fadc1d2275983a.tar.gz Qt-52a65fde8e97f1f6dc26192058fadc1d2275983a.tar.bz2 |
Speed up custom bitmap brushes on X11 without Xrender support.
There's no need to fall back and go via draw_helper() if we're using
a bitmap brush that's drawn using a solid color.
Task-number: QTBUG-8140
Reviewed-by: Kim
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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)) |