[Tizen] Fix InvalidateFrameBuffer error
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-manager.cpp
index 747f5b3..d32dbf8 100755 (executable)
@@ -586,18 +586,6 @@ void RenderManager::Render( Integration::RenderStatus& status, bool forceClear,
 
         DoRender( instruction );
       }
-
-      if ( mImpl->currentContext->IsSurfacelessContextSupported() )
-      {
-        mImpl->glContextHelperAbstraction.MakeSurfacelessContextCurrent();
-      }
-
-      GLenum attachments[] = { GL_DEPTH, GL_STENCIL };
-      mImpl->context.InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
-      for ( auto&& context : mImpl->surfaceContextContainer )
-      {
-        context->InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
-      }
     }
 
     //Notify RenderGeometries that rendering has finished
@@ -1040,6 +1028,12 @@ void RenderManager::DoRender( RenderInstruction& instruction )
   {
     mImpl->currentContext->Flush();
   }
+
+  if( instruction.mFrameBuffer && instruction.mFrameBuffer->IsSurfaceBacked() )
+  {
+    GLenum attachments[] = { GL_DEPTH, GL_STENCIL };
+    mImpl->context.InvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
+  }
 }
 
 } // namespace SceneGraph