Revert "[Tizen] Support Client Rotation and Screen Rotation"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-render-surface.cpp
index 04828cc..f9eb552 100644 (file)
@@ -83,6 +83,11 @@ WindowRenderSurface::~WindowRenderSurface()
   {
     delete mRotationTrigger;
   }
+
+  if ( mEGLSurface )
+  {
+    DestroySurface();
+  }
 }
 
 void WindowRenderSurface::Initialize( Any surface )
@@ -411,6 +416,12 @@ void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, b
     {
       mRenderNotification->Trigger();
     }
+
+    if ( eglImpl.IsSurfacelessContextSupported() )
+    {
+      // Switch to the shared context after rendering this surface
+      eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
+    }
   }
 }