+void WindowRenderSurface::RequestRotation( Dali::Window::WindowOrientation orientation, int width, int height )
+{
+ if( !mRotationSupported )
+ {
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" );
+ return;
+ }
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: orientation = %d\n", orientation );
+
+ if( !mRotationTrigger )
+ {
+ TriggerEventFactoryInterface& triggerFactory = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTriggerEventFactoryInterface();
+ mRotationTrigger = triggerFactory.CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
+ }
+
+ mPosition.width = width;
+ mPosition.height = height;
+
+ mRotated = true;
+
+ int angle;
+ wl_egl_window_rotation rotation;
+
+ switch( orientation )
+ {
+ case Dali::Window::PORTRAIT:
+ {
+ angle = 0;
+ rotation = ROTATION_0;
+ break;
+ }
+ case Dali::Window::LANDSCAPE:
+ {
+ angle = 90;
+ rotation = ROTATION_270;
+ break;
+ }
+ case Dali::Window::PORTRAIT_INVERSE:
+ {
+ angle = 180;
+ rotation = ROTATION_180;
+ break;
+ }
+ case Dali::Window::LANDSCAPE_INVERSE:
+ {
+ angle = 270;
+ rotation = ROTATION_90;
+ break;
+ }
+ default:
+ {
+ angle = 0;
+ rotation = ROTATION_0;
+ break;
+ }
+ }
+
+ ecore_wl_window_rotation_set( mWlWindow, angle );
+
+ wl_egl_window_set_rotation( mEglWindow, rotation );
+}
+