diff options
author | Owen Lin <owenlin@google.com> | 2010-01-28 16:10:19 -0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2010-02-26 20:26:48 +0800 |
commit | 4de149ceb47f2c251f646419907424bfb67d2b64 (patch) | |
tree | 6f48682fe065902039bad89d1f3ca90720eca819 /src/com/android/camera/Util.java | |
parent | 02627adfa3d240d817e34af69be8d07e9c66c136 (diff) | |
download | LegacyCamera-4de149ceb47f2c251f646419907424bfb67d2b64.zip LegacyCamera-4de149ceb47f2c251f646419907424bfb67d2b64.tar.gz LegacyCamera-4de149ceb47f2c251f646419907424bfb67d2b64.tar.bz2 |
The first runnable version of the new UI.
Implement the new UI with OpenGL (GLSurfaceView).
Known issues:
* Texture are never freed from GL
* Do not consider the density of screen. Currently, the dimensions in mdpi
devices are wrong.
* It won't work on Sapphire, bug fired: Bug: 2473605
* The action UP event may pass a wrong target. (It should pass to the same
target who recive the DOWN action.
* Animation is not smooth enough.
* Should not allocate objects into heap during rendering path.
* The scrollbar in GLListView doesn't match the design
* We should calculate our own orientation instead of using the system one.
* Regression: "restore to default settings" is removed
Change-Id: I93fa45831aa87787dd5ee9e43e270a9d786c5a2a
Diffstat (limited to 'src/com/android/camera/Util.java')
-rw-r--r-- | src/com/android/camera/Util.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index df014cd..5cbfd13 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -18,17 +18,13 @@ package com.android.camera; import android.app.Activity; import android.app.AlertDialog; -import android.app.ProgressDialog; import android.content.ContentResolver; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import android.graphics.Canvas; import android.graphics.Matrix; -import android.graphics.Rect; import android.net.Uri; -import android.os.Handler; import android.os.ParcelFileDescriptor; import android.util.Log; import android.view.View; @@ -259,11 +255,6 @@ public class Util { } } - public static boolean equals(String a, String b) { - // return true if both string are null or the content equals - return a == b || a.equals(b); - } - // Returns an intent which is used for "set as" menu items. public static Intent createSetAsIntent(IImage image) { Uri u = image.fullSizeImageUri(); @@ -346,4 +337,18 @@ public class Util { public static boolean equals(Object a, Object b) { return (a == b) || (a == null ? false : a.equals(b)); } + + public static boolean isPowerOf2(int n) { + return (n & -n) == n; + } + + public static int nextPowerOf2(int n) { + n -= 1; + n |= n >>> 16; + n |= n >>> 8; + n |= n >>> 4; + n |= n >>> 2; + n |= n >>> 1; + return n + 1; + } } |