Fix mipmap bug introduced with Allocation cleanup.
Add syncAll to rsg headers.

Change-Id: I02c953f3fddab3c6f4e98570cdad45a59711bbde
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 78b570a..cb00223 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -191,13 +191,6 @@
         uploadCubeTexture(isFirstUpload);
     }
 
-    if (mMipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
-        glGenerateMipmap(target);
-#endif //ANDROID_RS_BUILD_FOR_HOST
-    }
-
-
     if (!(mUsageFlags & RS_ALLOCATION_USAGE_SCRIPT)) {
         freeScriptMemory();
     }
@@ -227,6 +220,12 @@
                             format, type, p);
         }
     }
+
+    if (mMipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) {
+#ifndef ANDROID_RS_BUILD_FOR_HOST
+        glGenerateMipmap(target);
+#endif //ANDROID_RS_BUILD_FOR_HOST
+    }
 }
 
 void Allocation::uploadCubeTexture(bool isFirstUpload) {
@@ -266,6 +265,12 @@
             }
         }
     }
+
+    if (mMipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) {
+#ifndef ANDROID_RS_BUILD_FOR_HOST
+        glGenerateMipmap(target);
+#endif //ANDROID_RS_BUILD_FOR_HOST
+    }
 }
 
 void Allocation::deferedUploadToBufferObject(const Context *rsc) {