[Tizen] Do not call SetBufferDamagedRects if the damaged rect is empty
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-render-surface.cpp
index 22ac0f3..8dd26e9 100644 (file)
@@ -636,12 +636,6 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
     {
       mDamagedRects.assign(1, surfaceRect);
     }
-    else if(mDamagedRects.empty() && !clippingRect.IsEmpty())
-    {
-      // We will render clippingRect area but mDamagedRects is empty.
-      // So make mDamagedRects same with clippingRect to swap buffers.
-      mDamagedRects.assign(1, clippingRect);
-    }
   }
 
   // This is now done when the render pass for the render surface begins
@@ -887,6 +881,13 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
       return;
     }
 
+    if(damagedRects.empty())
+    {
+      // Empty damaged rect. We don't need rendering
+      clippingRect = Rect<int>();
+      return;
+    }
+
     mGraphics->ActivateSurfaceContext(this);
 
     EGLint bufferAge = eglImpl.GetBufferAge(mEGLSurface);