Fix inverted panorama preview

 Bug: 7314703
 Panorama only support rotations of 0 and 90, so if it is greater
 than that flip the output surface texture

Change-Id: I9885feb88d2d1c3e0dabaa7ecd8db66c2ddfb93b
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 3086b24..214d0e0 100644
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -546,6 +546,10 @@
     }
 
     private int getPanoramaRotation() {
+        // Panorama only support rotations of 0 and 90, so if it is greater
+        // than that flip the output surface texture to compensate
+        if (mDisplayRotation > 180)
+            return (mCompensation + 180) % 360;
         return mCompensation;
     }