Revert "[Tizen]Initialize surface before PreRender"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-render-surface.cpp
index 05f0a29..b1ba7a1 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()
 {
-  if(mEGLContext == NULL)
-  {
-    mGraphics = &mAdaptor->GetGraphicsInterface();
+  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);