Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/scene_opengl.cpp
Show First 20 Lines • Show All 1427 Lines • ▼ Show 20 Line(s) | 1414 | foreach (const WindowQuad &quad, data.quads) { | |||
---|---|---|---|---|---|
1428 | default: | 1428 | default: | ||
1429 | continue; | 1429 | continue; | ||
1430 | } | 1430 | } | ||
1431 | } | 1431 | } | ||
1432 | 1432 | | |||
1433 | if (data.crossFadeProgress() != 1.0) { | 1433 | if (data.crossFadeProgress() != 1.0) { | ||
1434 | OpenGLWindowPixmap *previous = previousWindowPixmap<OpenGLWindowPixmap>(); | 1434 | OpenGLWindowPixmap *previous = previousWindowPixmap<OpenGLWindowPixmap>(); | ||
1435 | if (previous) { | 1435 | if (previous) { | ||
1436 | const QRect &oldGeometry = previous->contentsRect(); | | |||
1437 | for (const WindowQuad &quad : quads[ContentLeaf]) { | 1436 | for (const WindowQuad &quad : quads[ContentLeaf]) { | ||
1438 | // we need to create new window quads with normalize texture coordinates | 1437 | // we need to create new window quads with normalize texture coordinates | ||
1439 | // normal quads divide the x/y position by width/height. This would not work as the texture | 1438 | // normal quads divide the x/y position by width/height. This would not work as the texture | ||
1440 | // is larger than the visible content in case of a decorated Client resulting in garbage being shown. | 1439 | // is larger than the visible content in case of a decorated Client resulting in garbage being shown. | ||
1441 | // So we calculate the normalized texture coordinate in the Client's new content space and map it to | 1440 | // So we calculate the normalized texture coordinate in the Client's new content space and map it to | ||
1442 | // the previous Client's content space. | 1441 | // the previous Client's content space. | ||
1443 | WindowQuad newQuad(WindowQuadContents); | 1442 | WindowQuad newQuad(WindowQuadContents); | ||
1444 | for (int i = 0; i < 4; ++i) { | 1443 | for (int i = 0; i < 4; ++i) { | ||
1445 | const qreal xFactor = qreal(quad[i].textureX() - toplevel->clientPos().x())/qreal(toplevel->clientSize().width()); | 1444 | newQuad[i] = WindowVertex(quad[i].x(), quad[i].y(), quad[i].u(), quad[i].v()); | ||
1446 | const qreal yFactor = qreal(quad[i].textureY() - toplevel->clientPos().y())/qreal(toplevel->clientSize().height()); | | |||
1447 | WindowVertex vertex(quad[i].x(), quad[i].y(), | | |||
1448 | (xFactor * oldGeometry.width() + oldGeometry.x())/qreal(previous->size().width()), | | |||
1449 | (yFactor * oldGeometry.height() + oldGeometry.y())/qreal(previous->size().height())); | | |||
1450 | newQuad[i] = vertex; | | |||
1451 | } | 1445 | } | ||
1452 | quads[PreviousContentLeaf].append(newQuad); | 1446 | quads[PreviousContentLeaf].append(newQuad); | ||
1453 | } | 1447 | } | ||
1454 | } | 1448 | } | ||
1455 | } | 1449 | } | ||
1456 | 1450 | | |||
1457 | const bool indexedQuads = GLVertexBuffer::supportsIndexedQuads(); | 1451 | const bool indexedQuads = GLVertexBuffer::supportsIndexedQuads(); | ||
1458 | const GLenum primitiveType = indexedQuads ? GL_QUADS : GL_TRIANGLES; | 1452 | const GLenum primitiveType = indexedQuads ? GL_QUADS : GL_TRIANGLES; | ||
▲ Show 20 Lines • Show All 1173 Lines • Show Last 20 Lines |