diff options
author | Julien Brianceau <jbrianceau@nds.com> | 2012-10-08 09:37:09 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-12 00:19:36 (GMT) |
commit | 77faf459db85a3a6c1157406f0c8b421ec52cb6b (patch) | |
tree | 92d834cc1336377e377fc2fa8bacd44e24f9040d /src/gui | |
parent | 620d523508845ccad6e4baf0d17712169a141853 (diff) | |
download | Qt-77faf459db85a3a6c1157406f0c8b421ec52cb6b.zip Qt-77faf459db85a3a6c1157406f0c8b421ec52cb6b.tar.gz Qt-77faf459db85a3a6c1157406f0c8b421ec52cb6b.tar.bz2 |
qpa: Fix rendering issue in blitter paint engine
Take into account brush transformation for TexturePattern fill.
Example : arrows are not rendered properly in
http://www.youtube.com/leanback website.
cherry-picked from qt5/qtbase 2f2656002735a14687c5d6b5a3250666a8e102e3
Change-Id: I11fead281e372b2a24da835f85c327879e9997f0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpaintengine_blitter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp index fab6d11..cbf42bb 100644 --- a/src/gui/painting/qpaintengine_blitter.cpp +++ b/src/gui/painting/qpaintengine_blitter.cpp @@ -554,7 +554,8 @@ void QBlitterPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) && qbrush_color(brush).alpha() == 0xff && d->caps.canBlitterFillRect()) { d->fillRect(rect, qbrush_color(brush), false); - } else if (brush.style() == Qt::TexturePattern && + } else if ((brush.style() == Qt::TexturePattern) && + (brush.transform().type() <= QTransform::TxTranslate) && ((d->caps.canBlitterDrawPixmapOpacity(brush.texture())) || (d->caps.canBlitterDrawPixmap(rect, brush.texture(), rect)))) { bool rectIsFilled = false; @@ -563,11 +564,11 @@ void QBlitterPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) qreal y = transformedRect.y(); QPixmap pm = brush.texture(); d->unlock(); - int srcX = int(rect.x() - state()->brushOrigin.x()) % pm.width(); + int srcX = int(rect.x() - state()->brushOrigin.x() - brush.transform().dx()) % pm.width(); if (srcX < 0) srcX = pm.width() + srcX; const int startX = srcX; - int srcY = int(rect.y() - state()->brushOrigin.y()) % pm.height(); + int srcY = int(rect.y() - state()->brushOrigin.y() - brush.transform().dy()) % pm.height(); if (srcY < 0) srcY = pm.height() + srcY; while (!rectIsFilled) { |