Skip to content

Commit

Permalink
Correct the orientation of QuickWebView textures.
Browse files Browse the repository at this point in the history
The texture data appeared inverted in one direction for all
orientations. Probably as a result of GL's bottom to top coordinate
system.
  • Loading branch information
adenexter committed Mar 16, 2020
1 parent 6e13457 commit 0801eb3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/qmozextmaterialnode.cpp
Expand Up @@ -88,21 +88,21 @@ void MozExtMaterialNode::updateGeometry(const QRectF &rect, Qt::ScreenOrientatio
// and then texture coordinates
switch (orientation) {
case Qt::LandscapeOrientation:
updateRectGeometry(geometry(), rect, textureRect.topRight(), textureRect.topLeft(),
textureRect.bottomRight(), textureRect.bottomLeft());
updateRectGeometry(geometry(), rect, textureRect.bottomRight(), textureRect.bottomLeft(),
textureRect.topRight(), textureRect.topLeft());
break;
case Qt::InvertedPortraitOrientation:
updateRectGeometry(geometry(), rect, textureRect.bottomRight(), textureRect.topRight(),
textureRect.bottomLeft(), textureRect.topLeft());
updateRectGeometry(geometry(), rect, textureRect.topRight(), textureRect.bottomRight(),
textureRect.topLeft(), textureRect.bottomLeft());
break;
case Qt::InvertedLandscapeOrientation:
updateRectGeometry(geometry(), rect, textureRect.bottomLeft(), textureRect.bottomRight(),
textureRect.topLeft(), textureRect.topRight());
updateRectGeometry(geometry(), rect, textureRect.topLeft(), textureRect.topRight(),
textureRect.bottomLeft(), textureRect.bottomRight());
break;
default:
// Portrait / PrimaryOrientation
updateRectGeometry(geometry(), rect, textureRect.topLeft(), textureRect.bottomLeft(),
textureRect.topRight(), textureRect.bottomRight());
updateRectGeometry(geometry(), rect, textureRect.bottomLeft(), textureRect.topLeft(),
textureRect.bottomRight(), textureRect.topRight());
break;
}
markDirty(QSGNode::DirtyGeometry);
Expand Down

0 comments on commit 0801eb3

Please sign in to comment.