diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-30 02:26:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-30 02:26:18 +0000 |
commit | d94a961e445adbf2ebd6af702209020475c6cab3 (patch) | |
tree | cea2654d682b6fece7f60bbcb291126a18b84799 /src/com/android/gallery3d/filtershow/FilterShowActivity.java | |
parent | 373b137fd10a6db5daa605a2813b639b09dffe57 (diff) | |
parent | 3134c5478897af10e0c712794df4336fe6e3f995 (diff) | |
download | android_packages_apps_Snap-d94a961e445adbf2ebd6af702209020475c6cab3.tar.gz android_packages_apps_Snap-d94a961e445adbf2ebd6af702209020475c6cab3.tar.bz2 android_packages_apps_Snap-d94a961e445adbf2ebd6af702209020475c6cab3.zip |
Merge "Implements progressive rendering" into gb-ub-photos-bryce
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 90ef74e2f..8c5d7a4a6 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -96,6 +96,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; @@ -489,7 +491,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; @@ -881,6 +887,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); + } } // ////////////////////////////////////////////////////////////////////////////// |