OSDN Git Service

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

@@@ -388,20 -390,14 +390,18 @@@ 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);
-                 bmp2 = imagePreset.apply(bmp2);
+                 bmp = imagePreset.apply(bmp);
                  imagePreset.setScaleFactor(scaleFactor);
-                 mZoomCache.setImage(imagePreset, bounds, bmp2);
+                 mZoomCache.setImage(imagePreset, bounds, bmp);
                  mLoadingLock.unlock();
-                 return bmp2;
+                 return bmp;
              }
          }
          mLoadingLock.unlock();