Changes to constness of command buffer
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles-impl / egl-graphics-controller.cpp
index d2a65fe..f4f7e60 100644 (file)
@@ -301,7 +301,7 @@ void EglGraphicsController::ProcessCreateQueues()
   ProcessCreateQueue(mCreateFramebufferQueue);
 }
 
-void EglGraphicsController::ProcessCommandBuffer(GLES::CommandBuffer& commandBuffer)
+void EglGraphicsController::ProcessCommandBuffer(const GLES::CommandBuffer& commandBuffer)
 {
   for(auto& cmd : commandBuffer.GetCommands())
   {
@@ -395,6 +395,9 @@ void EglGraphicsController::ProcessCommandBuffer(GLES::CommandBuffer& commandBuf
       case GLES::CommandType::PRESENT_RENDER_TARGET:
       {
         ResolvePresentRenderTarget(cmd.presentRenderTarget.targetToPresent);
+
+        // push this command buffer to the discard queue
+        mDiscardCommandBufferQueue.push(const_cast<GLES::CommandBuffer*>(&commandBuffer));
         break;
       }
       case GLES::CommandType::EXECUTE_COMMAND_BUFFERS:
@@ -405,7 +408,7 @@ void EglGraphicsController::ProcessCommandBuffer(GLES::CommandBuffer& commandBuf
         //       within secondaries.
         for(auto& buf : cmd.executeCommandBuffers.buffers)
         {
-          ProcessCommandBuffer(*static_cast<GLES::CommandBuffer*>(buf));
+          ProcessCommandBuffer(*static_cast<const GLES::CommandBuffer*>(buf));
         }
         break;
       }