summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2009-11-05 07:26:06 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2009-11-05 07:26:06 (GMT)
commit7f7d4cdf01409283d32a6799c1f73663b8ec3ea1 (patch)
tree057102ed546240efc7e5e8054e150fecf0e14001 /src/plugins
parentaa58293b57a05cd52b36ba14a05958dceb65c603 (diff)
parent91c09562ed9c6eb1bd3a4dbd84a8cc64647751ee (diff)
downloadQt-7f7d4cdf01409283d32a6799c1f73663b8ec3ea1.zip
Qt-7f7d4cdf01409283d32a6799c1f73663b8ec3ea1.tar.gz
Qt-7f7d4cdf01409283d32a6799c1f73663b8ec3ea1.tar.bz2
Merge branch '4.5' into 4.6
Conflicts: tests/auto/qsqlquery/tst_qsqlquery.cpp tests/auto/qtextlayout/tst_qtextlayout.cpp
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
index 1dec9ea..c1410a6 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
@@ -271,6 +271,67 @@ int PvrEglScreen::transformation() const
#endif
+#ifndef QT_NO_QWS_TRANSFORMED
+
+static const QScreen *parentScreen
+ (const QScreen *current, const QScreen *lookingFor)
+{
+ if (!current)
+ return 0;
+ switch (current->classId()) {
+ case QScreen::ProxyClass:
+ case QScreen::TransformedClass: {
+ const QScreen *child =
+ static_cast<const QProxyScreen *>(current)->screen();
+ if (child == lookingFor)
+ return current;
+ else
+ return parentScreen(child, lookingFor);
+ }
+ // Not reached.
+
+ case QScreen::MultiClass: {
+ QList<QScreen *> screens = current->subScreens();
+ foreach (QScreen *screen, screens) {
+ if (screen == lookingFor)
+ return current;
+ const QScreen *parent = parentScreen(screen, lookingFor);
+ if (parent)
+ return parent;
+ }
+ }
+ break;
+
+ default: break;
+ }
+ return 0;
+}
+
+int PvrEglScreen::transformation() const
+{
+ // We need to search for our parent screen, which is assumed to be
+ // "Transformed". If it isn't, then there is no transformation.
+ // There is no direct method to get the parent screen so we need
+ // to search every screen until we find ourselves.
+ if (!parent && qt_screen != this)
+ parent = parentScreen(qt_screen, this);
+ if (!parent)
+ return 0;
+ if (parent->classId() != QScreen::TransformedClass)
+ return 0;
+ return 90 * static_cast<const QTransformedScreen *>(parent)
+ ->transformation();
+}
+
+#else
+
+int PvrEglScreen::transformation() const
+{
+ return 0;
+}
+
+#endif
+
void PvrEglScreen::sync()
{
// Put code here to synchronize 2D and 3D operations if necessary.