Merge "Surface: Do not copy back if front and back buffer are identical"
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index ff0a5d4..94d8578 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -1518,6 +1518,9 @@
         const Region& reg,
         int *dstFenceFd)
 {
+    if (dst->getId() == src->getId())
+        return OK;
+
     // src and dst with, height and format must be identical. no verification
     // is done here.
     status_t err;