summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpdf.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2015-01-12 14:57:08 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-02 22:05:31 +0000
commit9cd5c614559159fe09b414d568f88a192405b84d (patch)
tree6e577b7b00862e94a29f6b974d80ef73ca3c23fd /src/gui/painting/qpdf.cpp
parentcc7d84e09ed824af96aa5e59ba8f3a6522e7d7e6 (diff)
Avoid unneeded QBrush::texture() calls
If a QBrush has been created without QPixmap the texture() method will create one. This patch avoids that in several places by checking the type of the texture brush before accessing it, or not accessing it at all. Task-number: QTBUG-43766 Change-Id: If6009fe1d5bd51b239ae2c838e5c3b904b56b11a Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/painting/qpdf.cpp')
-rw-r--r--src/gui/painting/qpdf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 2efaec41ef..687d8efcec 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2264,9 +2264,9 @@ int QPdfEnginePrivate::addBrushPattern(const QTransform &m, bool *specifyColor,
if (pattern.isEmpty()) {
if (brush.style() != Qt::TexturePattern)
return 0;
- QImage image = brush.texture().toImage();
+ QImage image = brush.textureImage();
bool bitmap = true;
- imageObject = addImage(image, &bitmap, brush.texture().cacheKey());
+ imageObject = addImage(image, &bitmap, image.cacheKey());
if (imageObject != -1) {
QImage::Format f = image.format();
if (f != QImage::Format_MonoLSB && f != QImage::Format_Mono) {