diff options
author | axis <qt-info@nokia.com> | 2009-11-05 10:32:55 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-05 10:32:55 (GMT) |
commit | dd6a230f812b957137a2711c772284ee77ffccf4 (patch) | |
tree | a1f46718a295964ddaa9ab04c8222f6db3b19057 /src/plugins | |
parent | f1a56f4db2f6d6c395ac6e7023b6e9184140d571 (diff) | |
parent | eb75d1d6acf121fc08a591b4d6b34f1f39283bc2 (diff) | |
download | Qt-dd6a230f812b957137a2711c772284ee77ffccf4.zip Qt-dd6a230f812b957137a2711c772284ee77ffccf4.tar.gz Qt-dd6a230f812b957137a2711c772284ee77ffccf4.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp | 61 |
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. |