Add --deqp-screen-rotation=unspecified cmdline flag.
authorPyry Haulos <phaulos@google.com>
Mon, 20 Oct 2014 20:39:08 +0000 (13:39 -0700)
committerPyry Haulos <phaulos@google.com>
Mon, 20 Oct 2014 21:03:56 +0000 (14:03 -0700)
On Android dEQP always sets screen orientation to some known value,
which prevents failures / test run aborts due to screen configuration
changes. This is almost always desired but in some situations user may
want to avoid that. This change adds 'unspecified' value, which means
that the application doesn't request any specific orientation and
the system can freely choose it and even change it during test
execution.

Default value for --deqp-screen-rotation remains '0'.

Change-Id: I3e95213cc12a995ec43912c86a0ab9a01c456920

framework/common/tcuCommandLine.cpp
framework/common/tcuCommandLine.hpp
framework/platform/android/tcuAndroidUtil.cpp
framework/platform/android/tcuAndroidUtil.hpp

index 72d4402..c598e79 100644 (file)
@@ -125,6 +125,7 @@ void registerOptions (de::cmdline::Parser& parser)
        };
        static const NamedValue<tcu::ScreenRotation> s_screenRotations[] =
        {
+               { "unspecified",        SCREENROTATION_UNSPECIFIED      },
                { "0",                          SCREENROTATION_0                        },
                { "90",                         SCREENROTATION_90                       },
                { "180",                        SCREENROTATION_180                      },
index 401f7e6..961b563 100644 (file)
@@ -76,7 +76,8 @@ enum SurfaceType
  *//*--------------------------------------------------------------------*/
 enum ScreenRotation
 {
-       SCREENROTATION_0,
+       SCREENROTATION_UNSPECIFIED,             //!< Use default / current orientation.
+       SCREENROTATION_0,                               //!< Set rotation to 0 degrees from baseline.
        SCREENROTATION_90,
        SCREENROTATION_180,
        SCREENROTATION_270,
index 73c921c..7f29c6a 100644 (file)
@@ -81,10 +81,11 @@ ScreenOrientation mapScreenRotation (ScreenRotation rotation)
 {
        switch (rotation)
        {
-               case SCREENROTATION_0:          return SCREEN_ORIENTATION_PORTRAIT;
-               case SCREENROTATION_90:         return SCREEN_ORIENTATION_LANDSCAPE;
-               case SCREENROTATION_180:        return SCREEN_ORIENTATION_REVERSE_PORTRAIT;
-               case SCREENROTATION_270:        return SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
+               case SCREENROTATION_UNSPECIFIED:        return SCREEN_ORIENTATION_UNSPECIFIED;
+               case SCREENROTATION_0:                          return SCREEN_ORIENTATION_PORTRAIT;
+               case SCREENROTATION_90:                         return SCREEN_ORIENTATION_LANDSCAPE;
+               case SCREENROTATION_180:                        return SCREEN_ORIENTATION_REVERSE_PORTRAIT;
+               case SCREENROTATION_270:                        return SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
                default:
                        print("Warning: Unsupported rotation");
                        return SCREEN_ORIENTATION_PORTRAIT;
index 8b1dcfb..a625433 100644 (file)
@@ -37,6 +37,7 @@ namespace Android
 
 enum ScreenOrientation
 {
+       SCREEN_ORIENTATION_UNSPECIFIED                  = 0xffffffff,
        SCREEN_ORIENTATION_LANDSCAPE                    = 0x00000000,
        SCREEN_ORIENTATION_PORTRAIT                             = 0x00000001,
        SCREEN_ORIENTATION_REVERSE_LANDSCAPE    = 0x00000008,