diff --git a/src/surfaceitem.cpp b/src/surfaceitem.cpp index 60bbf4d905..faab5cd3af 100644 --- a/src/surfaceitem.cpp +++ b/src/surfaceitem.cpp @@ -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()});