Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-manager.cpp
index a1b3d45..5a0d3c1 100644 (file)
@@ -89,8 +89,7 @@ struct RenderManager::Impl
     lastFrameWasRendered( false ),
     programController( glAbstraction ),
     depthBufferAvailable( depthBufferAvailableParam ),
-    stencilBufferAvailable( stencilBufferAvailableParam ),
-    defaultSurfaceOrientation( 0 )
+    stencilBufferAvailable( stencilBufferAvailableParam )
   {
      // Create thread pool with just one thread ( there may be a need to create more threads in the future ).
     threadPool = std::unique_ptr<Dali::ThreadPool>( new Dali::ThreadPool() );
@@ -181,8 +180,6 @@ struct RenderManager::Impl
   std::unique_ptr<Dali::ThreadPool>         threadPool;               ///< The thread pool
   Vector<GLuint>                            boundTextures;            ///< The textures bound for rendering
   Vector<GLuint>                            textureDependencyList;    ///< The dependency list of binded textures
-  int                                       defaultSurfaceOrientation; ///< defaultSurfaceOrientation for the default surface we are rendering to
-
 };
 
 RenderManager* RenderManager::New( Integration::GlAbstraction& glAbstraction,
@@ -264,11 +261,6 @@ void RenderManager::SetDefaultSurfaceRect(const Rect<int32_t>& rect)
   mImpl->defaultSurfaceRect = rect;
 }
 
-void RenderManager::SetDefaultSurfaceOrientation( int orientation )
-{
-  mImpl->defaultSurfaceOrientation = orientation;
-}
-
 void RenderManager::AddRenderer( OwnerPointer< Render::Renderer >& renderer )
 {
   // Initialize the renderer as we are now in render thread
@@ -388,6 +380,16 @@ void RenderManager::AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameB
   frameBuffer->AttachColorTexture( mImpl->context, texture, mipmapLevel, layer );
 }
 
+void RenderManager::AttachDepthTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel )
+{
+  frameBuffer->AttachDepthTexture( mImpl->context, texture, mipmapLevel );
+}
+
+void RenderManager::AttachDepthStencilTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel )
+{
+  frameBuffer->AttachDepthStencilTexture( mImpl->context, texture, mipmapLevel );
+}
+
 void RenderManager::AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
 {
   mImpl->propertyBufferContainer.PushBack( propertyBuffer.Release() );
@@ -599,7 +601,6 @@ void RenderManager::RenderScene( Integration::Scene& scene, bool renderToFbo )
     Rect<int32_t> surfaceRect = mImpl->defaultSurfaceRect;
     Integration::DepthBufferAvailable depthBufferAvailable = mImpl->depthBufferAvailable;
     Integration::StencilBufferAvailable stencilBufferAvailable = mImpl->stencilBufferAvailable;
-    int surfaceOrientation = mImpl->defaultSurfaceOrientation;
 
     if ( instruction.mFrameBuffer )
     {
@@ -698,7 +699,6 @@ void RenderManager::RenderScene( Integration::Scene& scene, bool renderToFbo )
       {
         viewportRect.Set( 0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight() );
       }
-      surfaceOrientation = 0;
     }
     else // No Offscreen frame buffer rendering
     {
@@ -715,13 +715,6 @@ void RenderManager::RenderScene( Integration::Scene& scene, bool renderToFbo )
       }
     }
 
-    if( surfaceOrientation == 90 || surfaceOrientation == 270 )
-    {
-      int temp = viewportRect.width;
-      viewportRect.width = viewportRect.height;
-      viewportRect.height = temp;
-    }
-
     bool clearFullFrameRect = true;
     if( instruction.mFrameBuffer != 0 )
     {
@@ -765,8 +758,7 @@ void RenderManager::RenderScene( Integration::Scene& scene, bool renderToFbo )
         mImpl->renderBufferIndex,
         depthBufferAvailable,
         stencilBufferAvailable,
-        mImpl->boundTextures,
-        surfaceOrientation );
+        mImpl->boundTextures );
 
     // Synchronise the FBO/Texture access when there are multiple contexts
     if ( mImpl->currentContext->IsSurfacelessContextSupported() )