Set stereo view mode to Ecore_X_Atom
authorJavon Prince <javon.prince@samsung.com>
Fri, 11 Apr 2014 12:58:00 +0000 (13:58 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Fri, 9 May 2014 15:33:07 +0000 (16:33 +0100)
Write view mode to Ecore_X_Atom "_E_COMP_3D_APP_WIN" if it exists.

Change-Id: Id30bff408da3d73646f6ac27e9a4871106105936
Signed-off-by: Javon Prince <javon.prince@samsung.com>
adaptors/tizen/internal/common/adaptor-impl.cpp
adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.cpp
adaptors/tizen/internal/common/ecore-x/ecore-x-render-surface.h
adaptors/tizen/internal/common/ecore-x/window-render-surface.cpp
adaptors/tizen/internal/common/ecore-x/window-render-surface.h
adaptors/tizen/internal/common/render-surface-impl.h

index 1bbdb40..ec781ec 100644 (file)
@@ -761,6 +761,7 @@ Adaptor::Adaptor(Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLay
 
 void Adaptor::SetViewMode( ViewMode viewMode )
 {
+  mSurface->SetViewMode( viewMode );
   mCore->SetViewMode( viewMode );
 }
 
index cbc587e..24c21cc 100644 (file)
@@ -250,6 +250,10 @@ void RenderSurface::StopRender()
   mIsStopped = true;
 }
 
+void RenderSurface::SetViewMode( ViewMode )
+{
+}
+
 void RenderSurface::SetDisplay( Any display )
 {
   // the render surface can be passed either EFL e-core types, or x11 types
index 9abe556..244f4b5 100644 (file)
@@ -182,6 +182,11 @@ public:  // from Internal::Adaptor::RenderSurface
   virtual void RenderSync();
 
   /**
+   * @copydoc Dali::Internal::Adaptor::RenderSurface::SetViewMode()
+   */
+  void SetViewMode( ViewMode );
+
+  /**
    * @copydoc Dali::Internal::Adaptor::RenderSurface::PreRender()
    */
   virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
index 6b28931..d0c8765 100644 (file)
@@ -217,6 +217,17 @@ void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstract
   }
 }
 
+void WindowRenderSurface::SetViewMode( ViewMode viewMode )
+{
+  Ecore_X_Atom viewModeAtom( ecore_x_atom_get( "_E_COMP_3D_APP_WIN" ) );
+
+  if( viewModeAtom != None )
+  {
+    unsigned int value( static_cast<unsigned int>( viewMode ) );
+    ecore_x_window_prop_card32_set( mX11Window, viewModeAtom, &value, 1 );
+  }
+}
+
 void WindowRenderSurface::CreateXRenderable()
 {
    // if width or height are zero, go full screen.
index b544987..26df482 100644 (file)
@@ -131,6 +131,11 @@ public:  // from Internal::Adaptor::RenderSurface
    */
   virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, unsigned int timeDelta, SyncMode syncMode );
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::RenderSurface::SetViewMode()
+   */
+  void SetViewMode( ViewMode viewMode );
+
 protected:
 
   /**
index 0edc227..bef71c0 100644 (file)
@@ -20,6 +20,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/common/render-surface.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/view-mode.h>
 
 namespace Dali
 {
@@ -121,6 +122,12 @@ public: // API
   virtual void ConsumeEvents() = 0;
 
   /**
+   * Set the stereoscopic 3D view mode
+   * @param[in] viewMode The new view mode
+   */
+  virtual void SetViewMode( ViewMode viewMode ) = 0;
+
+  /**
    * Called after offscreen is posted to onscreen
    */
   virtual void RenderSync() = 0;