Revert "[Tizen] Partial rendering rotation does not work"
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-manager.cpp
index f132736..027deb7 100644 (file)
@@ -69,7 +69,6 @@ struct RenderManager::Impl
     renderAlgorithms(),
     frameCount(0u),
     renderBufferIndex(SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX),
-    defaultSurfaceRect(),
     rendererContainer(),
     samplerContainer(),
     textureContainer(),
@@ -78,8 +77,7 @@ struct RenderManager::Impl
     programController(graphicsController),
     depthBufferAvailable(depthBufferAvailableParam),
     stencilBufferAvailable(stencilBufferAvailableParam),
-    partialUpdateAvailable(partialUpdateAvailableParam),
-    defaultSurfaceOrientation(0)
+    partialUpdateAvailable(partialUpdateAvailableParam)
   {
     // 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());
@@ -152,8 +150,6 @@ struct RenderManager::Impl
   uint32_t    frameCount;        ///< The current frame count
   BufferIndex renderBufferIndex; ///< The index of the buffer to read from; this is opposite of the "update" buffer
 
-  Rect<int32_t> defaultSurfaceRect; ///< Rectangle for the default surface we are rendering to
-
   OwnerContainer<Render::Renderer*>     rendererContainer;     ///< List of owned renderers
   OwnerContainer<Render::Sampler*>      samplerContainer;      ///< List of owned samplers
   OwnerContainer<Render::Texture*>      textureContainer;      ///< List of owned textures
@@ -174,8 +170,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(Graphics::Controller&               graphicsController,
@@ -250,16 +244,6 @@ void RenderManager::SetShaderSaver(ShaderSaver& upstream)
   mImpl->programController.SetShaderSaver(upstream);
 }
 
-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
@@ -601,7 +585,7 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector<Rect<int>>&
     bool                    mCleanOnReturn;
   };
 
-  Rect<int32_t> surfaceRect = Rect<int32_t>(0, 0, static_cast<int32_t>(scene.GetSize().width), static_cast<int32_t>(scene.GetSize().height));
+  Rect<int32_t> surfaceRect = sceneObject->GetSurfaceRect();
 
   // Clean collected dirty/damaged rects on exit if 3d layer or 3d node or other conditions.
   DamagedRectsCleaner damagedRectCleaner(damagedRects);
@@ -822,10 +806,11 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::
       clearColor = Dali::RenderTask::DEFAULT_CLEAR_COLOR;
     }
 
-    Rect<int32_t>                       surfaceRect            = mImpl->defaultSurfaceRect;
+    Rect<int32_t> surfaceRect = sceneObject->GetSurfaceRect();
+    int32_t surfaceOrientation = sceneObject->GetSurfaceOrientation();
+
     Integration::DepthBufferAvailable   depthBufferAvailable   = mImpl->depthBufferAvailable;
     Integration::StencilBufferAvailable stencilBufferAvailable = mImpl->stencilBufferAvailable;
-    int                                 surfaceOrientation     = sceneInternal.GetSurfaceOrientation();
 
     if(instruction.mFrameBuffer)
     {
@@ -857,8 +842,6 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::
           mImpl->programController.ClearCurrentProgram();
         }
       }
-
-      surfaceRect = Rect<int32_t>(0, 0, static_cast<int32_t>(scene.GetSize().width), static_cast<int32_t>(scene.GetSize().height));
     }
 
     // Make sure that GL context must be created