OSDN Git Service

Merge "Revert "Stopgap fixes for more of the photo editor's memory issues."" into...
authorRuben Brunk <rubenbrunk@google.com>
Fri, 22 Feb 2013 21:47:06 +0000 (21:47 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 22 Feb 2013 21:47:06 +0000 (21:47 +0000)
1  2 
src/com/android/gallery3d/filtershow/cache/ImageLoader.java

@@@ -390,18 -388,16 +388,20 @@@ public class ImageLoader 
                  }
              }
              bmp = loadRegionBitmap(mUri, options, bounds);
 +            if (destination != null) {
 +                mLoadingLock.unlock();
 +                return bmp;
 +            }
              if (bmp != null) {
+                 // TODO: this workaround for RS might not be needed ultimately
+                 Bitmap bmp2 = bmp.copy(Bitmap.Config.ARGB_8888, true);
                  float scaleFactor = imagePreset.getScaleFactor();
                  imagePreset.setScaleFactor(1.0f);
-                 bmp = imagePreset.apply(bmp);
+                 bmp2 = imagePreset.apply(bmp2);
                  imagePreset.setScaleFactor(scaleFactor);
-                 mZoomCache.setImage(imagePreset, bounds, bmp);
+                 mZoomCache.setImage(imagePreset, bounds, bmp2);
                  mLoadingLock.unlock();
-                 return bmp;
+                 return bmp2;
              }
          }
          mLoadingLock.unlock();