Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-algorithms.cpp
index d262224..0061b87 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -194,9 +194,6 @@ inline void SetupDepthBuffer( const RenderItem& item, Context& context, bool dep
     // The depth buffer must be enabled if either reading or writing.
     context.EnableDepthBuffer( true );
 
-    // Set up the depth mask based on our depth write setting.
-    context.DepthMask( enableDepthWrite );
-
     // Look-up the GL depth function from the Dali::DepthFunction enum, and set it.
     context.DepthFunc( DaliDepthToGLDepthTable[ item.mRenderer->GetDepthFunction() ] );
 
@@ -210,8 +207,12 @@ inline void SetupDepthBuffer( const RenderItem& item, Context& context, bool dep
       firstDepthBufferUse = false;
 
       // Note: The buffer will only be cleared if written to since a previous clear.
+      context.DepthMask( true );
       context.Clear( GL_DEPTH_BUFFER_BIT, Context::CHECK_CACHED_VALUES );
     }
+
+    // Set up the depth mask based on our depth write setting.
+    context.DepthMask( enableDepthWrite );
   }
   else
   {
@@ -255,7 +256,7 @@ inline void RenderAlgorithms::SetupScissorClipping( const RenderItem& item, Cont
     // We traversed up the tree, we need to apply a new scissor rectangle (unless we are at the root).
     traversedUpTree = true;
   }
-  else if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area
+  if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area
   {
     mScissorStack.pop_back();
     --childStackDepth;
@@ -388,7 +389,8 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList,
                                                  const Matrix& viewMatrix,
                                                  const Matrix& projectionMatrix,
                                                  Integration::DepthBufferAvailable depthBufferAvailable,
-                                                 Integration::StencilBufferAvailable stencilBufferAvailable )
+                                                 Integration::StencilBufferAvailable stencilBufferAvailable,
+                                                 Vector<GLuint>& boundTextures )
 {
   DALI_PRINT_RENDER_LIST( renderList );
 
@@ -423,7 +425,7 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList,
   }
 
   // Loop through all RenderList in the RenderList, set up any prerequisites to render them, then perform the render.
-  for( size_t index( 0u ); index < count; ++index )
+  for( uint32_t index = 0u; index < count; ++index )
   {
     const RenderItem& item = renderList.GetItem( index );
     DALI_PRINT_RENDER_ITEM( item );
@@ -446,7 +448,7 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList,
 
       // Render the item.
       item.mRenderer->Render( context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix,
-                              viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque );
+                              viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures );
     }
   }
 }
@@ -461,7 +463,8 @@ void RenderAlgorithms::ProcessRenderInstruction( const RenderInstruction& instru
                                                  Context& context,
                                                  BufferIndex bufferIndex,
                                                  Integration::DepthBufferAvailable depthBufferAvailable,
-                                                 Integration::StencilBufferAvailable stencilBufferAvailable )
+                                                 Integration::StencilBufferAvailable stencilBufferAvailable,
+                                                 Vector<GLuint>& boundTextures )
 {
   DALI_PRINT_RENDER_INSTRUCTION( instruction, bufferIndex );
 
@@ -489,7 +492,8 @@ void RenderAlgorithms::ProcessRenderInstruction( const RenderInstruction& instru
                            *viewMatrix,
                            *projectionMatrix,
                             depthBufferAvailable,
-                            stencilBufferAvailable );
+                            stencilBufferAvailable,
+                            boundTextures );
       }
     }
   }