[Development] More flexible window orientation API
Samuel Rødal
samuel.rodal at nokia.com
Tue Jan 17 12:58:29 CET 2012
Hi,
we're working toward having a flexible yet simple API for window
orientations. It's important that the QWindow orientation API is
flexible enough to handle all use cases, whereas the APIs on top (in Qt
components for instance) can offer some more convenience for application
developers.
We've found that the current QWindow::setOrientation() API isn't
sufficient to express all the different ways of doing orientation.
Namely, it currently only allows you to tell the windowing system /
compositor about how the contents of the window are rendered, and not
how the window buffer itself should be interpreted. It's not always
desirable to explicitly rotate the contents of the window, sometimes
it's practical to be able to use a different buffer layout instead. As
an example, a game being ported to a portrait device might still want to
use a landscape buffer layout, if the game engine design makes it hard
to rotate the rendered output to fit a portrait buffer layout. For a
raster based game there are performance costs due to having to do a
90-degree rotation.
So we should support both approaches, having a way to hint to the
compositor both the window orientation and the content orientation.
My current patch, which replaces QWindow::setOrientation() with
QWindow::setContentOrientationHint() and
QWindow::setWindowOrientationHint() is already on Gerrit:
http://codereview.qt-project.org/#change,13397
Feedback is appreciated.
--
Samuel
More information about the Development
mailing list