diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-01-27 18:12:44 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-02-01 08:49:26 +0000 |
commit | 920472c85f6a5cd96344c28dbba0f199c34c6c10 (patch) | |
tree | 681cfae36f9df7406459f3509a384eb0b5a290ab /src/gui/painting | |
parent | 758b7b0d88742db7db223a69d689e235e6272f85 (diff) |
Fix clipRect interpretation in composited backingstores
Empty clipRect means "clip away completely", not "no clipping".
Task-number: QTBUG-50719
Change-Id: I6a9dd66130716a921fe9fc245582274e3c9718fe
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qplatformbackingstore.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 8e40eb6dff..5ac903c71d 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -263,12 +263,14 @@ static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight) static void blitTextureForWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect, QOpenGLTextureBlitter *blitter, const QPoint &offset) { + const QRect clipRect = textures->clipRect(idx); + if (clipRect.isEmpty()) + return; + QRect rectInWindow = textures->geometry(idx); // relative to the TLW, not necessarily our window (if the flush is for a native child widget), have to adjust rectInWindow.translate(-offset); - QRect clipRect = textures->clipRect(idx); - if (clipRect.isEmpty()) - clipRect = QRect(QPoint(0, 0), rectInWindow.size()); + const QRect clippedRectInWindow = rectInWindow & clipRect.translated(rectInWindow.topLeft()); const QRect srcRect = toBottomLeftRect(clipRect, rectInWindow.height()); |