diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -2139,6 +2139,7 @@ { public: WindowVertex(); + WindowVertex(const QPointF &position, const QPointF &textureCoordinate); WindowVertex(double x, double y, double tx, double ty); double x() const { return px; } @@ -3163,6 +3164,13 @@ { } + +inline +WindowVertex::WindowVertex(const QPointF &position, const QPointF &texturePosition) + : px(position.x()), py(position.y()), ox(position.x()), oy(position.y()), tx(texturePosition.x()), ty(texturePosition.y()) +{ +} + inline void WindowVertex::move(double x, double y) { diff --git a/scene.h b/scene.h --- a/scene.h +++ b/scene.h @@ -289,7 +289,7 @@ void referencePreviousPixmap(); void unreferencePreviousPixmap(); protected: - WindowQuadList makeQuads(WindowQuadType type, const QRegion& reg, const QPoint &textureOffset = QPoint(0, 0)) const; + WindowQuadList makeQuads(WindowQuadType type, const QRegion& reg, const QPoint &textureOffset = QPoint(0, 0), qreal textureScale = 1.0) const; WindowQuadList makeDecorationQuads(const QRect *rects, const QRegion ®ion) const; /** * @brief Returns the WindowPixmap for this Window. diff --git a/scene.cpp b/scene.cpp --- a/scene.cpp +++ b/scene.cpp @@ -815,14 +815,20 @@ if (cached_quad_list != NULL && !force) return *cached_quad_list; WindowQuadList ret; + qreal scale = 1.0; + if (toplevel->surface()) { + scale = toplevel->surface()->scale(); + } + if (toplevel->clientPos() == QPoint(0, 0) && toplevel->clientSize() == toplevel->decorationRect().size()) - ret = makeQuads(WindowQuadContents, shape()); // has no decoration + ret = makeQuads(WindowQuadContents, shape(), QPoint(0,0), scale); // has no decoration else { AbstractClient *client = dynamic_cast(toplevel); QRegion contents = clientShape(); QRegion center = toplevel->transparentRect(); QRegion decoration = (client ? QRegion(client->decorationRect()) : shape()) - center; - ret = makeQuads(WindowQuadContents, contents, toplevel->clientContentPos()); + ret = makeQuads(WindowQuadContents, contents, toplevel->clientContentPos(), scale); + QRect rects[4]; bool isShadedClient = false; @@ -905,16 +911,21 @@ return list; } -WindowQuadList Scene::Window::makeQuads(WindowQuadType type, const QRegion& reg, const QPoint &textureOffset) const +WindowQuadList Scene::Window::makeQuads(WindowQuadType type, const QRegion& reg, const QPoint &textureOffset, qreal scale) const { WindowQuadList ret; foreach (const QRect & r, reg.rects()) { WindowQuad quad(type); // TODO asi mam spatne pravy dolni roh - bud tady, nebo v jinych castech - quad[ 0 ] = WindowVertex(r.x(), r.y(), r.x() + textureOffset.x(), r.y() + textureOffset.y()); - quad[ 1 ] = WindowVertex(r.x() + r.width(), r.y(), r.x() + r.width() + textureOffset.x(), r.y() + textureOffset.y()); - quad[ 2 ] = WindowVertex(r.x() + r.width(), r.y() + r.height(), r.x() + r.width() + textureOffset.x(), r.y() + r.height() + textureOffset.y()); - quad[ 3 ] = WindowVertex(r.x(), r.y() + r.height(), r.x() + textureOffset.x(), r.y() + r.height() + textureOffset.y()); + quad[ 0 ] = WindowVertex(QPointF(r.x(), r.y()), + QPointF(r.x() + textureOffset.x(), r.y() + textureOffset.y()) * scale); + quad[ 1 ] = WindowVertex(QPointF(r.x() + r.width(), r.y()), + QPointF(r.x() + r.width() + textureOffset.x(), r.y() + textureOffset.y()) * scale); + quad[ 2 ] = WindowVertex(QPointF(r.x() + r.width(), r.y() + r.height()), + QPointF(r.x() + r.width() + textureOffset.x(), r.y() + r.height() + textureOffset.y()) * scale); + quad[ 3 ] = WindowVertex(QPointF(r.x(), r.y() + r.height()), + QPointF(r.x() + textureOffset.x(), r.y() + r.height() + textureOffset.y()) * scale); + ret.append(quad); } return ret;