diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-29 14:41:38 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-29 19:19:19 -0700 |
commit | 3134c5478897af10e0c712794df4336fe6e3f995 (patch) | |
tree | 658ee147b066912f0866f66ba50223caaddd5360 /src/com/android/gallery3d/filtershow/FilterShowActivity.java | |
parent | 534386cf6264df921f633f4c90edcab169778d26 (diff) | |
download | android_packages_apps_Snap-3134c5478897af10e0c712794df4336fe6e3f995.tar.gz android_packages_apps_Snap-3134c5478897af10e0c712794df4336fe6e3f995.tar.bz2 android_packages_apps_Snap-3134c5478897af10e0c712794df4336fe6e3f995.zip |
Implements progressive rendering
Change-Id: I32bd2072126a4fad4342f7d9ffa1cff3b5da84cf
Diffstat (limited to 'src/com/android/gallery3d/filtershow/FilterShowActivity.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 409f1e366..8bbfc558d 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -94,6 +94,8 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, private String mAction = ""; MasterImage mMasterImage = null; + private static final long LIMIT_SUPPORTS_HIGHRES = 134217728; // 128Mb + public static final String TINY_PLANET_ACTION = "com.android.camera.action.TINY_PLANET"; public static final String LAUNCH_FULLSCREEN = "launch-fullscreen"; public static final int MAX_BMAP_IN_INTENT = 990000; @@ -487,7 +489,11 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, pipeline.setOriginal(largeBitmap); float previewScale = (float) largeBitmap.getWidth() / (float) mImageLoader.getOriginalBounds().width(); pipeline.setPreviewScaleFactor(previewScale); - + Bitmap highresBitmap = mImageLoader.getOriginalBitmapHighres(); + if (highresBitmap != null) { + float highResPreviewScale = (float) highresBitmap.getWidth() / (float) mImageLoader.getOriginalBounds().width(); + pipeline.setHighResPreviewScaleFactor(highResPreviewScale); + } pipeline.turnOnPipeline(true); MasterImage.getImage().setOriginalGeometry(largeBitmap); mLoadBitmapTask = null; @@ -879,6 +885,12 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mMasterImage.setStateAdapter(mImageStateAdapter); mMasterImage.setActivity(this); mMasterImage.setImageLoader(mImageLoader); + + if (Runtime.getRuntime().maxMemory() > LIMIT_SUPPORTS_HIGHRES) { + mMasterImage.setSupportsHighRes(true); + } else { + mMasterImage.setSupportsHighRes(false); + } } // ////////////////////////////////////////////////////////////////////////////// |