SurfaceItem: Use pixmap()
for quad generation
This uses the previous pixmap if the current one is invalid,
which ensures the generated quads have sane coordinates.
The issue caused flickering while resizing Chrome after
2f4fa23e61
While at it, move `size` out of the loop as it doesn't change.
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
This commit is contained in:
parent
259f4d7838
commit
1e3a81249c
1 changed files with 1 additions and 2 deletions
|
@ -128,6 +128,7 @@ void SurfaceItem::preprocess()
|
|||
WindowQuadList SurfaceItem::buildQuads() const
|
||||
{
|
||||
const QRegion region = shape();
|
||||
const auto size = pixmap()->size();
|
||||
|
||||
WindowQuadList quads;
|
||||
quads.reserve(region.rectCount());
|
||||
|
@ -140,8 +141,6 @@ WindowQuadList SurfaceItem::buildQuads() const
|
|||
const QPointF bufferBottomRight = m_surfaceToBufferMatrix.map(rect.bottomRight());
|
||||
const QPointF bufferBottomLeft = m_surfaceToBufferMatrix.map(rect.bottomLeft());
|
||||
|
||||
const auto size = m_pixmap->size();
|
||||
|
||||
quad[0] = WindowVertex(rect.topLeft(), QPointF{bufferTopLeft.x() / size.width(), bufferTopLeft.y() / size.height()});
|
||||
quad[1] = WindowVertex(rect.topRight(), QPointF{bufferTopRight.x() / size.width(), bufferTopRight.y() / size.height()});
|
||||
quad[2] = WindowVertex(rect.bottomRight(), QPointF{bufferBottomRight.x() / size.width(), bufferBottomRight.y() / size.height()});
|
||||
|
|
Loading…
Reference in a new issue