Initialize surface before PreRender 62/260862/4
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 6 Jul 2021 02:03:18 +0000 (11:03 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 16 Jul 2021 08:13:39 +0000 (08:13 +0000)
Change-Id: I76419b6e29a0c761b103c596441083bce134e614

dali/internal/window-system/common/window-render-surface.cpp

index b1ba7a1..475765e 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);
@@ -428,6 +428,8 @@ void WindowRenderSurface::StartRender()
 
 bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect)
 {
+  InitializeGraphics();
+
   mDamagedRects.assign(damagedRects.begin(), damagedRects.end());
 
   Dali::Integration::Scene::FrameCallbackContainer callbacks;