Revert "[Tizen] Remove context from RenderInstruction"
authorWonsik Jung <sidein@samsung.com>
Mon, 10 Aug 2020 05:27:57 +0000 (14:27 +0900)
committerWonsik Jung <sidein@samsung.com>
Mon, 10 Aug 2020 05:27:57 +0000 (14:27 +0900)
This reverts commit 6db15aa99948f070ca33b0a45b7b75be4b314d35.

dali/internal/render/common/render-instruction.cpp
dali/internal/render/common/render-instruction.h
dali/internal/update/manager/render-instruction-processor.cpp
dali/internal/update/manager/render-instruction-processor.h
dali/internal/update/manager/render-task-processor.cpp
dali/internal/update/manager/render-task-processor.h
dali/internal/update/manager/update-manager.cpp

index a001251..164a9af 100644 (file)
@@ -39,6 +39,7 @@ RenderInstruction::RenderInstruction()
   mIsClearColorSet( false ),
   mIgnoreRenderToFbo( false ),
   mFrameBuffer( 0 ),
+  mContext( 0 ),
   mCamera( 0 ),
   mNextFreeRenderList( 0 )
 {
index 91a48f4..f40ec04 100644 (file)
@@ -149,6 +149,8 @@ public: // Data
 
   Render::FrameBuffer* mFrameBuffer;
 
+  Context* mContext;                    ///< The context holding the GL state of rendering
+
 private: // Data
 
   Camera* mCamera;  ///< camera that is used
index 3e71956..b973fa9 100644 (file)
@@ -438,6 +438,7 @@ inline void RenderInstructionProcessor::SortRenderItems( BufferIndex bufferIndex
 
 void RenderInstructionProcessor::Prepare( BufferIndex updateBufferIndex,
                                           SortedLayerPointers& sortedLayers,
+                                          Context& context,
                                           RenderTask& renderTask,
                                           bool cull,
                                           bool hasClippingNodes,
@@ -517,6 +518,7 @@ void RenderInstructionProcessor::Prepare( BufferIndex updateBufferIndex,
 
   if( isRenderListAdded || instruction.mIsClearColorSet || isRootLayerDirty )
   {
+    instruction.mContext = &context;
     instructions.PushBack( updateBufferIndex, &instruction );
   }
 }
index a35bcf0..9cc7b54 100644 (file)
@@ -29,6 +29,8 @@ namespace Dali
 namespace Internal
 {
 
+class Context;
+
 namespace Render
 {
 class Geometry;
@@ -97,6 +99,7 @@ public:
    *
    * @param[in]  updateBufferIndex The current update buffer index.
    * @param[in]  sortedLayers      The layers containing lists of opaque/transparent renderables.
+   * @param[in]  context           The context holding the GL state of rendering for the rendering instructions.
    * @param[in]  renderTask        The rendering task information.
    * @param[in]  cull              Whether frustum culling is enabled or not
    * @param[in]  hasClippingNodes  Whether any clipping nodes exist within this layer, to optimize sorting if not
@@ -104,6 +107,7 @@ public:
    */
   void Prepare( BufferIndex updateBufferIndex,
                 SortedLayerPointers& sortedLayers,
+                Context& context,
                 RenderTask& renderTask,
                 bool cull,
                 bool hasClippingNodes,
index 5923331..0fdc554 100644 (file)
@@ -207,6 +207,7 @@ bool AddRenderablesForTask( BufferIndex updateBufferIndex,
  * @param[in]  taskContainer              The container of render-tasks.
  * @param[in]  rootNode                   The root node of the scene-graph.
  * @param[in]  sortedLayers               The layers containing lists of opaque / transparent renderables.
+ * @param[in]  context                    The context holding the GL state of rendering for the rendering instructions.
  * @param[out] instructions               The instructions for rendering the next frame.
  * @param[in]  renderInstructionProcessor An instance of the RenderInstructionProcessor used to sort and handle the renderers for each layer.
  * @param[in]  renderToFboEnabled         Whether rendering into the Frame Buffer Object is enabled (used to measure FPS above 60)
@@ -218,6 +219,7 @@ bool ProcessTasks( BufferIndex updateBufferIndex,
                    RenderTaskList::RenderTaskContainer& taskContainer,
                    Layer& rootNode,
                    SortedLayerPointers& sortedLayers,
+                   Context& context,
                    RenderInstructionContainer& instructions,
                    RenderInstructionProcessor& renderInstructionProcessor,
                    bool renderToFboEnabled,
@@ -285,6 +287,7 @@ bool ProcessTasks( BufferIndex updateBufferIndex,
 
       renderInstructionProcessor.Prepare( updateBufferIndex,
                                           sortedLayers,
+                                          context,
                                           renderTask,
                                           renderTask.GetCullMode(),
                                           hasClippingNodes,
@@ -320,6 +323,7 @@ bool RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                    RenderTaskList& renderTasks,
                                    Layer& rootNode,
                                    SortedLayerPointers& sortedLayers,
+                                   Context& context,
                                    RenderInstructionContainer& instructions,
                                    bool renderToFboEnabled,
                                    bool isRenderingToFbo )
@@ -347,6 +351,7 @@ bool RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                 taskContainer,
                                 rootNode,
                                 sortedLayers,
+                                context,
                                 instructions,
                                 mRenderInstructionProcessor,
                                 renderToFboEnabled,
@@ -362,6 +367,7 @@ bool RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                  taskContainer,
                                  rootNode,
                                  sortedLayers,
+                                 context,
                                  instructions,
                                  mRenderInstructionProcessor,
                                  renderToFboEnabled,
index 9830f01..4f39220 100644 (file)
@@ -58,6 +58,7 @@ public:
    * @param[in]  renderTasks        The list of render-tasks.
    * @param[in]  rootNode           The root node of the scene-graph.
    * @param[in]  sortedLayers       The layers containing lists of opaque / transparent renderables.
+   * @param[in]  context            The context holding the GL state of rendering for the rendering instructions.
    * @param[out] instructions       The instructions for rendering the next frame.
    * @param[in]  renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled (used to measure FPS above 60)
    * @param[in]  isRenderingToFbo   Whether this frame is being rendered into the Frame Buffer Object (used to measure FPS above 60)
@@ -67,6 +68,7 @@ public:
                 RenderTaskList& renderTasks,
                 Layer& rootNode,
                 SortedLayerPointers& sortedLayers,
+                Context& context,
                 RenderInstructionContainer& instructions,
                 bool renderToFboEnabled,
                 bool isRenderingToFbo );
index a3e4534..b6372c3 100644 (file)
@@ -995,6 +995,7 @@ uint32_t UpdateManager::Update( float elapsedSeconds,
                                               *scene->taskList,
                                               *scene->root,
                                               scene->sortedLayerList,
+                                              *scene->scene->GetContext(),
                                               scene->scene->GetRenderInstructions(),
                                               renderToFboEnabled,
                                               isRenderingToFbo );