[Tizen] Initialize surface before PreRender accepted/tizen/unified/20210713.124152 submit/tizen/20210713.070142
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 13 Jul 2021 05:04:58 +0000 (14:04 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 13 Jul 2021 05:05:02 +0000 (14:05 +0900)
This reverts commit 18e8a56cdc611d6e7c019a82799bc1571d8b1796.

dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/gles/egl-graphics.cpp
dali/internal/window-system/common/window-render-surface.cpp

index 356cec0..3349b76 100644 (file)
@@ -701,6 +701,8 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
           Rect<int> clippingRect; // Empty for fbo rendering
 
+          windowSurface->InitializeGraphics();
+
           // Switch to the context of the surface, merge damaged areas for previous frames
           windowSurface->PreRender(sceneSurfaceResized, mDamagedRects, clippingRect); // Switch GL context
 
index 62563e1..0ffb315 100644 (file)
@@ -86,7 +86,6 @@ void EglGraphics::ActivateSurfaceContext(Dali::RenderSurfaceInterface* surface)
 {
   if(surface)
   {
-    surface->InitializeGraphics();
     surface->MakeContextCurrent();
   }
 
@@ -170,6 +169,7 @@ void EglGraphics::ConfigureSurface(Dali::RenderSurfaceInterface* surface)
     currentSurface = surface;
     if(currentSurface)
     {
+      currentSurface->InitializeGraphics();
       ActivateSurfaceContext(currentSurface);
     }
   }
index b1ba7a1..05f0a29 100644 (file)
@@ -223,7 +223,7 @@ void WindowRenderSurface::RequestRotation(int angle, int width, int height)
 
   mWindowRotationAngle    = angle;
   mWindowRotationFinished = false;
-  mResizeFinished = false;
+  mResizeFinished         = false;
 
   mWindowBase->SetWindowRotationAngle(mWindowRotationAngle);
 
@@ -272,15 +272,15 @@ int WindowRenderSurface::GetOrientation() const
 
 void WindowRenderSurface::InitializeGraphics()
 {
-  mGraphics = &mAdaptor->GetGraphicsInterface();
+  if(mEGLContext == NULL)
+  {
+    mGraphics = &mAdaptor->GetGraphicsInterface();
 
-  DALI_ASSERT_ALWAYS(mGraphics && "Graphics interface is not created");
+    DALI_ASSERT_ALWAYS(mGraphics && "Graphics interface is not created");
 
-  auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
-  mEGL             = &eglGraphics->GetEglInterface();
+    auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
+    mEGL             = &eglGraphics->GetEglInterface();
 
-  if(mEGLContext == NULL)
-  {
     // Create the OpenGL context for this window
     Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
     eglImpl.ChooseConfig(true, mColorDepth);